#code-help-voice-text
5 messages · Page 8 of 1
how do i import ascii
!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)
@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
!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)
@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
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)
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)
BSTInsert
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?
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.
!e
code
!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!*
!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')
@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 ':'
Wtf
!e
def escreval(txt)
tam = len(txt)+4
print('-'tam)
print(f'" {txt} ")
print('-'tam)
escreval ('Hello guys')
@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 ':'
!e print ('hello')
@flat condor :white_check_mark: Your eval job has completed with return code 0.
hello
How to turn list = [ -1 , 2 , -3] into positive
leaving positive positive
all including postivie value into positive
!voiceverify
!e
code
!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!*
!e
code
!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!*
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,"!")
@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
!e print("school biodata")
nama = input("input your name")
kelas = input("input your class")
print("thank you to fill this document",nama,"kelas",kelas,"!")
@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
hi everyone is it possible to code location trucker with pycharm have a great day 🙂
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
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
-
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. -
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! -
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. -
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. -
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. -
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.
@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")
!ytdl
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)
!e print("test")
@compact charm :white_check_mark: Your eval job has completed with return code 0.
test
pls help there is no color and there is (32m when i run in cmd
Is anyone
faced a problem of a lack of
proxies
i mean, free proxies
it's not that confident, although i need few ones
Does anyone know firewall log parsing here ?!
Hi any flask dev here?
@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
Guys
code
!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!*
!e
code
!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!*
!e 34
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
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
i think so, yes, whats the error ?
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
did you try printing arrays before and after loop
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
yes
then what's is the error actually ?
do you know if there's a way I could share my screen?
ah, crap
they can give you perms
I cant really explain the issue without showing you the code
!paste
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.
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
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
anyone familiar in PyQT or Tkinter?
if you have worked with it a lil, you might be able to help me
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
!voice
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
is there anyone who can help me out in machine leaning project
???
hey is there anyone
????
!voice
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
anyone around to help out with understanding classes and using lists
eggs, bacon, spam = 'What is going on, Marty?'.partition(',')
what is bacon after the following lines are executed?
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
I don't get
I AM İDİOT
asdşlkfjsdşf
nooooooo
ı am not put the equal
look it that padx
asdfadfs
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
Thank you Charlie S
im trying to figure out some python best practices
i wonder how close I am to the minimum for voice verification
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.
hi, wanted to ask if someone here has knowledge about Arduino with c in visual studio
@main solar and @buoyant seal
hello
👋
hii mr.hemlock !
they just wanna learn html and move to python
yep yep~!@faint hinge
ofc how couldn't i~?
yea it does
what's console log for again~?
console.log = print in python
ohh thank u hlemlock !
damn i forgot to comment in html
what's coment ?
comments are code that dont run
then why do we need them~?
or just like desccription of wtf ya doign in that code
oh like meta ?
like whats your point of adding that code
meta charset or meta name thingies ?
i never bothered with meta stuff idk bout that
hmm??
hmm ?
Sorry, just came back from taking care of something in the office. What's up?
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
hello
hi guy's i rally need help, can Samoan help me pls
if u can help me text me on privet
pls
good
anyone good with github workflows and is free to join #751592231726481530?
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
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
python will definitely give you a smoother intro. but IMO learning multiple is ideal. it depends what you want to do
good idea thanks
!voice @hidden birch
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Pls respond here @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
[[item11, item12], [item21, item22]]
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
func_t.append([func_x])
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
[[['0 - data1'], ['0 - data2']], [['1 - data1'], ['1 - data2']], [['2 - data0', '2 - data1']], [['3 - data0', '3 - data1']], [['4 - data0', '4 - data1']]]
!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))
@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']]]
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
Hmm, you probably need to adjust your accessors also
Oh, hold up
Np.subtract returns an array?
it should yes
it subtract arrays elementwise
Hey @hidden birch!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
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
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
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 = (mom2)/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
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]))))
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
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.
ok thank you for your time
No problem
I may try more later but I'm a bit tired of looking at it currently
Lol
i understand hahah
I'll DM you if I get it.
great thanks
could somebody help me with this problem i have? I'm stumped
Can someone teach me how to make a screenshot function using python? I needed that part in my project
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.
Here is better
still cant talk
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?
@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
ok, back, and I see you first asked 2 hrs ago... in any case, respond if you want
Découvrez cette application gratuite. Elle vous rémunère pour vos pas 🚶 https://sweatco.in/i/boomgamer58183295412
!e py import ast text = "{'apples': 7, 'pears': 6}" the_dict = ast.literal_eval(text) print(the_dict) print(type(the_dict))
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | {'apples': 7, 'pears': 6}
002 | <class 'dict'>
@wild wasp
!e py the_dict = {"apples": 7, "pears": 6} additional_dict = {"grapes": 30} the_dict.update(additional_dict) print(the_dict)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
{'apples': 7, 'pears': 6, 'grapes': 30}
!e py things = ["apples", "pears", "oranges"] additional_list = ["grapes", "guavas", "peaches"] for each in additional_list: things.append(each) print(things)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
['apples', 'pears', 'oranges', 'grapes', 'guavas', 'peaches']
!e py things = ["apples", "pears", "oranges"] additional_list = ["grapes", "guavas", "peaches"] things.extend(additional_list) print(things)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
['apples', 'pears', 'oranges', 'grapes', 'guavas', 'peaches']
!e py import ast things = [] text = "(1,2)" the_tuple = ast.literal_eval(text) things.append(the_tuple) print(things)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
[(1, 2)]
!e py d = {"apples": 5} print(d["apples"]) print(d["pears"])
@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'
Thank you 🙂
code
!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!*
!e ```py
class MyClass:
pass
mc = MyClass()
print(type(mc))
print(type(MyClass))```
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | <class '__main__.MyClass'>
002 | <class 'type'>
!e ```py
class MyClass:
def method(self):
print(self)
mc = MyClass()
mc.method()
print(mc)```
@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>
!e ```py
class MyClass:
def method(self):
print(self)
a = MyClass()
b = MyClass()
a.method()
b.method()```
@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>
!e ```py
class MyClass:
def init(self):
print("Hello!")
MyClass()```
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
Hello!
!e ```py
class MyClass:
def init(self, v):
self.v = v
mc = MyClass(5)
print(mc.v)```
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
5
!e
class Monster:
def __init__(self, monstertype):
self.monstertype = monstertype
v = Monster('vampire')
print(v.monstertype)
z = Monster('Zombie')
print(z.monstertype)
@restive dew :white_check_mark: Your eval job has completed with return code 0.
001 | vampire
002 | Zombie
!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)```
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | Peter
002 | Jane
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.
person_three = Person("Mike")
!e ```py
class MyClass:
def init(self):
self.v = 5
def method(self):
return self.v
mc = MyClass()
print(mc.method())```
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
5
🤷♂️
He's teaching him how to use classes for his project
we don't know his project opal does
metasploit
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
hey?
Lofi Girl
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
this is the shit server i was talking about
https://discord.gg/djs
asking for payment as verificatoin
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 :white_check_mark: Your eval job has completed with return code 0.
ab
!d slice
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.
!e py alpha = "abc" beta = "def" for a, b in zip(alpha, beta): print(a + b)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | ad
002 | be
003 | cf
!e py from string import ascii_lowercase as alphabet print(alphabet[1:]) print(alphabet[:-1])
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | bcdefghijklmnopqrstuvwxyz
002 | abcdefghijklmnopqrstuvwxy
!e py things = "abc" for i, v in enumerate(things): print(i, v)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | 0 a
002 | 1 b
003 | 2 c
!e py things = "abc" for i, v in enumerate(things): print(things[i] + things[i + 1]) #things[i] == v
@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
!e py things = ["apples", "pears", "grapes", "oranges"] for i, v in enumerate(things): print((things[i], things[i + 1]))
@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
path = [2, 0, 4, 6]
print(list(enumerate(path)))
path = [2, 0, 4, 6]
print(list(enumerate(path)))
!e
code
!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!*
!e
path = [2, 0, 4, 6]
print(list(enumerate(path)))
@wild wasp :white_check_mark: Your eval job has completed with return code 0.
[(0, 2), (1, 0), (2, 4), (3, 6)]
!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])
@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
!e py intersection = [(1, 2), (3, 4), (5, 6)] for time_index in range(10): print(time_index, intersection[time_index % len(intersection)])
@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)
!e py path = 1, 0, 2 for i, _ in enumerate(path): print(i, (path[i], path[i + 1]))
@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
!e py for i in range(10): print(i % 3)
@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
!e py things = "apples", "pears", "oranges" print(len(things))
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
3
!e py things = "apples", "pears", "oranges" for i in range(10): print(things[i % 3])
@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
!e py text = "abc" print(text[0]) print(text[1]) print(text[2]) print(text[3])
@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
!e py text = "abc" print(text[0 % 3]) print(text[1 % 3]) print(text[2 % 3]) print(text[3 % 3])
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | a
002 | b
003 | c
004 | a
!e py print(0 % 3) print(1 % 3) print(2 % 3) print(3 % 3)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 0
!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])
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | apples
002 | oranges
003 | pears
004 | apples
005 | oranges
!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])
@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)]
!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)
@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
!e py text = "abcdefg" for a, b in zip(text[:-1], text[1:]): print(a, b)
@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
!e
import this
@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
why
Illustration.
oh
hello
i need some help
i have vscode
me whants create a app
my name is shahryar
im in iran
app as in phone app
if so use kotlin
and umm use headfirst into kotlin
for the book
Yello
!e py text = "apple" text = text + "s" print(text)
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
apples
!e
test = "apple"
test += "s"
print(test)```
@hollow scroll :white_check_mark: Your eval job has completed with return code 0.
apples
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
!e ```py
class MyClass:
def iadd(self, v):
return 9001
mc = MyClass()
print(mc)
mc += "blah"
print(mc)```
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | <__main__.MyClass object at 0x7fa420d5dc60>
002 | 9001
!e ```py
class MyClass:
def add(self, v):
return 9001
mc = MyClass()
print(mc + 1)```
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
9001
Help! There's a jackception
!zen
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!
!pep8
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:
def func():
"""This is a docstring.
Blah blah blah.
Usage: ...
...
...
"""
... ```
Hey @rose falcon!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
iam in iran
i see
@amber epoch
?
please help me
with this code
I'm not making myself available right at the moment. I would suggest that you use the help channel system. #❓|how-to-get-help
@rose falcon
if (letter in used_latters):
#do nothing
else:
'_' for letter in word```
are you getting now ?
that line
gtg bye guys...
i need help
Anyone able to help me?
yes
@night cedarwhat do you need help with? please ask the question you have, and add lots of informative details
!paste
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]))
f(1, 2, 3, 4)
1 + f(2, 3, 4)
2 + f(3, 4)
3 + f(4)
4 + f()```
pip install dict_and_html
new here would someone be able to assist me?
yes
!e
print("hello)
@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)
!e
code
!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!*
!e
def sum(*args): k = 0 for i in args: k += i return k
@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
!e
code
!e
print('Hello world')
looks like an IndentationError
Press Return after the colon and then save the file
wow that was fast
Tell Hemlock I say hi
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?
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
!stream 670580567955472384
✅ @karmic shell can now stream until <t:1654714646:f>.
!stream 670580567955472384 30m
✅ @karmic shell can now stream until <t:1733686760:f>.
!revokestream 670580567955472384
✅ Revoked the permission to stream from @karmic shell.
@karmic shell's stream has been suspended!
!stream 670580567955472384 30M
✅ @karmic shell can now stream until <t:1654718995:f>.
@karmic shell sudo apt-get install libcanberra-gtk-module
Has code help always been limited in the # of people it can hold?
Hey @robust rivet!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
How do i get the immdeiate sub dir names from remote machines using paramkio?
how do i make a text animation?
like
loading.
loading..
loading...
in python
invalid syntax help me guys im try cd and file
Get rid of the brackets
I wrote a code to get the instant price of bitcoin from mexc but it gives the same result every time
Can someone please help me with python files
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
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.
whats the best text editor for python
for what purpose? web development, data sciense or just programming?
just programming
vs code
ok
I need help with discord bot
hi people of discord, would anyone know how to recommend libraries (about ten) aimed at hacking and exploits?
i dont think anyone should help you with that
I know
@faint hinge can u help me with voice verification ?? please..
@mellow mango What's going on with it?
You don't meet the message requirement just yet
ok and thanks btw
!stream 313415567354757121
✅ @dawn siren can now stream until <t:1655398175:f>.
@rotund ingot I'm here
if statements, function definitions, and class definitions, all require a colon at the end. What they probably were telling you is that you don't need a semi colon ; after each line in python which is true.
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
hi wanted some help with my code
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}
# ```
try to make diferent IDs
in any case u only have 3 ids. so its correct..
u need to put id 1..6
can someone say how to run two event loops? I need to run tkinters rootloop and telethon`s eventloop
AFTER [i] PUT SEMICOLON
@main solar SIMPLE
Ok
sorry I don't have speak permissions yet
@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.
@rugged wigeon
!stream 190136412748644352
✅ @restive dew can now stream until <t:1655932063:f>.
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
Has anyone encountered this? I need a way to fix it. I'm basically using undetected-chromedriver with selenium in a docker container (django project).
It works fine in a standalone script, but fails in container.
Its (uc.Chrome()) creating child processes, looking a way to restrict it.
COPY . ./
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
!e
list2 = [["a","b"]]
print(list2[0])
@main solar :white_check_mark: Your eval job has completed with return code 0.
['a', 'b']
!e py v = ["a", "b"] print(v[0])
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
a
So
thank yoou
!e py v = [["a", "b"]] print(v[0]) print(v[0][0])
@amber epoch :white_check_mark: Your eval job has completed with return code 0.
001 | ['a', 'b']
002 | a
You can stack subscriptions.
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 : )
hello can anyone help me with some theoretical questions regarding upgrading django from version 1.1 to the latest lts release
pip command will help you
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.
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 😄
👍
Can someone tell me how you call the % sigh in line 12?
i understand its purpose - to call the i in the 5 iteral
is there a way where we can adjust the font size of the values on x and y axis in seaborn?
@unique dew
https://realpython.com/python-modulo-operator/#python-modulo-operator-basics
It's called "modulo"
is @amber epoch a bot ?
Beep beep boop boop.
wtf hahahaha
Anyone available for some help with django forms?
test
hi
What's up
hello
go to help channel and mention me there
@rose falcon
microphone not working lol
hello
hi
Hello
is this the 'correct' place to discuss SAPI 5.4 & Python?
hi
what do you want it to be.
can someone please help me look over some code
Calculator
It is almost done but i have i error and i cant fix it
anyone know how to fix connection reset errors?
can you run it a show what's happening?
are you sure the website returns JSON on authentication?
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.
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
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.
update: the problem was the regular expression.
Hi Terro
Yup. I just joined 3 day ago. So i don't have permission :d
same here
Are you backend developer?
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
@buoyant sable https://www.pythondiscord.com/resources/
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
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
Look for Thai people in this discord.
Hey
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
I know the issue I think
@rose falcon
output:
I dont know what your issue is
as this is working for me
it works for me
hy are you still there
it was just a stupid mistake all i needed to put () at line where I created instance of setting class
what's up @onyx grove ?
Hello
guys can someone help me and teach me how to make a code becouse i don't know how 😭
!code
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.
I'm new to using git and I'm having a bit of trouble pushing things, need some assistance 
wait i cant stream
nevermind, i got it 
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 😂
It seems correct, but I am not too great at classes.
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?
Without seeing the rest of your code, one problem I can see is that you're using () and not [] - if you use () then it thinks you're trying to call a function, which is why it says a string object is not callable (in other words it's a string not a function)
if you're trying to define a variable called slicing as a string '!' then you'd need something like slicing = str('!')
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 !
well done!
Thank you! ^^
: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).
could somoene hop into voice and help me out with requests
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 😦
wait i dont think u can put any syntax before for statement
@chilly wasp
oh
need help 😦 for explain
