#code-help-voice-text

5 messages · Page 8 of 1

main solar
#

def exercice41():
n=0
s=0
while s<10:
n=n+1
s=s+n
return n

#

I don't really understand how it gives me 4

main solar
#

how do i import ascii

faint hinge
#

!e

from collections import Counter

ham = ['a', 'a', 'b', 'b', 'b', 'b', 'b', 'c', 'e', 'c']

pork = Counter(ham)
print(pork)
for key in pork.keys():
  print(key)
keen onyxBOT
#

@faint hinge :white_check_mark: Your eval job has completed with return code 0.

001 | Counter({'b': 5, 'a': 2, 'c': 2, 'e': 1})
002 | a
003 | b
004 | c
005 | e
faint hinge
#

!e

from collections import Counter

ham = ['a', 'a', 'b', 'b', 'b', 'b', 'b', 'c', 'e', 'c']

pork = Counter(ham)
print(pork)
for key, value in pork.items():
  print(key, value)
keen onyxBOT
#

@faint hinge :white_check_mark: Your eval job has completed with return code 0.

001 | Counter({'b': 5, 'a': 2, 'c': 2, 'e': 1})
002 | a 2
003 | b 5
004 | c 2
005 | e 1
real tangle
#

from collections import Counter

ham = ['a', 'a', 'b', 'b', 'b', 'b', 'b', 'c', 'e', 'c']
print(ham)
pork = Counter(ham)
print(pork)
number_of_pairs = 0

for value in pork.values():
number_of_pairs += value // 2

print(number_of_pairs)

#

def count_pairs(socks):
# your code goes here

if name == "main":
# first, we split the input line on whitespace
# this problem can use a list of strings or integers
nums = input().split()
total = count_pairs(nums)
print(total)

#
def count_pairs(socks):
    # your code goes here
    
    
if __name__ == "__main__":
    # first, we split the input line on whitespace
    # this problem can use a list of strings or integers
    nums = input().split() 
    total = count_pairs(nums) 
    print(total)
faint hinge
#
x += 1
x = x + 1
#

4/2/22

#

5/2/22

real tangle
#
from collections import Counter

def count_pairs(socks):
    Amount = Counter(socks)
    Start = 0
    
for value in Amount.values():
    Start = Start + Amount // 2
    
return Start
        
    
if __name__ == "__main__":
    # first, we split the input line on whitespace
    # this problem can use a list of strings or integers
    nums = input().split() 
    total = count_pairs(nums) 
    print(total)
#
from collections import Counter

def count_pairs(socks):
    Amount = Counter(socks)
    Start = 0
    
    for value in Amount.values():
        Start = Start + value // 2
    
        return Start
        
    
if __name__ == "__main__":
    # first, we split the input line on whitespace
    # this problem can use a list of strings or integers
    nums = input().split() 
    total = count_pairs(nums) 
    print(total)
vague rune
#

BSTInsert

main solar
#

i need help

#

mustafa

#

please look

knotty holly
#

Heyo

#

Who we helping?

#

Erm, sorry? 😄

#

Oh right I remember

#

Not a woman's voice, just not as deep as MAD

#

Exactly

#

How's it going?

#

100% deserved ✅

#

Right 🤔

#

How do we do it?

#

I think when your bot starts up, don't you get sent the entire members list? (as long as you have the right intents enabled)

#

Yea, what Mustafa said.

#

Ah yeah they have a 12-month free tier.

#

AWS

#

I'm still here 😄

#

Do you still need help?

#

Erm, what are you talking about? @main solar

#

Yes. I am.

#

Because I don't have a microphone right now.

#

Erm, so @lost jungle, are you working on your problem?

torn latch
#

The song came from the bathroom belting over the sound of the shower's running water. It was the same way each day began since he could remember. It listened intently and concluded that the singing today was as terrible as it had ever been.

flat condor
#

!e

keen onyxBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

flat condor
#

!e
Print('HELLO)

#

!e
Print('HELLO')

#

e!

#

!e
def escreval(txt)
tam = len(txt)+4
print('-'*tam)
print(f' {txt} ')
print('-'*tam)

escreval ('Hello guys')

keen onyxBOT
#

@flat condor :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     def escreval(txt) 
003 |                       ^
004 | SyntaxError: expected ':'
flat condor
#

Wtf

#

!e
def escreval(txt)
tam = len(txt)+4
print('-'tam)
print(f'" {txt} ")
print('-'tam)

escreval ('Hello guys')

keen onyxBOT
#

@flat condor :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     def escreval(txt) 
003 |                       ^
004 | SyntaxError: expected ':'
flat condor
#

!e print ('hello')

keen onyxBOT
#

@flat condor :white_check_mark: Your eval job has completed with return code 0.

hello
sudden otter
#

How to turn list = [ -1 , 2 , -3] into positive

#

leaving positive positive

#

all including postivie value into positive

flat condor
#

!voiceverify

tepid arrow
#

!e

keen onyxBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

tepid arrow
#

!e

keen onyxBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

tepid arrow
#

e

#

!e print("school biodata")
nama = input("input your name")
kelas = input("input your class",nama)

print("thank you to fill this document",nama,"kelas",kelas,"!")

keen onyxBOT
#

@tepid arrow :x: Your eval job has completed with return code 1.

001 | school biodata
002 | input your nameTraceback (most recent call last):
003 |   File "<string>", line 2, in <module>
004 | EOFError: EOF when reading a line
tepid arrow
#

!e print("school biodata")
nama = input("input your name")
kelas = input("input your class")

print("thank you to fill this document",nama,"kelas",kelas,"!")

keen onyxBOT
#

@tepid arrow :x: Your eval job has completed with return code 1.

001 | school biodata
002 | input your nameTraceback (most recent call last):
003 |   File "<string>", line 2, in <module>
004 | EOFError: EOF when reading a line
stuck arch
#

hi

#

i need a free lancer, can i help me xD

reef canyon
#

hi everyone is it possible to code location trucker with pycharm have a great day 🙂

round rose
#

Anyone avalible right now ?

#####
# L D
# C #
P C #
#####

Maze 2 - 7 8
########
P M  H #
###### #
#LL M A#
#L######
#LLL   #
######D#```
txt of the game map

```def load_game(filename: str) -> list['Level']:
    """ Reads a game file and creates a list of all the levels in order.

    Parameters:
        filename: The path to the game file

    Returns:
        A list of all Level instances to play in the game
    """
    levels = []
    with open(filename, 'r') as file:
        for line in file:
            line = line.strip()
            if line.startswith('Maze'):
                _, _, dimensions = line[5:].partition(' - ')

                dimensions = [int(item) for item in dimensions.split()]

                levels.append(Level(dimensions))
            elif len(line) > 0 and len(levels) > 0:
                levels[-1].add_row(line)

    return levels
``` function of reading it

How do i make it so it reads each maze separately ?

in this example, i want lists to be =

levels[0] =

L D

C

P C #

levels[1] =
########
P M H #

#LL M A#
#L######
#LLL #
######D#

instead of them both being

L D

C

P C #

########
P M H #

#LL M A#
#L######
#LLL #
######D#

#

i rewrote the function and it still does the same thing

#

No idea why

#

I asked my friend to run it on his complier and it's the same too

#

It's really urgent i need it to be done in half an hour

#
    """ Reads a game file and creates a list of all the levels in order.

    Parameters:
        filename: The path to the game file

    Returns:
        A list of all Level instances to play in the game
    """
    levels = []
    with open(filename, 'r') as file:
        string_levels = file.read().strip().split('Maze')
        string_levels.pop(0)
        #print(string_levels)
        ctr = 0
        for level in string_levels:
            rows = level.split('\n')
            dimensions = int(rows[0].split()[-2]), int(rows[0].split()[-1])
            print(rows)
            levels.append(Level(dimensions))
            for row in rows[1:]:
                levels[ctr].add_row(row)


            ctr += 1
    return levels

#

my attempt to rewrite it and it's stil lthe same

timid moth
#

Hey guys

#

I am sort of clueless

#

Can I have some help with

#

"You just moved to a new town, and you'd like to get new friends as soon as possible. You've decided to create a phone book application, or at least some parts of it first.

While you were experimenting with a friendly user interface, you attended a cool office party where you collected a few phone numbers. Later on you realized that many numbers are incorrect (maybe the party was too good), so you decided to write a program that selects the good ones, and also checks for their area codes."

#

I have a few tasks

#
  1. Hello there
    Ask for the user's name in greetings.py, and print out a friendly, personalized message.
    The program asks for the user's name.
    After the input, the program greets the user by the given name like this: Hello XY, I am your phone book.

  2. Still in in greetings.py, ask for the user's age, and print a polite message based on the answer. Only integers should be accepted.
    If the input is not an integer, the following message is displayed: That doesn't seem to be an integer.
    If the user is 18 or younger, the following message is displayed: You are so young! Life is ahead of you!
    If the user is older than 18, but younger than 40, the following message is displayed: That's a nice age!
    If the user is at least 40, the program prints out the following message: You must be very wise!

  3. You found a few numbers in your phonebook that are shorter than the others so they are possibly wrong numbers. A properly formatted number should be 10 characters long (including dashes). Your task is to separate the good ones from the wrong ones based on the length, and print the two lists after each other. Formatting and dashes do not matter here.
    The program selects the too short and too long numbers.
    The program prints out the good phone numbers first, then the list of the wrong ones.

  4. Print out the list of area codes and the list of phone numbers separately.
    The area codes are printed as a separate list.
    The phone numbers are printed without the area codes separately.
    Both lists contain pieces of completely valid phone numbers.

  5. Collect the unique area codes from the list.
    The program prints out the list of all area codes (without duplicates).
    The list contains area codes of completely valid phone numbers.

  6. Count how many (valid) phone numbers belong to the given area codes.
    The program counts (without hardcoding the results) the phone numbers belonging to the three given area codes (98, 34, 72) and prints the results.
    The counter only counts valid phone numbers.

coral meteor
#

@light pasture File "d:\random-py-projects\intern\daddy1\src\development\main.py", line 27, in downloader os.rename("'"+str(in_audio.title)+".mp4"+"'", valid_filename+".tempM") FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden: "''Till I Collapse.mp4'" -> "'Till_I_Collapse.tempM"

#
    t_1 = time.time()

    
    filtered_stream_audio = in_audio.streams.filter(progressive=False, only_audio=True)[1]
    print(filtered_stream_audio)

    filtered_stream_audio.download(os.path.dirname(os.path.realpath(__file__)) + "/MUSIC")
    time.sleep(1)
    os.rename("'"+str(in_audio.title)+".mp4"+"'", valid_filename+".tempM")
vague rune
#

!ytdl

keen onyxBOT
#

Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.

For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:

The following restrictions apply to your use of the Service. You are not allowed to:

1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service;  (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;

3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;

9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
full sail
main solar
#

@main solaroi

#

sorry

#

what's up

compact charm
#

!e print("test")

keen onyxBOT
#

@compact charm :white_check_mark: Your eval job has completed with return code 0.

test
zenith lodge
#

pls help there is no color and there is (32m when i run in cmd

gusty tusk
#

Is anyone

#

faced a problem of a lack of

#

proxies

#

i mean, free proxies

#

it's not that confident, although i need few ones

untold violet
#

Does anyone know firewall log parsing here ?!

hasty flax
#

Hi any flask dev here?

keen onyxBOT
#

@bitter grove :x: Your eval job has completed with return code 1.

001 | CuriousTraceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | EOFError: EOF when reading a line
shut cipher
#

Guys

wise palm
#

it's very very goergeous the python language

#

!E

keen onyxBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

wise palm
#

!e

keen onyxBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

wise palm
#

!e 34

haughty spindle
#

Is anyone able to teach me coding? I am new

gusty tusk
# haughty spindle Is anyone able to teach me coding? I am new

Learn the basics (few really good courses on youtube and free to study platforms), then move to algorithms(codewars might be a good choice)
Then start practicing and using modules. Although, i would definitely recommend you to start learning from C or C++, beacuse python is based on the last one

#

So, it would be much easier for you to get some basics starting from scratch

#

BTW gl on your way

minor ledge
#

hi guys

#

I need help to translate a game from phyton to C

#

can anyone help me?

civic dragon
#

if I have an empty list, and I am appending x elements at a time inside the list and running the loop y times, my list should have x*y elements when I check its length, right?

#
for i in range(M.shape[0]):
        u_id=5000*M_ind+i
        m, _ = func(M[i])
        m_s = small_window_sampling(m)
        
        while (c<15):
            print("data after small window sampling")
            start.append(m_s[c][0][0])
            end.append(m_s[c][-1][0])
            c+=1
            subtraj_id.append(c)
#

can someone help me figure out the error, seems to be basic but im stuck for hours

#

ping me if someone can help, on voice preferrably to get better context of the issue

rigid heron
civic dragon
#

sec ill share my screen

#

its not allowing me to share screen

rigid heron
#

you can share screen shot here

#

in case you need to know this

civic dragon
#

predict function returns a numpy array of 15 elements each

#

i want to build a dataframe with start_ts, end_ts, subtraj_id and pip as columns

#

im converting pip into a list, while for others im appending them to a list so that they can have same length as pip and I can finally store them into a dataframe

rigid heron
#

did you try printing arrays before and after loop

civic dragon
# civic dragon

this is kind of a snippet which I cut and paste, the whole code is a bit of a mess so cant share it in a single ss

rigid heron
#

then what's is the error actually ?

civic dragon
#

do you know if there's a way I could share my screen?

rigid heron
#

for that you need a helper ig

#

i might not be able to help

civic dragon
#

ah, crap

rigid heron
#

they can give you perms

civic dragon
#

I cant really explain the issue without showing you the code

rigid heron
#

!paste

keen onyxBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

rigid heron
#

or you can ask a helper in #python-discussion to give you perms they might suggest something good

#

sure

#

but i don't have experience with numpy

cursive totem
#

Hello guys, I'm trying to understand something about my code by using the debugger, could anyone help me on using it in any voice chat? I could show the code

civic dragon
#

anyone familiar in PyQT or Tkinter?

civic dragon
#

if you have worked with it a lil, you might be able to help me

balmy obsidian
#

Hey I've run into a confusing problem with my program I was wondering if somebody could help me, It has to be someone who can give me permission to stream temporarily as well so i can show it and explain it better

#

I'm in the code/help chat

vague rune
#

!voice

keen onyxBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

frozen loom
#

is there anyone who can help me out in machine leaning project

#

???

#

hey is there anyone

#

????

spice token
#

!voice

keen onyxBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

spice token
#

anyone around to help out with understanding classes and using lists

main solar
#

classes are fire especially for python

#

@spice token

pallid sequoia
#

eggs, bacon, spam = 'What is going on, Marty?'.partition(',')
what is bacon after the following lines are executed?

keen onyxBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

main solar
#

I don't get

#

I AM İDİOT

#

asdşlkfjsdşf

#

nooooooo

#

ı am not put the equal

#

look it that padx

#

asdfadfs

untold violet
#

Guys need help !

#

I wanna write script for Linux OS, where we need to get a disk management status and if 1GB data is added or crossed the threshold value I should get a notification !!

#

Can someone help me with this please

brisk isle
#

Hi!

#

I need help

#

I'm trying to center a div in CSS

#

Anyone know how to do it?

wind goblet
brisk isle
#

Thank you Charlie S

pearl delta
#

im trying to figure out some python best practices

#

i wonder how close I am to the minimum for voice verification

keen onyxBOT
#

You may not use this command on users other than yourself.

#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

safe burrow
#

hi, wanted to ask if someone here has knowledge about Arduino with c in visual studio

faint hinge
#

@main solar and @buoyant seal

buoyant seal
#

hello

fringe flax
#

👋

main solar
#

hii mr.hemlock !

faint hinge
#

Hello!

#

So what're you trying to figure out/learn about/asking about, etc.

buoyant seal
#

they just wanna learn html and move to python

main solar
buoyant seal
#

so this is how you style

#

@main solar you watchin?

main solar
buoyant seal
#

yea it does

main solar
#

what's console log for again~?

buoyant seal
#

console.log = print in python

main solar
#

ohh thank u hlemlock !

buoyant seal
#

damn i forgot to comment in html

main solar
buoyant seal
#

comments are code that dont run

main solar
#

then why do we need them~?

buoyant seal
#

or just like desccription of wtf ya doign in that code

main solar
#

oh like meta ?

buoyant seal
#

like whats your point of adding that code

main solar
#

meta charset or meta name thingies ?

buoyant seal
#

i never bothered with meta stuff idk bout that

main solar
#

mr.hemlock we need ur help~!

#

@faint hinge

buoyant seal
#

hmm??

main solar
#

hmm ?

faint hinge
slow cipher
#

Anyone able to hop in a call to help me w/ a certain issue. It's mainly a practice problem. Have my solution written out. Have attempted the help channel but no success. Would appreciate it

fierce pasture
#

hello

main solar
misty gazelle
#

hi guy's i rally need help, can Samoan help me pls

#

if u can help me text me on privet

#

pls

halcyon socket
#

can someone tell me what i should learn first java or python?

#

please

main solar
#

good

tacit fern
pearl delta
#

hey having trouble in a flask app

#

when i serve a react app from flask, the routing seems to be intercepted by flask

#

i use routing on the client side

pearl delta
#

whatsup all

#

i think i need to write more messages before i can do the livechat

#

is there anyway to check how many messages ive written

pearl delta
# halcyon socket please

python will definitely give you a smoother intro. but IMO learning multiple is ideal. it depends what you want to do

wind goblet
#

Do ctrl+f then search for yourself

#

It gives you a count

pearl delta
modern dust
#

!voice @hidden birch

keen onyxBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

modern dust
#

Pls respond here @hidden birch

hidden birch
#

oke

#

i cant speak i guess?

#

ive only been here for an hour

#

yeah ok ill type then

#

cant really wait for three days unfortunately hahah

#

so im trying to numerically solve sods shock tube using the leapfrog method which isnt really important for the question but anyways i explained it a bit in the banana help channel

#

so im trying to make a list of lists but instead of appending the lists they intertwine for some reason

#

the last bit of what you said wasnt really understandable its probably my internet

#

ok i can hear you again

#

and not anymore

#

ok turned it off and on again should be fixed now

#

i can hear you again now

#

yeah i guess

modern dust
#
[[item11, item12], [item21, item22]]
hidden birch
#

yes

#

yeah i make a list with the initial data

#

me neither sorry

#

euhm so what im doing is make some initial data for time t=0 to then apply a numerical method and generate the data for the next timesteps

#

the function init_func works fine for this and i then put this in a list in de main function numsim

#

its too long for discord

#

but i can post the functions

#

def numsim(duration, cfl, domain, deltax, ul, ur, rhol, rhor, El, Er): # creates matrix of data points along the x axis for a number of timesteps
deltat = cfl * deltax
timesteps = int(duration / deltat)
domrange = int(domain/deltax)
a = deltat/(2*deltax)
func_t = [init_func(domrange, ul, ur, rhol, rhor, El, Er), init_func(domrange, ul, ur, rhol, rhor, El, Er)] # [[[density, momentum, energy], ...]]

for t in range(2, timesteps):
    func_x = []
    for x in range(domrange):
        func_p1 = np.subtract(func_t[t-2][x % domrange], np.multiply(a, np.subtract(func(func_t[t-1][(x+1) % domrange]), func(func_t[t-1][(x-1) % domrange]))))
        func_x.append(func_p1)
    func_t.append(func_x)

return func_t
#

def init_func(domrange, ul, ur, rhol, rhor, El, Er):
x = [[rhol, rholul, El] if i < (domrange/2) else [rhor, rhorur, Er] for i in range(domrange)]
return x

#

so the problem i have with leapfrog is that it looks back in time two steps, so i need timesteps of initial data instead of the one for the other methods

#

so what i wanted to do was just copy the initial data from time t= and use it for time t=

#

1

#

so the 3D list is indexed like func_t[timestep][x][rho, u, E]

#

and i am able to make a list with [0][x][items], but when i want to append [1][x][items] it somehow intertwines the two lists

#

i dont understand how i did that

#

i tried [initial data]*2 which should produce [initial, initial]

#

but instead its more like [iinniittiiaall]

#

in the rest of the program it also just appends the new timestep data to the func_t list and that works fine but for some reason it doesnt work for the initial data

#

i tried it the way you see in the code, i also tried the *2 mehtod and also to do func_t.append(init_func)

#

all give the same wrong result

#

whats i want to happen is that the first half of the x data has one value and the second half it has another value but instead it keeps the first value all the way to the end of the range of x and then switches to the new value

#

as if its suddenly double the length of what i told it to be

#

so i guess it somehow intertwined

#

yeah take your time

#

yes

#

yes

#

yeah it took me a long time to understand what i was doing too haha

#

its for my bachelorthesis

#

which needs to be finished in a couple of days woops

#

its a list of all the datapoints

#

so on the x axis i want it to run from 0 to 20 but with steps of deltax = 0.01 or something

#

so in order to get the necessary amount of datapoints i divide the domain by the deltax

#

so its big

#

great

#

thanks

modern dust
#

func_t.append([func_x])

hidden birch
#

euhhh the problem should not be in the for loop but before that

#

the first time i make the func_t list

#

i want it to be a list of two lists

#

two identical lists

#

but somehow they get mixed

#

because the rest in the for loop should be correct since it works for the other methods

modern dust
#
[[['0 - data1'], ['0 - data2']], [['1 - data1'], ['1 - data2']], [['2 - data0', '2 - data1']], [['3 - data0', '3 - data1']], [['4 - data0', '4 - data1']]]
hidden birch
#

uhhhm i think so yeah

#

yup

modern dust
#

!e

def numsim(duration):
    timesteps = duration
    domrange = 2
    func_t = [init_func(domrange, 0), init_func(domrange, 1)]

    for t in range(2, timesteps):
        func_x = []
        for x in range(domrange):
            func_p1 = f"{t} - data{x}"
            func_x.append(func_p1)
        func_t.append([func_x])

    return func_t
def init_func(domrange, val):
    x = [[f"{val} - data1"] if i < (domrange/2) else [f"{val} - data2"] for i in range(domrange)]
    return x

print(numsim(5))
keen onyxBOT
#

@modern dust :white_check_mark: Your eval job has completed with return code 0.

[[['0 - data1'], ['0 - data2']], [['1 - data1'], ['1 - data2']], [['2 - data0', '2 - data1']], [['3 - data0', '3 - data1']], [['4 - data0', '4 - data1']]]
hidden birch
#

hmm ok ill try to run it with thos e extra brackets

#

but i dont understand if thats the problem how can it work for the rest

#

now it says list index out of range

#

so i dont think that was it

modern dust
#

Hmm, you probably need to adjust your accessors also

#

Oh, hold up

#

Np.subtract returns an array?

hidden birch
#

it should yes

modern dust
#

Ok, then that's my bad

#

Let me keep looking

hidden birch
#

it subtract arrays elementwise

modern dust
#

Yeah

#

Ok

keen onyxBOT
modern dust
#

I got the file

#

Ty

hidden birch
#

oh you did

#

it says it doesnt send it

#

anyways you can see the entire file in the pastebin

#

yes

#

i can also send you one of the working files so you can see what its supposed to do

#

this is another method for the same thing

#

the difference between the two files?

#

the difference bewteen the two versions of code is the method used to approximate the analytical solution

#

so the working one uses the rusanov scheme and the one not working is the leapfrog shceme

#

they are numerical methods to approximate the analytical solution of a system of differential equations

hidden birch
#

the working example only looks at the previous timestep to calculate the next, so the initial data for 1 timestep is enough, but the leapfrog method looks 2 steps back so it needs two initial timesteps as inital data to work

hidden birch
#

yes its slow

#

but you dont get all the warnings and errors to end up with only the analytical solution on the graph?

#

it should be a lot faster if you remove the file writing

#

i get these warnings

#

d:/BelangrijkeDocumenten/Unief/Programmeren/python_code/Bachelorproef/Leapfrog.py:15: RuntimeWarning: overflow encountered in double_scalars
p = (gamma-1)(ener - (1/2)(mom2)/rho)
d:/BelangrijkeDocumenten/Unief/Programmeren/python_code/Bachelorproef/Leapfrog.py:20: RuntimeWarning: overflow encountered in double_scalars
f2 = (mom
2)/rho + p
d:/BelangrijkeDocumenten/Unief/Programmeren/python_code/Bachelorproef/Leapfrog.py:20: RuntimeWarning: invalid value encountered in double_scalars
f2 = (mom**2)/rho + p
d:/BelangrijkeDocumenten/Unief/Programmeren/python_code/Bachelorproef/Leapfrog.py:34: RuntimeWarning: invalid value encountered in subtract
func_p1 = np.subtract(func_t[t-2][x % domrange], np.multiply(a, np.subtract(func(func_t[t-1][(x+1) % domrange]), func(func_t[t-1][(x-1) % domrange]))))

#

and no blue graph on the plot only the black one

#

and in the file where it writes all the data you should see the values change around line 1000 because thats domrange/2, but it doesnt, it only changes at line 2000 at the end of the range

#

also at line 2 in the textfile it randomly gives the values which shouldnt appear untill after line 1000

modern dust
#

Yeah, much faster now

#

I get the same warnings

hidden birch
#

any ideas?

modern dust
# hidden birch any ideas?

Been playing with it for a while and haven't been able to get it working. I'm pretty sure it's your formula here:

func_p1 = np.subtract(func_t[t - 2][x % domrange], np.multiply(a, np.subtract(
          func(func_t[t - 1][(x + 1) % domrange]), func(func_t[t - 1][(x - 1) % domrange]))))
hidden birch
#

Well this is the formula

#

with the j being the x and the n being the timestep

#

as far as i can see the formula should be correct

#

i still think the initial data is wrong

modern dust
#

I can't find it, sorry. Good luck with it. Keep posting in the help channels and I'm sure someone with better data science knowledge can figure it out.

hidden birch
#

ok thank you for your time

modern dust
#

No problem

#

I may try more later but I'm a bit tired of looking at it currently

#

Lol

hidden birch
#

i understand hahah

modern dust
#

I'll DM you if I get it.

hidden birch
#

great thanks

balmy obsidian
#

could somebody help me with this problem i have? I'm stumped

crude cave
#

Can someone teach me how to make a screenshot function using python? I needed that part in my project

stray cedar
#

just finished my first osint instagram tool in python that uses your sessionid ion your instagram profile. using the insepct element. tell me what you guys think, or any touches that need to be done. i think it looks good but i wanna know what other people think about it

for this picture i just used a fake name and whatnot for privacy reasons but this will go through a bunch of accounts that are similar.

modern dust
#

Here is better

silent merlin
#

still cant talk

uneven gust
#

I've a quick question :

      print("It's true!")```
 
When I run this line of code, it prints the given text. Why?
(Plus, I'm not in the call.)
Anyone?
dapper mirage
#

@uneven gustI'm not sure I understand... what would prevent it from printing?

#

True is a "yes" for the if, so it succeeds...

#

since the if succeeds, it prints the text

#

in any case, I have to go out for a bit... back in under an hour

dapper mirage
#

ok, back, and I see you first asked 2 hrs ago... in any case, respond if you want

dapper verge
amber epoch
#

!e py import ast text = "{'apples': 7, 'pears': 6}" the_dict = ast.literal_eval(text) print(the_dict) print(type(the_dict))

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | {'apples': 7, 'pears': 6}
002 | <class 'dict'>
amber epoch
#

@wild wasp

#

!e py the_dict = {"apples": 7, "pears": 6} additional_dict = {"grapes": 30} the_dict.update(additional_dict) print(the_dict)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

{'apples': 7, 'pears': 6, 'grapes': 30}
amber epoch
#

!e py things = ["apples", "pears", "oranges"] additional_list = ["grapes", "guavas", "peaches"] for each in additional_list: things.append(each) print(things)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

['apples', 'pears', 'oranges', 'grapes', 'guavas', 'peaches']
amber epoch
#

!e py things = ["apples", "pears", "oranges"] additional_list = ["grapes", "guavas", "peaches"] things.extend(additional_list) print(things)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

['apples', 'pears', 'oranges', 'grapes', 'guavas', 'peaches']
amber epoch
#

!e py import ast things = [] text = "(1,2)" the_tuple = ast.literal_eval(text) things.append(the_tuple) print(things)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

[(1, 2)]
amber epoch
#

!e py d = {"apples": 5} print(d["apples"]) print(d["pears"])

keen onyxBOT
#

@amber epoch :x: Your eval job has completed with return code 1.

001 | 5
002 | Traceback (most recent call last):
003 |   File "<string>", line 3, in <module>
004 | KeyError: 'pears'
keen onyxBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

amber epoch
#

!e ```py
class MyClass:
pass

mc = MyClass()
print(type(mc))
print(type(MyClass))```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | <class '__main__.MyClass'>
002 | <class 'type'>
amber epoch
#

!e ```py
class MyClass:
def method(self):
print(self)

mc = MyClass()
mc.method()
print(mc)```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | <__main__.MyClass object at 0x7f34ad519ba0>
002 | <__main__.MyClass object at 0x7f34ad519ba0>
amber epoch
#

!e ```py
class MyClass:
def method(self):
print(self)

a = MyClass()
b = MyClass()
a.method()
b.method()```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | <__main__.MyClass object at 0x7f482dfcdb70>
002 | <__main__.MyClass object at 0x7f482dfcdb40>
amber epoch
#

!e ```py
class MyClass:
def init(self):
print("Hello!")

MyClass()```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

Hello!
amber epoch
#

!e ```py
class MyClass:
def init(self, v):
self.v = v

mc = MyClass(5)
print(mc.v)```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

5
restive dew
#

!e

class Monster:
    def __init__(self, monstertype):
        self.monstertype = monstertype

v = Monster('vampire')
print(v.monstertype)
z = Monster('Zombie')
print(z.monstertype)
keen onyxBOT
#

@restive dew :white_check_mark: Your eval job has completed with return code 0.

001 | vampire
002 | Zombie
amber epoch
#

!e ```py
class Person:
def init(self, name):
self.name = name

person_one = Person("Peter")
person_two = Person("Jane")

print(person_one.name)
print(person_two.name)```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | Peter
002 | Jane
amber epoch
#

Beginners to the language will write what's known as spaghetti code to achieve a goal. Classes are a tool in your toolbox. The more tools you have in your toolbox, the fewer tools you'll need to solve a given problem, because you'll have the right ones.

#

Every variable is a named reference, a signpost to an object.

wild wasp
#
person_three = Person("Mike")
amber epoch
#

!e ```py
class MyClass:
def init(self):
self.v = 5

def method(self):
    return self.v

mc = MyClass()
print(mc.method())```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

5
restive dew
#

🤷‍♂️

#

He's teaching him how to use classes for his project

#

we don't know his project opal does

restive dew
#

metasploit

unkempt otter
#

oh

#

oh i see

#

well im learning python

#

i just started for like 2 week 2hr a day

#

at the moment im still in the begining faze so .formats

#

an f fuctions

#

at the moment nothing much yea ik about f strings

#

oh no i was just in here because i couldn't speak

#

ok

#

better

#

yea

#

i saw it

#

lol how is that possible

fluid herald
#

hey?

restive dew
#

Lofi Girl

upbeat elm
#

a = input("what is your name")
print(a)

#

.

#

what is your nameTraceback (most recent call last):
File "D:\python codes 1\input.py", line 1, in <module>
a = input("what is your name")
EOFError: EOF when reading a line

uneven holly
#

asking for payment as verificatoin

barren birch
#

im here now. how do i get the Code box like Sage did? that ^

#

Im trying to track an image of a thing left and right and when its moving left hit 2 and right 3 to move the goal. I got it to work kind of. Is there a way to track the left and right (x i think) of the found .png using pyautogui? if so, can i have it store the value and compare it to see if its increasing or decreasing? that would be much cleaner. I would like someone to chat with to see what the best way for this to work. if you are willing to assist you are welcome to message me directly. even a word or something to research about would help, im lost

from pyautogui import *
import pyautogui
import time
import keyboard
import random
import win32api, win32con

while 1:
    if pyautogui.locateOnScreen('GW2FG_Player.png', region=(1164,1180,234,25), confidence=0.8) != None:

        if pyautogui.locateOnScreen('GW2FG_PlayerLeft.png', region=(1164,1180,234,25), confidence=0.8) != None:
            pyautogui.keyDown('2')
            print('Move Left')
            time.sleep(0.2)
        else:
            pyautogui.keyUp('2')

                    
        if pyautogui.locateOnScreen('GW2FG_PlayerRight.png', region=(1164,1180,234,25), confidence=0.8) != None:
            pyautogui.keyDown('3')
            print('Move Right')
            time.sleep(0.2)
        else:
            pyautogui.keyUp('3')
                    
    else:
        print('Not Fishing')
        time.sleep(0.5)
amber epoch
#

@wild wasp

#

!e py from string import ascii_lowercase as alphabet print(alphabet[:2])

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

ab
amber epoch
#

!d slice

keen onyxBOT
#

class slice(stop)``````py

class slice(start, stop[, step])```
Return a [slice](https://docs.python.org/3/glossary.html#term-slice) object representing the set of indices specified by `range(start, stop, step)`. The *start* and *step* arguments default to `None`. Slice objects have read-only data attributes `start`, `stop`, and `step` which merely return the argument values (or their default). They have no other explicit functionality; however, they are used by NumPy and other third-party packages. Slice objects are also generated when extended indexing syntax is used. For example: `a[start:stop:step]` or `a[start:stop, i]`. See [`itertools.islice()`](https://docs.python.org/3/library/itertools.html#itertools.islice "itertools.islice") for an alternate version that returns an iterator.
amber epoch
#

!e py alpha = "abc" beta = "def" for a, b in zip(alpha, beta): print(a + b)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | ad
002 | be
003 | cf
amber epoch
#

!e py from string import ascii_lowercase as alphabet print(alphabet[1:]) print(alphabet[:-1])

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | bcdefghijklmnopqrstuvwxyz
002 | abcdefghijklmnopqrstuvwxy
amber epoch
#

!e py things = "abc" for i, v in enumerate(things): print(i, v)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | 0 a
002 | 1 b
003 | 2 c
amber epoch
#

!e py things = "abc" for i, v in enumerate(things): print(things[i] + things[i + 1]) #things[i] == v

keen onyxBOT
#

@amber epoch :x: Your eval job has completed with return code 1.

001 | ab
002 | bc
003 | Traceback (most recent call last):
004 |   File "<string>", line 3, in <module>
005 | IndexError: string index out of range
amber epoch
#

!e py things = ["apples", "pears", "grapes", "oranges"] for i, v in enumerate(things): print((things[i], things[i + 1]))

keen onyxBOT
#

@amber epoch :x: Your eval job has completed with return code 1.

001 | ('apples', 'pears')
002 | ('pears', 'grapes')
003 | ('grapes', 'oranges')
004 | Traceback (most recent call last):
005 |   File "<string>", line 3, in <module>
006 | IndexError: list index out of range
wild wasp
#
path = [2, 0, 4, 6]
print(list(enumerate(path)))
#
path = [2, 0, 4, 6]
print(list(enumerate(path)))
#

!e

keen onyxBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

wild wasp
#

!e

path = [2, 0, 4, 6]
print(list(enumerate(path)))
keen onyxBOT
#

@wild wasp :white_check_mark: Your eval job has completed with return code 0.

[(0, 2), (1, 0), (2, 4), (3, 6)]
amber epoch
#

!e py alpha = "abc" beta = "de" a = len(alpha) b = len(beta) for i in range(10): print(i, alpha[i % a], beta[i % b])

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | 0 a d
002 | 1 b e
003 | 2 c d
004 | 3 a e
005 | 4 b d
006 | 5 c e
007 | 6 a d
008 | 7 b e
009 | 8 c d
010 | 9 a e
amber epoch
#

!e py intersection = [(1, 2), (3, 4), (5, 6)] for time_index in range(10): print(time_index, intersection[time_index % len(intersection)])

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | 0 (1, 2)
002 | 1 (3, 4)
003 | 2 (5, 6)
004 | 3 (1, 2)
005 | 4 (3, 4)
006 | 5 (5, 6)
007 | 6 (1, 2)
008 | 7 (3, 4)
009 | 8 (5, 6)
010 | 9 (1, 2)
amber epoch
#

!e py path = 1, 0, 2 for i, _ in enumerate(path): print(i, (path[i], path[i + 1]))

keen onyxBOT
#

@amber epoch :x: Your eval job has completed with return code 1.

001 | 0 (1, 0)
002 | 1 (0, 2)
003 | Traceback (most recent call last):
004 |   File "<string>", line 3, in <module>
005 | IndexError: tuple index out of range
amber epoch
#

!e py for i in range(10): print(i % 3)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | 0
002 | 1
003 | 2
004 | 0
005 | 1
006 | 2
007 | 0
008 | 1
009 | 2
010 | 0
amber epoch
#

!e py things = "apples", "pears", "oranges" print(len(things))

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

3
amber epoch
#

!e py things = "apples", "pears", "oranges" for i in range(10): print(things[i % 3])

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | apples
002 | pears
003 | oranges
004 | apples
005 | pears
006 | oranges
007 | apples
008 | pears
009 | oranges
010 | apples
amber epoch
#

!e py text = "abc" print(text[0]) print(text[1]) print(text[2]) print(text[3])

keen onyxBOT
#

@amber epoch :x: Your eval job has completed with return code 1.

001 | a
002 | b
003 | c
004 | Traceback (most recent call last):
005 |   File "<string>", line 5, in <module>
006 | IndexError: string index out of range
amber epoch
#

!e py text = "abc" print(text[0 % 3]) print(text[1 % 3]) print(text[2 % 3]) print(text[3 % 3])

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | a
002 | b
003 | c
004 | a
amber epoch
#

!e py print(0 % 3) print(1 % 3) print(2 % 3) print(3 % 3)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | 0
002 | 1
003 | 2
004 | 0
amber epoch
#

!e py things = ["apples", "oranges", "pears"] print(things[0 % 3]) print(things[1 % 3]) print(things[2 % 3]) print(things[3 % 3]) print(things[4 % 3])

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | apples
002 | oranges
003 | pears
004 | apples
005 | oranges
amber epoch
#

!e py things = [[(1, 2), (3, 4)], [(5, 6), (7, 8)], [(9,10), (11,12)]] m = len(things) print(things[0 % m]) print(things[1 % m]) print(things[2 % m]) print(things[3 % m]) print(things[4 % m]) print(things[5 % m])

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | [(1, 2), (3, 4)]
002 | [(5, 6), (7, 8)]
003 | [(9, 10), (11, 12)]
004 | [(1, 2), (3, 4)]
005 | [(5, 6), (7, 8)]
006 | [(9, 10), (11, 12)]
amber epoch
#

!e py things = [[(1, 2), (3, 4)], [(5, 6), (7, 8)], [(9,10), (11,12)]] m = len(things) print(0 % m) print(1 % m) print(2 % m) print(3 % m) print(4 % m) print(5 % m)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | 0
002 | 1
003 | 2
004 | 0
005 | 1
006 | 2
amber epoch
#

!e py text = "abcdefg" for a, b in zip(text[:-1], text[1:]): print(a, b)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | a b
002 | b c
003 | c d
004 | d e
005 | e f
006 | f g
deep phoenix
#

!e

import this
keen onyxBOT
#

@deep phoenix :white_check_mark: Your eval job has completed with return code 0.

001 | The Zen of Python, by Tim Peters
002 | 
003 | Beautiful is better than ugly.
004 | Explicit is better than implicit.
005 | Simple is better than complex.
006 | Complex is better than complicated.
007 | Flat is better than nested.
008 | Sparse is better than dense.
009 | Readability counts.
010 | Special cases aren't special enough to break the rules.
011 | Although practicality beats purity.
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/wetikuraja.txt?noredirect

amber epoch
main solar
#

oh

normal kiln
#

hello

#

i need some help

#

i have vscode

#

me whants create a app

#

my name is shahryar

#

im in iran

main solar
#

i got a object has no attribute error

#

does anybody have 5 min for me pls D:

neat dew
#

if so use kotlin

#

and umm use headfirst into kotlin

#

for the book

hollow scroll
#

Yello

amber epoch
#

!e py text = "apple" text = text + "s" print(text)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

apples
hollow scroll
#

!e

test = "apple"
test += "s"
print(test)```
keen onyxBOT
#

@hollow scroll :white_check_mark: Your eval job has completed with return code 0.

apples
rugged wigeon
#

test = 'i'

#

test+= I

hollow scroll
#

To change letters imagine a word as an array
like imagine the world
Hello it'll be an array
01234
so like

a="Hello"
a[0] # H
a[1] # e
a[2] # l
a[3] # l
a[4] # o```
Idk why I threw this here
#

@rugged wigeon take a note from me, a software engineer, I barely put comments

#

I put comments when I really need 'em

#

otherwise I just don't

amber epoch
#

!e ```py
class MyClass:
def iadd(self, v):
return 9001

mc = MyClass()
print(mc)
mc += "blah"
print(mc)```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | <__main__.MyClass object at 0x7fa420d5dc60>
002 | 9001
amber epoch
#

!e ```py
class MyClass:
def add(self, v):
return 9001

mc = MyClass()
print(mc + 1)```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

9001
hollow scroll
#

Help! There's a jackception

amber epoch
#

!zen

keen onyxBOT
#
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

amber epoch
#

!pep8

keen onyxBOT
#

PEP 8 is the official style guide for Python. It includes comprehensive guidelines for code formatting, variable naming, and making your code easy to read. Professional Python developers are usually required to follow the guidelines, and will often use code-linters like flake8 to verify that the code they're writing complies with the style guide.

More information:
PEP 8 document
Our PEP 8 song! :notes:

amber epoch
#
def func():
    """This is a docstring.
       Blah blah blah.
       Usage: ...
       ...
       ...
    """
    ... ```
rugged wigeon
#

#input

#

Variable = ''

keen onyxBOT
rose falcon
#

@normal kiln

normal kiln
#

iam in iran

carmine cape
rose falcon
#

@amber epoch

amber epoch
#

?

rose falcon
#

with this code

amber epoch
#

I'm not making myself available right at the moment. I would suggest that you use the help channel system. #❓|how-to-get-help

carmine cape
#

@rose falcon


if (letter in used_latters):
    #do nothing
else:
    '_' for letter in word```
#

are you getting now ?

#

that line

rose falcon
carmine cape
#

gtg bye guys...

normal kiln
#

i need help

night cedar
#

Anyone able to help me?

rustic quiver
#

yes

dapper mirage
#

@night cedarwhat do you need help with? please ask the question you have, and add lots of informative details

main solar
green aspen
#

!paste

wild wasp
#
def sum(numbers):
    if numbers == []:
        return 0
    first_number = numbers[0]
    sum_remaining_numbers = sum(numbers[1:])
    return first_number + sum_remaining_numbers

print(sum([1, 2, 3, 4]))
#
def sum(numbers):
    # The base case.
    # The sum of an empty list is 0.
    if numbers == []:
        return 0

    # The recursive case.
    # The sum of the list is the current number plus the
    # sum of the remainder of the list.
    first_number = numbers[0]
    sum_remaining_numbers = sum(numbers[1:])
    return first_number + sum_remaining_numbers

print(sum([1, 2, 3, 4]))
#
def pysum(numbers):
    # The base case.
    # The sum of an empty list is 0.
    if numbers == []:
        return 0

    # The recursive case.
    # The sum of the list is the current number plus the
    # sum of the remainder of the list.
    first_number = numbers[0]
    sum_remaining_numbers = pysum(numbers[1:])
    return first_number + sum_remaining_numbers

print(sum([1, 2, 3, 4]))
amber epoch
#
f(1, 2, 3, 4)
1 + f(2, 3, 4)
2 + f(3, 4)
3 + f(4)
4 + f()```
valid pagoda
#

init.py

#

init

#

init

#

_ _ init _ _

celest topaz
#

pip install dict_and_html

robust sun
#

new here would someone be able to assist me?

stark galleon
#

yes

flat atlas
#

!e
print("hello)

keen onyxBOT
#

@flat atlas :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print("hello)
003 |           ^
004 | SyntaxError: unterminated string literal (detected at line 1)
flat atlas
#

!e

keen onyxBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

flat atlas
#

!e
def sum(*args): k = 0 for i in args: k += i return k

keen onyxBOT
#

@flat atlas :warning: Your eval job has completed with return code 0.

[No output]
#

@flat atlas :white_check_mark: Your eval job has completed with return code 0.

MIA KHALIFA
compact mason
#

!e

keen onyxBOT
#
Missing required argument

code

compact mason
#

!e
print('Hello world')

ancient obsidian
#

what is this

onyx plinth
#

looks like an IndentationError

onyx plinth
#

wow that was fast

#

Tell Hemlock I say hi

south rune
#

hello.

#

I am not able to chat

golden hound
#

hey

#

I needed help with this data set I have and I want to perform sentiment data analysis

#

can someone guide me thought

#

is anyone a data analyst here?

royal plume
#

what kind of data

#

btw anyone know any coding for fourier transform

#

im attempting to do fourier analysis of musical instruments

#

but dont know any good websites/apps that do the fourier transform for me visualised

karmic shell
faint hinge
#

!stream 670580567955472384

keen onyxBOT
#

✅ @karmic shell can now stream until <t:1654714646:f>.

faint hinge
#

!stream 670580567955472384 30m

keen onyxBOT
#

✅ @karmic shell can now stream until <t:1733686760:f>.

faint hinge
#

!revokestream 670580567955472384

keen onyxBOT
#

✅ Revoked the permission to stream from @karmic shell.

#

@karmic shell's stream has been suspended!

faint hinge
#

!stream 670580567955472384 30M

keen onyxBOT
#

✅ @karmic shell can now stream until <t:1654718995:f>.

sly merlin
#

@karmic shell sudo apt-get install libcanberra-gtk-module

hot quiver
#

Has code help always been limited in the # of people it can hold?

sly merlin
keen onyxBOT
burnt stirrup
#

How do i get the immdeiate sub dir names from remote machines using paramkio?

cosmic skiff
#

how do i make a text animation?

#

like

#

loading.

#

loading..

#

loading...

#

in python

main solar
#

invalid syntax help me guys im try cd and file

karmic comet
frank halo
#

I wrote a code to get the instant price of bitcoin from mexc but it gives the same result every time

haughty spindle
#

Can someone please help me with python files

main solar
#

Hello, can you please help me with something. I wrote a bot for auto moderation, set everything up completely, but I get an "invalid syntax" error, what should I do? Help me please. I'ts python

fickle basin
#

simping for secret codes

gleaming cypress
#

@main solar you should use if WARN[i]:

#

you forgot the colon

main solar
#

That is, you want to tell me 1 person told me how to fix 1 error, you need to write ":" there, but you don’t say that it’s not necessary so that it then crawls out again and that I add it again and then I get the error that I have now.

main solar
#

whats the best text editor for python

deep glen
#

for what purpose? web development, data sciense or just programming?

deep glen
#

vs code

main solar
sullen quest
#

I need help with discord bot

lofty geode
#

hi people of discord, would anyone know how to recommend libraries (about ten) aimed at hacking and exploits?

main solar
lofty geode
#

I know

mellow mango
#

@faint hinge can u help me with voice verification ?? please..

faint hinge
#

@mellow mango What's going on with it?

#

You don't meet the message requirement just yet

mellow mango
faint hinge
#

!stream 313415567354757121

keen onyxBOT
#

✅ @dawn siren can now stream until <t:1655398175:f>.

chrome gust
#

@rotund ingot I'm here

rotund ingot
#

Or goto voice-chat-1

#

sorry in live coding

worthy badger
shadow kelp
#

module 'cv2' has no attribute 'gapi_wip_gst_GStreamerPipeline'
i am getting this error while training my custom TFOD
what should i do, please help

onyx lynx
#

hi wanted some help with my code

topaz wharf
#

guys i have simple problem

    {"id": 1, "item": 2},
    {"id": 2, "item": 4},
    {"id": 1, "item": 5},
    {"id": 2, "item": 6},
    {"id": 1, "item": 7},
    {"id": 3, "item": 8},
]

# Output =
#  [
#   {"id":3, "item": 8},
#   {"id":2, "item": 6},
#   {"id":1, "item": 7}
# ```
odd silo
#

I need some help changing the font of my vscode editor

#

idk how

#

nvm wrong chat

devout crystal
main solar
#

can someone say how to run two event loops? I need to run tkinters rootloop and telethon`s eventloop

frosty wedge
#

@main solar SIMPLE

main solar
#

Ok

lusty prairie
#

sorry I don't have speak permissions yet

cinder spoke
#

@rugged wigeon would be cool to be able to use certain items to prevent a loss. like for example if you find bug spray in the room, and use it for centipede.

vague rune
#

@rugged wigeon

faint hinge
#

!stream 190136412748644352

keen onyxBOT
#

✅ @restive dew can now stream until <t:1655932063:f>.

distant musk
#
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/dist-packages/undetected_chromedriver/dprocess.py", line 59, in _start_detached
    p = Popen([executable, *args], stdin=PIPE, stdout=PIPE, stderr=PIPE, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/sentry_sdk/integrations/stdlib.py", line 190, in sentry_patched_popen_init
    rv = old_popen_init(self, *a, **kw)  # type: ignore
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1585, in _execute_child
    and os.path.dirname(executable)
  File "/usr/lib/python3.8/posixpath.py", line 152, in dirname
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
distant musk
#

It works fine in a standalone script, but fails in container.

distant musk
sweet glen
#

COPY . ./

topaz wharf
#

guys is there any way to figure out what changes are done in col and rows in csv file that is available on s3 bucket using python

main solar
#

!e
list2 = [["a","b"]]
print(list2[0])

keen onyxBOT
#

@main solar :white_check_mark: Your eval job has completed with return code 0.

['a', 'b']
main solar
#

how can ı take just 'a'

#

@amber epoch can you help me ?

amber epoch
#

!e py v = ["a", "b"] print(v[0])

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

a
amber epoch
#

So

main solar
#

thank yoou

amber epoch
#

!e py v = [["a", "b"]] print(v[0]) print(v[0][0])

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | ['a', 'b']
002 | a
amber epoch
#

You can stack subscriptions.

main solar
#

okay thank you so much

#

thats help 🙂

still jolt
#

Hello friends, I have been working on a cryptographic program for the last year. After many iterations I have concluded to a final program ,but there is a problem. The program is very slow (It would take my laptop 3 months running 24-7 to finish) but there is little to no optimization I can do to the code rather than changing the algorithm. The only solution I could think about is distributing the workload to other computers but I don't know where to find such source of cheap computing power. If you can help me with the problem I face ,please contact me : )

tepid vale
#

hello can anyone help me with some theoretical questions regarding upgrading django from version 1.1 to the latest lts release

solar drum
#

I am listening and watching, but what you guys are saying is over my head. Hey I can learn something though.

#

For some reason that I don't have permissions to speak in the channel.

lyric arch
#

Hello everyone. I have been learning how to code in python from an online platform. I have an assignment which deals with text based files and string manipulation. I have been stuck with this assignment for 2 days, if anyone can help me out it would mean a lot. Please contact me if willing to help 😄

simple panther
#

👍

unique dew
#

Can someone tell me how you call the % sigh in line 12?
i understand its purpose - to call the i in the 5 iteral

wicked stirrup
#

is there a way where we can adjust the font size of the values on x and y axis in seaborn?

gilded goblet
humble zephyr
#

is @amber epoch a bot ?

amber epoch
molten yoke
#

wtf hahahaha

tepid vale
#

Anyone available for some help with django forms?

hoary patio
#

test

woven dew
#

hi

vague prism
rose falcon
#

@finite grove

#

how are you

kind carbon
#

hello

#

go to help channel and mention me there

#

@rose falcon

#

microphone not working lol

atomic flame
#

hello

supple plank
#

hi

kind carbon
#

Hello

agile ibex
#

is this the 'correct' place to discuss SAPI 5.4 & Python?

supple plank
#

who could help me with my firts python project?

#

becouse i am new at coding

supple plank
#

hi

main solar
fallow quiver
#

can someone please help me look over some code

supple plank
#

It is almost done but i have i error and i cant fix it

uncut hollow
#

anyone know how to fix connection reset errors?

burnt gull
#

hi i need help

#

any ideas why its not working?

inland elk
#

can you run it a show what's happening?

burnt gull
#

yes

#

look

tired socket
#

are you sure the website returns JSON on authentication?

slim arrow
#

hi guys, python process started to consume >100% CPU usage executing simple code. i'm using vscode. any idea?
i'm using an intel mac book pro. the laptop doesn't freeze but i can't debug.

faint hinge
#

What's the code?

#

@slim arrow Hard to know without knowing what the code is

#

Or I wonder.... I wonder if this is one of those odd situations where your total percentage is 100% per core, so it adds up to something odd

slim arrow
#

thanks @faint hinge , re.findall is the problem. i tried with re.search but the problem remains. i'm iterating a document, seems like i need to refactor the code to execute the pattern matching just once time in the whole text.

slim arrow
#

update: the problem was the regular expression.

short dagger
#

hi

#

maroloccio

mortal drift
#

Hi Terro

short dagger
#

hi thanh

#

yeah we can hear you bro

mortal drift
#

Yup. I just joined 3 day ago. So i don't have permission :d

short dagger
#

same here

mortal drift
#

Are you backend developer?

copper ridge
#

hi everyone I'm new in python, I am trying to use user input to confirm if it is available in the dictionary, when I use string as a key it works fine but when I use number error comes why is that

#

the assignment is to create Telephone directory so I used number as key because telephone numbers should not be duplicated but names can be

stone breach
tranquil thicket
#

I need some help with starting with dictionaries

#

I'm trying to make connect 4 using dictionaries in python

#

to work the exact same way

honest vector
#

Look for Thai people in this discord.

solar charm
#

Hey

rose falcon
#
import pygame
from settings_of_learning import Settings_of_rain
def rungame():
    pygame.init()
    settings = Settings_of_rain
    screen = pygame.display.set_mode((800,800))
    pygame.display.set_caption('rain')
    icon = pygame.image.load('drop.png')
    pygame.display.set_icon(icon)
    run = True
    while run:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                run=False

            screen.fill(settings.__init__().bg_color)
rungame()
#
class Settings_of_rain:
    """A class to store all settings for the game."""

    def __init__(self):
        """Initialize the game's settings."""
        # Screen settings
        self.screen_width = 600
        self.screen_height = 400
        self.bg_color = (0, 0, 0)
        # ship
        self.velocity = 1
        # Bullet settings
        self.bullet_width = 3
        self.bullet_height = 10
        self.bullet_speed_factor = 2
        self.bullet_color = (110, 110, 110)
        self.bullets_allowed = 5
restive prism
#

I know the issue I think

#

@rose falcon

#

output:

#

I dont know what your issue is

#

as this is working for me

rose falcon
#

yes that make curious as well

#

i really dont know

restive prism
#

it works for me

rose falcon
#

it was just a stupid mistake all i needed to put () at line where I created instance of setting class

onyx grove
#

heyho

#

someone got a bit of time?

stark lynx
#

what's up @onyx grove ?

frail badge
#

Hello

lunar meadow
#

guys can someone help me and teach me how to make a code becouse i don't know how 😭

dim owl
#

!code

keen onyxBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

covert harbor
#

I'm new to using git and I'm having a bit of trouble pushing things, need some assistance patricioPraying

#

wait i cant stream

covert harbor
#

nevermind, i got it thumbs_up

boreal walrus
#

AI is pretty cool tbh, i kinda wanna learn a bunch

#

sorry, forgot i was in a channel, maybe when i can speak ill join one and yall can yell at me for not understanding what im looking at, im still learning 😂

lapis fiber
ancient python
#

Someone please help. I'm in the middle of trying to slice strings in between two exclamation points and drag out the substring in between. This is the slicing code I have: slicing = Text_String("!") It keep reading it as an error TypeError: 'str' object is not callable It worked with [:] why isn't it reading it and what can I do to fix it?

half sentinel
#

if you're trying to define a variable called slicing as a string '!' then you'd need something like slicing = str('!')

ancient python
# half sentinel Without seeing the rest of your code, one problem I can see is that you're using...

Thank you for answering my question. ^^ So... everything seems to be working except when I test it out, the second half of the string I'm trying to pull the substring out of in between the two '!' won't get cut out... so this is what I have: value = Text_String.split("!") exclamation_character = Text_String.find("!") slicing = str('!') substring = Text_String[exclamation_character:] Final_Answer = substring.replace("!", ("")) I can't find the error... I know I do, but I don't know why it's not cutting out the sentence after the second !

ancient python
#

Oh! Nvm! I did it. Ty anyway! ^^

#

I fixed it with a start and end .index ...

half sentinel
ancient python
keen onyxBOT
#

:incoming_envelope: :ok_hand: applied mute to @main solar until <t:1658191307:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).

brave bough
#

could somoene hop into voice and help me out with requests

chilly wasp
#

u wanna comments?

#

is for python

brave bough
#

need some help with doing something with requests

#

in code hep

#

lp

unkempt sky
#

xxx for i in range(6)

would i add xxx as above?

#

or need to
[xxx for i in range(6)]

any example, share with me 😦

chilly wasp
#

wait i dont think u can put any syntax before for statement

unkempt sky
#

@chilly wasp

chilly wasp
#

oh

unkempt sky
#

need help 😦 for explain