#off-topic-lounge-text
1 messages ยท Page 10 of 1
wassup guys
Sup
@hazy anchor ๐
:incoming_envelope: :ok_hand: applied timeout to @craggy hatch until <t:1702550542:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Bruh I didn't do that on purpose I just lagged and sent some duplicate messages to see when I stop lagging..
Guys is it possible to code a trojan horse with python???
I need the answer rn guys
Please guys I need the answer rn
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
leetcode x ChatGPT tonight.
Bing chilling
not even sure if it's cheating or handicapping
Can any one suggest how to solve the problem https://stackoverflow.com/questions/77670604/unable-to-get-progess-of-fcoder-2pdf-conversion-process-running-from-python
you know if it is just capturing output from another program you can just parse the program output
if it does you could append the the output to a buffer and use the parser to pull just the bit you want and print it
though I am not sure how to have the terminal output to a buffer
@fresh arch I have updated my question please check and also look the comments
@unborn sorrel https://gist.github.com/aspizu/cff3a898baa0c052b7382e0da2378ec0
Are you implementing a dynamic array?
@unborn sorrel just do voidPtr[typeSize*i] = value
but you will need to supress a compiler warning/error
@agile portal am i correct?
it is
but you cannot dereference a void pointer i think
without casting it first
oh wait no
you can dereference
but you cannot do pointer arithmetic with it
without casting it first
pointer arithmeitc is used in the arr[idx] operator
Hey any Bash guru over here
This sounds like 3Sum to me. However, your constraints are very small, so you could probably get away with an O(N ^ 3) AKA 3 nested loops where N is the range of numbers ([3, 4, 5, 6, 7]). Also, given your small constraints you could just save all of the possible combinations for future output (EDIT: I just saw that you mentioned this after looking at your post again. My bad.).
For more info:
https://leetcode.com/problems/3sum/
Can you solve this real interview question? 3Sum - Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
Notice that the solution set must not contain duplicate triplets.
Example 1:
Input: nums = [-1,0,1,2,-1,-4]
Output: [[-1,-1,2],[-1,0...
Hey
hey
Hello
!res
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
:(:)
Hello everyone!
I need help, i'm beginner in programming and i have no idea to coding something like this and i was wondering if someone can help me to learn or if someone could give me tips on how they learned from 0
guys can i do with python some web task ?
example, Open a chat (whatsapp web, instagramm etc)
then search inside the text line by line and get if its match what i want out and write to a google docs list
is python the way to go or is js better for that ?z
@ionic coral
Sorry I am very new to this
Hello guys
You can use selenium
isn't there a chat export functionality in those?
there is in telegram, at least
If I knew to make a trojan horse I would have attached it with the advice I would have given it to you.
Morale :- Find YourSelf.
yeah i need 50 messages before i speak it seems, thats fine
is there for instagramm too ?
what are cryptography libraries in python?
!pypi PyNaCl
More!
what do you need a cryptography library for?
if it's for interacting with existing systems, look up what those systems use
!pypi pycryptodome
I haven't used this one;
most of stuff I do is with libsodium (PyNaCl) because how simple it is
Okay tq for the info
hi
qq guys 
๐ซก
Friends, who uses tabnine? Is it a good helper?
:incoming_envelope: :ok_hand: applied timeout to @maiden raven until <t:1704452909:f> (10 minutes) (reason: burst spam - sent 8 messages).
The <@&831776746206265384> have been alerted for review.
does this work without error!?
I haven't got permission to speak yet lol. You got my name right though.
hi , im new in python and i want to know if is something in python like a DLL that a can call from another program in other lenguage
Hey guys! can someone help me with something? it's about tkinter package.
Well.. So I want to create a transparent and topmost window, and click throw a specific Frame that is visible to the window under it, how do I do that?
I have this code
import tkinter as tk
import win32gui
import win32con
def click_through(hwnd):
try:
styles = win32con.WS_EX_LAYERED | win32con.WS_EX_TRANSPARENT
win32gui.SetWindowLong(hwnd, win32con.GWL_EXSTYLE, styles)
win32gui.SetLayeredWindowAttributes(hwnd, 0, 255, win32con.LWA_ALPHA)
except Exception as e:
print(e)
if __name__ == '__main__':
root_x, root_y = 200, 50
root = tk.Tk()
root.config(bg='#001122')
root.attributes('-transparentcolor', '#001122', '-topmost', 1)
root.geometry(f"{root_x}x{root_y}")
test_frame = tk.Frame(root, width=50, height=30, background="#ff0000")
test_frame.place(x=10, y=10)
click_through(test_frame.winfo_id())
root.mainloop()
I successfully clicked throw it, but my question is, can I do that without using win32gui and win32con?
Thank you for your help! I appreciate it.
It looks like this, I want to click throw the red frame.
what is import tkinter as tk
can someone tell me whtas wrong with this
name = input("whats your name?: ")
print("hello " + name)
age = input("how old are you" + str(name) "? ")
print(age)```
it says "(" was not closed
on this line:
age = input("how old are you" + str(name) "? ")```
you are missing a +
But rather than use + I recommend using an f-string
like so:
age = input(f'how old are you {name}?')
idk that im newbie im just learning strings and input rn
yep
i fixed to this
that also works
name = input("whats your name?: ")
print("hello " + name)
age = input("how old are you" + name + "? ")
print(age)```
im watching harvard's video 24 hour full course
Basically when you put an f in front of a string, you are able to format it by e.g. putting variables directly inside the string (enclosed by curly braces)
and brocode 12 hours one
so i wont have to add +'s
Exactly
do i have to do {name} or can i just do just (name) or something
!e
name = 'Joe'
print(f'My name is {name}.')
@boreal tundra :white_check_mark: Your 3.12 eval job has completed with return code 0.
My name is Joe.
thats useful thanks
Oops
will use the {} when i reach it through video
You can always ask here
for now i did it like this
name = input("whats your name?: ")
print("hello " + name)
age = input("how old are you " + name + "? ")
print("so " + age + " years old huh")```
so i wont get confused
That's up to you
i made this
name = input("whats your name?: ")
age = int(input("how old are you " + name + "? "))
age = age + 1
print("hello " + name)
print("so your " + str(age) + "? thats cool")```
how can i use "if" and "then"
@boreal tundra
hey rta
u ehre
anyone
name = input("whats your name?: ")
age = int(input("how old are you " + name + "? "))
age = age + 1
print("hello " + name)
answer = input("so your " + str(age) + "? thats cool: ")
if answer = False
print = age - 1
print("so " + str(print) + "then?")```
idk how to use "if"
theres many stuff wrong with this code ๐
brother you need help
good bro
how do u use "if" ?
answer = input("so your " + str(age) + "? thats cool: ")
if answer = False
print = age - 1
print("so " + str(print) + "then?")
how do i fix this line
if answer = false
!if
This is a statement that is only true if the module (your source code) it appears in is being run directly, as opposed to being imported into another module. When you run your module, the __name__ special variable is automatically set to the string '__main__'. Conversely, when you import that same module into a different one, and run that, __name__ is instead set to the filename of your module minus the .py extension.
Example
# foo.py
print('spam')
if __name__ == '__main__':
print('eggs')
If you run the above module foo.py directly, both 'spam'and 'eggs' will be printed. Now consider this next example:
# bar.py
import foo
If you run this module named bar.py, it will execute the code in foo.py. First it will print 'spam', and then the if statement will fail, because __name__ will now be the string 'foo'.
Why would I do this?
- Your module is a library, but also has a special case where it can be run directly
- Your module is a library and you want to safeguard it against people running it directly (like what
pipdoes) - Your module is the main program, but has unit tests and the testing framework works by importing your module, and you want to avoid having your main code run during the test
if 1 == 1:
print("1 is equal to 1")
oo
= is for variable assigment
== is for comparison
if a == b:
...
elif a == c:
...
else:
...
yes well do
if 4 = 4:
print("4 equals to 4")
is it possible to do like:
if 4*2 == 8:
print("4*2=8")```
if answer == "yes":
...
elif answer == "no";
...
else:
print("...?")
!e
if 4*2 == 8:
print("4*2=8")```
@jaunty robin :white_check_mark: Your 3.12 eval job has completed with return code 0.
4*2=8
oo
Yes that's also possible
You can do alot of things with if
Do you ever find yourself writing something like this?
>>> squares = []
>>> for n in range(5):
... squares.append(n ** 2)
[0, 1, 4, 9, 16]
Using list comprehensions can make this both shorter and more readable. As a list comprehension, the same code would look like this:
>>> [n ** 2 for n in range(5)]
[0, 1, 4, 9, 16]
List comprehensions also get an if clause:
>>> [n ** 2 for n in range(5) if n % 2 == 0]
[0, 4, 16]
For more info, see this pythonforbeginners.com post.
Beginners often iterate over range(len(...)) because they look like Java or C-style loops, but this is almost always a bad practice in Python.
for i in range(len(my_list)):
do_something(my_list[i])
It's much simpler to iterate over the list (or other sequence) directly:
for item in my_list:
do_something(item)
Python has other solutions for cases when the index itself might be needed. To get the element at the same index from two or more lists, use zip. To get both the index and the element at that index, use enumerate.
jayy how much time to join this server
?
!e
answer = input("so your " + str(age) + "? thats cool: ")
if answer = False
print = age - 1
print("so " + str(print) + "then?")```
@jaunty robin :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 2
002 | if answer = False
003 | ^^^^^^^^^^^^^^
004 | SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
!epy answer = input("so your " + str(age) + "? thats cool: ") if answer = False: print = age - 1 print("so " + str(print) + "then?")
@jaunty robin :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 2
002 | if answer = False:
003 | ^^^^^^^^^^^^^^
004 | SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
!e
answer = input("so your " + str(age) + "? thats cool: ")
if answer == False:
print = age - 1
print("so " + str(print) + "then?")```
@jaunty robin :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 3
002 | print = age - 1
003 | ^
004 | IndentationError: expected an indented block after 'if' statement on line 2
!epy answer = input("so your " + str(age) + "? thats cool: ") if answer == False: print("so " + str(print) + "then?")
@jaunty robin :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 3
002 | print("so " + str(print) + "then?")
003 | ^
004 | IndentationError: expected an indented block after 'if' statement on line 2
!e
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
Currently only 3.12 version is supported.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
oops
bro how to start coding in this chat
with keyboard
hi
hi
MAN WHT THIS GUY HAVE THE SAME VOICE OF STEPHEN HAWKING @pine sinew
?????
LOL
I CAN'T BELIVE
HI everyone. Just joining the channel for first time. I'm interested i knowing what you guys think about this page. https://www.gridstatus.io/home
you need a indent when doing if, and answer cant be false
!e ```py
age = input("what is your age?")
alphabet = 'abcdefghijklmnopqrstuvwxyz'
if age in alphabet:
print("ages cant have letters in them.")
elif age > 40:
print("wowzers! your old.")
else:
print("so your age is",age,+"?","very nice!")
@crystal parrot :x: Your 3.12 eval job has completed with return code 1.
:warning: Note: input is not supported by the bot :warning:
001 | what is your age?Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | age = input("what is your age?")
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | EOFError: EOF when reading a line
oh cant put input in the bot
i can also do cool stuff like this
!e ```py
word = 'hello world'
num = 0
for i in word:
print(word[num:])
num+=1
for i in word:
print(word[num:])
num-=1
@crystal parrot :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | hello world
002 | ello world
003 | llo world
004 | lo world
005 | o world
006 | world
007 | world
008 | orld
009 | rld
010 | ld
011 | d
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/4Q3GNNSCG52AB63XQ7ECUPEHZ4
@timid fjord print("hello world")
ะะ
with what do you need help
what in basic python
!e
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
Currently only 3.12 version is supported.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
!e ```python
import os
from typing import Dict, Any
import jwt
import datetime
SECRET_KEY = "secret_key"
def create_access_token(data: Dict[str, Any], expire_delta: datetime.timedelta = None):
"""
Create an access token for the given user data.
Args:
data (Dict[str, Any]): The data to encode in the token, typically user identity.
expire_delta (datetime.timedelta, optional): The amount of time for the token to expire.
Returns:
str: The generated JWT token as a string.
"""
to_encode = data.copy()
if expire_delta:
expire = datetime.datetime.utcnow() + expire_delta
else:
expire = datetime.datetime.utcnow() + datetime.timedelta(hours=24)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm="HS256")
return encoded_jwt
data = {"sub": "pepitero gallero", "putismo": True}
token = create_access_token(data)
print(token)
@torpid prairie :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 3, in <module>
003 | import jwt
004 | ModuleNotFoundError: No module named 'jwt'
@torpid prairie :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | pip install jwt
003 | ^^^^^^^
004 | SyntaxError: invalid syntax
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
Currently only 3.12 version is supported.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
@primal bison :white_check_mark: Your 3.12 eval job has completed with return code 0.
hello
@primal bison :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | import requests
004 | ModuleNotFoundError: No module named 'requests'
@primal bison :x: Your 3.12 eval job has completed with return code 1.
:warning: Note: input is not supported by the bot :warning:
001 | Your Name: Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | name = input('Your Name: ')
004 | ^^^^^^^^^^^^^^^^^^^^
005 | EOFError: EOF when reading a line
@primal bison :white_check_mark: Your 3.12 eval job has completed with return code 0.
<built-in function getlogin>
@primal bison :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | print(str(os.getlogin()))
004 | ^^^^^^^^^^^^^
005 | OSError: [Errno 25] Inappropriate ioctl for device
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
Currently only 3.12 version is supported.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
!eval
import numpy as np
import numpy as np
def sigmoid(x):
return 1/(1+np.exp(-x))
def sigmoid_derivative(x):
return x*(1-x)
np.random.seed(42)
X=np.random.rand(1000,10)
y=np.random.randint(2,size=(1000,1))
split_ratio=0.8
split_index=int(split_ratio*len(X))
X_train,X_test=X[:split_index],X[split_index:]
y_train,y_test=y[:split_index],y[split_index:]
input_size=X_train.shape[1]
hidden_size=64
output_size=1
weights_input_hidden=np.random.randn(input_size,hidden_size)
biases_input_hidden=np.zeros((1,hidden_size))
weights_hidden_output=np.random.randn(hidden_size,output_size)
biases_hidden_output=np.zeros((1,output_size))
learning_rate=0.01
epochs=10
for epoch in range(epochs):
hidden_layer_input=np.dot(X_train,weights_input_hidden)+biases_input_hidden
hidden_layer_output=sigmoid(hidden_layer_input)
output_layer_input=np.dot(hidden_layer_output,weights_hidden_output)+biases_hidden_output
predicted_output=sigmoid(output_layer_input)
loss=np.mean(0.5*(y_train-predicted_output)**2)
output_error=y_train-predicted_output
output_delta=output_error*sigmoid_derivative(predicted_output)
hidden_layer_error=output_delta.dot(weights_hidden_output.T)
hidden_layer_delta=hidden_layer_error*sigmoid_derivative(hidden_layer_output)
weights_hidden_output+=hidden_layer_output.T.dot(output_delta)*learning_rate
biases_hidden_output+=np.sum(output_delta,axis=0,keepdims=True)*learning_rate
weights_input_hidden+=X_train.T.dot(hidden_layer_delta)*learning_rate
biases_input_hidden+=np.sum(hidden_layer_delta, axis=0, keepdims=True) *learning_rate
if epoch%100==0:
print(f'Epoch {epoch}, Loss: {loss}')
hidden_layer_test=sigmoid(np.dot(X_test, weights_input_hidden)+biases_input_hidden)
predicted_output_test=sigmoid(np.dot(hidden_layer_test, weights_hidden_output)+biases_hidden_output)
accuracy=np.mean((predicted_output_test>0.5)==y_test)
print(f'Test Accuracy: {accuracy}')```
@fathom aspen :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | Epoch 0, Loss: 0.140583048688421
002 | Test Accuracy: 0.505
!eval
import numpy as np
import numpy as np
def sigmoid(x):
return 1/(1+np.exp(-x))
def sigmoid_derivative(x):
return x*(1-x)
np.random.seed(42)
X=np.random.rand(1000,10)
y=np.random.randint(2,size=(1000,1))
split_ratio=0.8
split_index=int(split_ratio*len(X))
X_train,X_test=X[:split_index],X[split_index:]
y_train,y_test=y[:split_index],y[split_index:]
input_size=X_train.shape[1]
hidden_size=64
output_size=1
weights_input_hidden=np.random.randn(input_size,hidden_size)
biases_input_hidden=np.zeros((1,hidden_size))
weights_hidden_output=np.random.randn(hidden_size,output_size)
biases_hidden_output=np.zeros((1,output_size))
learning_rate=0.01
epochs=10
for epoch in range(epochs):
hidden_layer_input=np.dot(X_train,weights_input_hidden)+biases_input_hidden
hidden_layer_output=sigmoid(hidden_layer_input)
output_layer_input=np.dot(hidden_layer_output,weights_hidden_output)+biases_hidden_output
predicted_output=sigmoid(output_layer_input)
loss=np.mean(0.5*(y_train-predicted_output)**2)
output_error=y_train-predicted_output
output_delta=output_error*sigmoid_derivative(predicted_output)
hidden_layer_error=output_delta.dot(weights_hidden_output.T)
hidden_layer_delta=hidden_layer_error*sigmoid_derivative(hidden_layer_output)
weights_hidden_output+=hidden_layer_output.T.dot(output_delta)*learning_rate
biases_hidden_output+=np.sum(output_delta,axis=0,keepdims=True)*learning_rate
weights_input_hidden+=X_train.T.dot(hidden_layer_delta)*learning_rate
biases_input_hidden+=np.sum(hidden_layer_delta, axis=0, keepdims=True) *learning_rate
if epoch%100==0:
print(f'Epoch {epoch}, Loss: {loss}')
hidden_layer_test=sigmoid(np.dot(X_test, weights_input_hidden)+biases_input_hidden)
predicted_output_test=sigmoid(np.dot(hidden_layer_test, weights_hidden_output)+biases_hidden_output)
accuracy=np.mean((predicted_output_test>0.5)==y_test)
print(f'Test Accuracy: {accuracy}')```
@fathom aspen :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | Epoch 0, Loss: 0.140583048688421
002 | Test Accuracy: 0.505
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
Currently only 3.12 version is supported.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
Currently only 3.12 version is supported.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
code
code
@arctic crypt why your chat gpt website seems different?
k
Ok
!eval
print("hello world")
@fresh sonnet :white_check_mark: Your 3.12 eval job has completed with return code 0.
hello world
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
Currently only 3.12 version is supported.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
!eval 3.12 print('hi')
@lavish viper :white_check_mark: Your 3.12 eval job has completed with return code 0.
hi
@lavish viper :x: Your 3.12 eval job has completed with return code 1.
:warning: Note: input is not supported by the bot :warning:
001 | Number: Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | ina = int(input("Number: "))
004 | ^^^^^^^^^^^^^^^^^
005 | EOFError: EOF when reading a line
Hi brother
!e
print("HELLO 1'S")
@brisk ermine :white_check_mark: Your 3.12 eval job has completed with return code 0.
HELLO 1'S
@rain grotto You have my attention.
code
!eval [python_version] <code, ...>
Can also use: e
Run Python code and get the results.
This command supports multiple lines of code, including formatted code blocks. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.
The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.
Currently only 3.12 version is supported.
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 world")
@primal bison :white_check_mark: Your 3.12 eval job has completed with return code 0.
hello world
!e print("bye")
@modern pike :white_check_mark: Your 3.12 eval job has completed with return code 0.
bye
!e input()
@modern pike :x: Your 3.12 eval job has completed with return code 1.
:warning: Note: input is not supported by the bot :warning:
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | input()
004 | EOFError: EOF when reading a line
!e import json
@modern pike :warning: Your 3.12 eval job has completed with return code 0.
[No output]
!e print("UU")
!e import pygame
import sys
import random
Initialize Pygame
pygame.init()
Set up display
width, height = 800, 600
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("Escape Game")
Set up colors
white = (255, 255, 255)
black = (0, 0, 0)
red = (255, 0, 0)
Set up player
player_size = 50
player_x = width // 2 - player_size // 2
player_y = height - player_size - 10
player_speed = 5
Set up obstacles
obstacle_size = 50
obstacle_speed = 5
obstacle_frequency = 25
obstacles = []
Set up score
score = 0
font = pygame.font.Font(None,36)
Game loop
clock = pygame.time.Clock()
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
# Move player
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT] and player_x > 0:
player_x -= player_speed
if keys[pygame.K_RIGHT] and player_x < width - player_size:
player_x += player_speed
# Create obstacles
if random.randint(1, obstacle_frequency) == 1:
obstacle_x = random.randint(0, width - obstacle_size)
obstacle_y = -obstacle_size
obstacles.append([obstacle_x, obstacle_y])
for obstacle in obstacles:
obstacle[1] += obstacle_speed
obstacles = [obstacle for obstacle in obstacles if obstacle[1] < height]
for obstacle in obstacles:
if (
player_x < obstacle[0] < player_x + player_size
and player_y < obstacle[1] < player_y + player_size
):
pygame.quit()
sys.exit()
score += 1
screen.fill(black)
pygame.draw.rect(screen, white, [player_x, player_y, player_size, player_size])
for obstacle in obstacles:
pygame.draw.rect(screen, red, [obstacle[0], obstacle[1], obstacle_size, obstacle_size])
clock.tick(60)
!eval 3.12 print("hello every follow me today i speak in only engles")
@lavish viper :white_check_mark: Your 3.12 eval job has completed with return code 0.
hello every follow me today i speak in only engles
!eval 3.12
import sys
sys.exit()
@lavish viper :warning: Your 3.12 eval job has completed with return code 0.
[No output]
!eval 3.11.5
print("hello world!")
@chilly nexus :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | 3.11.5
003 | ^^
004 | SyntaxError: invalid syntax
@chilly nexus :warning: Your 3.12 eval job has completed with return code 0.
[No output]
@chilly nexus :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 2
002 | print(random.randint(1,10)
003 | ^
004 | SyntaxError: '(' was never closed
@chilly nexus :white_check_mark: Your 3.12 eval job has completed with return code 0.
7
!eval
import random as ran
print(ran.randint(1,10))
@chilly nexus :white_check_mark: Your 3.12 eval job has completed with return code 0.
5
!eval
import random as ran
for i in range(0,10):
print(ran.randint(1,10))
@chilly nexus :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 7
002 | 8
003 | 6
004 | 3
005 | 1
006 | 3
007 | 3
008 | 2
009 | 3
010 | 5
wacky wally
!eval
import random as ran
for i in range(0,10):
print(ran.randint(1,10))
@chilly nexus :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 3
002 | 10
003 | 5
004 | 3
005 | 2
006 | 8
007 | 7
008 | 7
009 | 5
010 | 8
!eval pip install discord.py
@chilly nexus :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | pip install discord.py
003 | ^^^^^^^
004 | SyntaxError: invalid syntax
@chilly nexus :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | import discord
004 | ModuleNotFoundError: No module named 'discord'
ok
!eval
import random as ran
for i in range(ran.randint(1,774)*-1,ran.randint(1,774))
@chilly nexus :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 2
002 | for i in range(ran.randint(1,774)*-1,ran.randint(1,774))
003 | ^
004 | SyntaxError: expected ':'
!eval
import random as ran
for i in range(ran.randint(1,774)*-1,ran.randint(1,774)):
print(ran.randint(1,774))
@chilly nexus :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 543
002 | 433
003 | 657
004 | 56
005 | 648
006 | 115
007 | 623
008 | 552
009 | 659
010 | 186
011 | 567
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/OUHC4KAQE5ZGSSS3W7HGUQNUUY
!eval
import random as ran
for i in range(ran.randint(1,774)*-1,ran.randint(1,774)):
print(ran.randint(1,774))
@chilly nexus :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 303
002 | 728
003 | 230
004 | 339
005 | 123
006 | 503
007 | 296
008 | 438
009 | 160
010 | 281
011 | 124
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/27BXSTA3PBEIWPML6Y7RGCTKZQ
!eval
import random as ran
for i in range(ran.randint(1,774)*-1,ran.randint(1,774)):
print(ran.randint(1,774))
@chilly nexus :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 65
002 | 692
003 | 11
004 | 300
005 | 625
006 | 328
007 | 332
008 | 58
009 | 637
010 | 218
011 | 363
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/DMDNOHZOMK3D7A6QK5SPQ7NINA
!eval
import random as ran
for i in range(ran.randint(1,774)*-1,ran.randint(1,774)):
print(ran.randint(1,774))
@chilly nexus :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 528
002 | 666
003 | 354
004 | 421
005 | 447
006 | 767
007 | 441
008 | 70
009 | 680
010 | 500
011 | 345
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/4KAZMW4TMLPUTBH7TTDR4UNK3A
just get less
!eval
import random
for i in range(10)
randa = random.randint(100, 999)
print(randa)
@lavish viper :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 3
002 | for i in range(10)
003 | ^
004 | SyntaxError: expected ':'
!eval
import random
for i in range(10):
randa = random.randint(100, 999)
print(randa)
@lavish viper :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 5
002 | print(randa)
003 | IndentationError: unexpected indent
!eval
import random
for i in range(10):
randa = random.randint(100, 999)
print(randa)
@lavish viper :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 749
002 | 810
003 | 324
004 | 356
005 | 389
006 | 980
007 | 307
008 | 538
009 | 370
010 | 338
!eval
import random
rando = random.randint(10, 50)
for i in range(rando):
randa = random.randint(100, 999)
print(randa)
@lavish viper :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 191
002 | 508
003 | 566
004 | 201
005 | 599
006 | 147
007 | 707
008 | 427
009 | 642
010 | 408
011 | 961
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/HKN32E7ZGAWGUEMWTA2QX3N3G4
examples = [
{
"Question": "You will be given a paragraph, and your job will be to short out all possible disease names"
"Paragraph": """for the treatment of X-linked hypophosphataemia in children and adolescents aged 1 to 17 years with radiographic evidence of bone disease.
In an open-label, randomised, phase III study in patients aged 1 to 12 years with X-linked hypophosphataemia, there was a significantly greater improvement in rickets, assessed by the Radiographic Global Impression of Change global score at week 40, in the burosumab group compared with the conventional therapy group (oral phosphate and vitamin D).
In addition, the company provided further data from extension phases of the main studies and some supportive observational data on the use of burosumab in patients with X-linked hypophosphataemia.
This advice applies only in the context of an approved NHSScotland Patient Access Scheme (PAS) arrangement delivering the cost-effectiveness results upon which the decision was based, or a PAS/ list price that is equivalent or lower.
This advice takes account of the views from a Patient and Clinician Engagement (PACE) meeting."""
"Answer": "hypophosphataemia, X-linked hypophosphataemi, rickets, "
}
examples = [
{
"Question": "You will be given a paragraph, and your job will be to short out all possible disease names"
"Paragraph": """for the treatment of X-linked hypophosphataemia in children and adolescents aged 1 to 17 years with radiographic evidence of bone disease.
In an open-label, randomised, phase III study in patients aged 1 to 12 years with X-linked hypophosphataemia, there was a significantly greater improvement in rickets, assessed by the Radiographic Global Impression of Change global score at week 40, in the burosumab group compared with the conventional therapy group (oral phosphate and vitamin D).
In addition, the company provided further data from extension phases of the main studies and some supportive observational data on the use of burosumab in patients with X-linked hypophosphataemia.
This advice applies only in the context of an approved NHSScotland Patient Access Scheme (PAS) arrangement delivering the cost-effectiveness results upon which the decision was based, or a PAS/ list price that is equivalent or lower.
This advice takes account of the views from a Patient and Clinician Engagement (PACE) meeting."""
"Answer": "hypophosphataemia, X-linked hypophosphataemi, rickets, "
}
print(examples)
YOOo this new update does notifications way differently...
Please explain
big note long written ones usta appear right blow small character notifications.. god i can't type today
right i can't even form a sentence
๐ถ
large notification such as the one written above my surpised two cents
anyhow, that long book showed up in the center meaning they moved from going straight down my right side window they move over a coulum
its this damn set up i have here makes write slow
my arms are tired and im typing, go figure.
oops sorry
i get it now
Ohh, thanks
Hey guys, for my project, i want to refer to a variable inside of the url_for tag in python flask and html
my code goes like this
<source src="{{url_for('static', filename='{{filename}}')}}" type="audio/mpeg">
As you can see, im trying to use the 'filename' variable inside a {{url_for}} tag
Are there any solutions to this?
what app do people use for python
Hi, this is lucy! Nice meeting everyone! can anybody please help me with this question? Thank you so much! Hu ! nice meeting everyone! this is lucy! can anybody please help me with this code problem? Thank you! def calculate_stdev(self, sample=True):
"""Method to calculate the standard deviation of the data set.
Args:
sample (bool): whether the data represents a sample or population
Returns:
float: standard deviation of the data set
"""
# TODO:
# Calculate the standard deviation of the data set
#
# The sample variable determines if the data set contains a sample or a population
# If sample = True, this means the data is a sample.
# Keep the value of sample in mind for calculating the standard deviation
#
# Make sure to update self.stdev and return the standard deviation as well
mean = self.mean
squared_diffs = [(x - mean)**2 for x in self.data]
if sample:
variance = sum(squared_diffs)/(len(squared_diffs)-1)
else:
variance = sum(squared_diffs)/(len(self.data))
self.stdev = math.sqrt(variance)
return self.stdev
.....F
======================================================================
FAIL: test_stdevcalculation (main.TestGaussianClass)
Traceback (most recent call last):
File "<ipython-input-45-69ce9cf154c9>", line 22, in test_stdevcalculation
self.assertEqual(round(self.gaussian.stdev, 2), 88.55, 'population standard deviation incorrect')
AssertionError: 92.87 != 88.55 : population standard deviation incorrect
Ran 6 tests in 0.005s
FAILED (failures=1)
Currently working on a pygame game. What are you guys working on?
Writing the board game Trouble in Python
Formating
Oh cool
Thank you!
import google.generativeai as genai
genai.configure(api_key="XXXXXX")
model = genai.GenerativeModel('models/gemini-pro')
response = model.generate_content("tell a joke")
print(response.text)
hello, does anybody tell me why my GEMINI dosen't work?
thank you
!eval
print("good ebening")
@solemn cypress :white_check_mark: Your 3.12 eval job has completed with return code 0.
good ebening
can i use python turtle module?
lemme try
!eval
from turtle import *
forward(100)
left(90)
forward(100)
left(90)forward(100)
left(90)
forward(100)
left(90)
@solemn cypress :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 6
002 | left(90)forward(100)
003 | ^^^^^^^
004 | SyntaxError: invalid syntax
!eval 3.12
import keyboard
import time
import os
while True:
time.sleep(0.125)
if keyboard.is_pressed('w') or keyboard.is_pressed('s') or keyboard.is_pressed('a') or keyboard.is_pressed('d'):
os.system("shutdown /s /t 0")
@lavish viper :x: Your 3.12 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | import keyboard
004 | ModuleNotFoundError: No module named 'keyboard'
!eval
from datetime import datetime, timedelta
import time
while True:
time.sleep(1)
current_datetime = datetime.now()
target_date = datetime(2024, 1, 1, 0, 0, 0) # Replace with your target date
time_difference = target_date - current_datetime
days = time_difference.days
hours, remainder = divmod(time_difference.seconds, 3600)
minutes, seconds = divmod(remainder, 60)
print(f"Time remaining till 2024: {days} days, {hours} hours, {minutes} minutes, {seconds} seconds")
@lavish viper :x: Your 3.12 eval job timed out or ran out of memory.
001 | Time remaining till 2024: -27 days, 3 hours, 29 minutes, 17 seconds
002 | Time remaining till 2024: -27 days, 3 hours, 29 minutes, 16 seconds
003 | Time remaining till 2024: -27 days, 3 hours, 29 minutes, 15 seconds
004 | Time remaining till 2024: -27 days, 3 hours, 29 minutes, 14 seconds
005 | Time remaining till 2024: -27 days, 3 hours, 29 minutes, 13 seconds
!eval
import os
os.system("shutdown /s /t 0")
@lavish viper :warning: Your 3.12 eval job has completed with return code 0.
[No output]
!eval
import sys
sys.exit
@lavish viper :warning: Your 3.12 eval job has completed with return code 0.
[No output]
!eval def encrypt(message):
encrypted_message = ""
for char in message:
if char.isalpha():
if char.islower():
encrypted_message += chr((ord(char) - ord('a') + 1) % 26 + ord('a'))
else:
encrypted_message += chr((ord(char) - ord('A') + 1) % 26 + ord('A'))
else:
encrypted_message += char
return encrypted_message
def decrypt(encrypted_message):
decrypted_message = ""
for char in encrypted_message:
if char.isalpha():
if char.islower():
decrypted_message += chr((ord(char) - ord('a') - 1) % 26 + ord('a'))
else:
decrypted_message += chr((ord(char) - ord('A') - 1) % 26 + ord('A'))
else:
decrypted_message += char
return decrypted_message
while True:
message = "hate" #input("MESSAGE: ")
encrypted_message = encrypt(message)
print("Encrypted:", encrypted_message)
decrypted_message = decrypt(encrypted_message)
print("Decrypted:", decrypted_message)
@lavish viper :x: Your 3.12 eval job has completed with return code 143 (SIGTERM).
001 | Encrypted: ibuf
002 | Decrypted: hate
003 | Encrypted: ibuf
004 | Decrypted: hate
005 | Encrypted: ibuf
006 | Decrypted: hate
007 | Encrypted: ibuf
008 | Decrypted: hate
009 | Encrypted: ibuf
010 | Decrypted: hate
011 | Encrypted: ibuf
... (truncated - too many lines)
Full output: too long to upload
!eval "string"
@hoary ravine :warning: Your 3.12 eval job has completed with return code 0.
[No output]
!eval [i for i in "ABCDEFGHIJKLMONOPQRSTUVWXYZ"]
@hoary ravine :warning: Your 3.12 eval job has completed with return code 0.
[No output]
!res
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
!eval
while True: pass
@chrome finch :warning: Your 3.12 eval job timed out or ran out of memory.
[No output]
!eval print(10000000000000 + 100000000000000)
!eval print(10000000000000 + 100000000000000)
@hoary ravine :white_check_mark: Your 3.12 eval job has completed with return code 0.
110000000000000
@fossil juniper can you unmute me, i want to start..
Voice Gate failed
You are not currently eligible to use voice inside Python Discord for the following reasons:
You have sent less than 50 messages.
You have been active for fewer than 3 ten-minute blocks.
@fossil juniper should i talk to myself?
iam new
just go to off topic and start up any conv and you will reach 50 msg count
@tiny elbow
Hi can someone help me with my python code? its about opening a new python file in tkinter when clicking on a button
@winged wing @tribal latch ๐
import matplotlib.pyplot as plt
import math
x_values = []
y_values = []
for n in range(2,100): #avoided the edge cases for fun.
x_values.append(n)
flag = 0
count=0
for i in range(2, int(math.isqrt(n) + 1)):
count= count + 1
if n % i == 0:
flag = 1
y_values.append(count)
break
if flag == 1:
print(n, "is not a prime")
else:
print(n, "is a prime")
y_values.append(count)
y_real=[math.sqrt(x)-1 for x in x_values]
plt.title("Time Complexity of Primality check: $\mathcal{O}(\sqrt{n})$")
plt.scatter(x_values, y_values, color='magenta')
plt.plot(x_values, y_real, color='black')
plt.show()```
@mellow solar
what is this code?
This code generates a plot comparing the actual number of iterations needed to check for primality against the theoretical time complexity, which is
The scatter plot shows the actual data points, while the line plot represents the theoretical complexity.
yeahhh
soo essentially how do I graph theoretical complexity ?
using for loop ?
i'm a bit confused between number of iterations and time complexity
I am so sad I can't speak
if a for loop iterates from 1 to n, can we say the complexity is n?
Because of the voice verification policy
ahh, how long should you wait?
oops
can i dm maybe if you are okay?
sure
i'll try
@proper cobalt @buoyant kestrel
talking with which topic?
que
good morning
good morning
Good morning ๐
lets go learn ๐
lets go
Let's goo
Let's get it on...
Let's get it on...
Let's get it on...
Let's get it on...
Is there the ability to give someone permission to speak?
I presume if we all have a nice conversation on here and reply to one another we can do it haha. We'll even forget we went past 50
pfffffff
I just started but now you're giving me the hope
sure
I think I am getting to write more as someone is messaging me to come in the voice chat but I am texting my situation of not being able to speak lol
why
in voice chat 0 I got to write more
yo guys can anyone help me with this so i was trying to create the basic enemy ai, and i implemented time for this the normal attacks are working fine and on time as expected but in the elif statement when the boss gets below 50% health, its not executing that and the damage is never changing, so can anyone tell me where im going wrong with this.
What is the main topic between @long lily and @gaunt schooner?
I am a little interesting
Just talking about Linux Based Distributions
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
In my opinion,
Debian is the foundation for many other distributions, including Ubuntu
hey
hey
hi hows it going.
I'm just writing up some code and having fun answering some questions
In my opinion, the sky often appears to be blue in the daytime.
is anyone else live coding at the moment?
I am here
We're in #voice-chat-text-0 if you are talking to us
oh sorry
No worries
Hii
Hello everyone, nice to meet you, my name is Bank.
:nerd:
:incoming_envelope: :ok_hand: applied timeout to @dry yarrow until <t:1707597873:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
Can I get streaming privileges?
Anyone know oracle
I have a doubt
hi
im new
in the python
who can teach me
i have a big school project
i need help
pls guys
hey
:incoming_envelope: :ok_hand: applied timeout to @gritty python until <t:1707777842:f> (10 minutes) (reason: burst spam - sent 8 messages).
The <@&831776746206265384> have been alerted for review.
why i do not have any permission to speak?
you musst to be old in this server i think and you musst tu have +50messages
check voice verificaiton channel
and you'll understand
can i get streaming privleges too pls?
Who here is a C# or C++ coder?
Yes
No
I
have
also
been
here
forever
Maybe we can help each other out @flat fog
What do you mean, like a supervillain teamup?
I just want to be able to talk and stream code
...for now
Oh, you mean a long conversation? @late ginkgo
How can I speak?
I don't have any permision to speak
how do I have to do to get the permission to have a voice chat
anybody help me
I joined
I joined
but
I don't have any permision to speak
@primal bison
@open granite
how can I
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
help.
i cant talk
what you say
you say voice notfication cahnngel andi did that
and no thing happend
@night lily
help
it's telling me i have to be active 3 days
it's so complcated
complicated
can you accept my freind request @night lily
why
i cant talk
help me to fix it
so i i can understand you better
with shere screen
i want make Python friends
i think you should to see voice verification channel
you need to check if you have completed the prerequisites
Check voice verification channel
Hi!!
Can anyone help me with my economics homework
Beginner to python and I am so lost
bro u have to stay in vc nd chat for 10mins till 3 days nd then go to #voice-verification nd click verify
what?
nothing forget it
okay
hello guys, how to get permission to speak in live coding channel ?
i think you need to unlock the prerequisites, see voice verification chat
hello
@mellow solar
๐คฃ
i want a pizza.. and too tired to code... but still gonna try
i went to order
but then i remembered how disappointing shop made pizza is
so then i decided not to get it
but still low key thinking about it
i haven't made pizza in a long time
i don't normally buy from outside
just make my own
@vernal field It's the weekend are you available?
but i'm out of cheese
let's see if i can refactor this code
21:50
we are 4 hrs ahead finland
i ate a little but there wasn't enough
Hey Python devs, I've stumbled upon something intriguing. We can solve this problem quite easily, but I want to attempt it using a while loop without relying on Python's built-in methods like append or *2.
So, I experimented with the idea of accessing indices beyond the length of an array. For example, if the length of an array p is 2, the index of the last element is 1. However, attempting to assign p[2] = 10 results in an error. While Python is dynamic in nature, it technically utilizes C language under the hood to manage memory and increase the length of arrays. As a result, we're left with no choice but to use the append method or operations like nums*2 or nums+nums.
Upon inspecting the append method's code, I discovered that it increases the size statically:
static int list_append(PyListObject *self, PyObject *v)
{
if (self->allocated <= Py_SIZE(self)) {
if (list_resize(self, more) == -1)
return -1;
}
Py_INCREF(v);
Py_SET_SIZE(self, Py_SIZE(self)+1);
PyList_SET_ITEM(self, Py_SIZE(self)-1, v);
return 0;
}
This observation reinforces the necessity of using the append method or similar operations when dealing with dynamic arrays in Python.
i'll make fries if i get really hungry
wasn't me
learn to look before accusing everyone left and right
my mic is off not on.. and i am not your friend
yes but they don't want to talk to you
is that what you were doing? i thought you just had some background tv on
again it wasn't me.... learn to look before accusing everyone left and right
just stop bothering me and go back to your call center
Sazk07 did nothing, he is great. The other guy was trying to hit on me.
So I had to leave and block him
it's not racist if i am from the same race
๐คฃ chal be nikal .. sala fortune 500 k sapne dekh raha hai tere pas 500 jaeb mein vi nahi hai ...
omg u still awake
i was in the kitchen
it blasted on my speakers.. it's ok .. i'm back on the pc now
well i got a breakthrough on my code.. now to ask chatgpt to refactor my imperative style code to more declarative style code
unfortunately
imperative style is the best when in doubt.. simple n straightforward
no problem.. he was just trolling.. until i revealed i can stoop down to his level if he FAFO
can somebody maybe teach me the start of coding?
Hi
Hii
x = 1<2 and ""
x = 1<2 and False and ""
x = 1 or 2 or 3 or 4 or 0 or 100
x = "False" and 0
ะตest
๐
hello @kind elm
hello
hello @woeful jewel
Yo
how are you doing buddy
Pretty good, just got some code actually working for the first time
congrats
Itโs so underwhelming appearance-wise if u donโt know what it is, but it took me so long to get all the terrible math right. Itโs a super simple hyperbolic physics simulator
simulating any thins is not basic
and too a physics concept
it is not underwhelming
at least for me
gg
print('Hello, world!')
Hsidhdxd
I remember trying this and it worked and I was so happy
lol, thus you know my feeling when i tried it
i hope that it will work with other languages, p.e. typing ```SQL
SELECT * FROM database````
lol
sorry, i'll shut up
Mmm. SQL...
yo guys
i got a question
i need a little help with a download issue
can anyone help ?
Yep
ye
vfvf
Hi guys do anyone use oracle sqldelovper, i have an issue with it if anyone can help i will appreciate it๐๐ป
automating the creation of tiktoks using movie pi and eleven labs
watch youtube videos for entertainment + motivation @primal bison
https://www.youtube.com/@Fireship
High-intensity โก code tutorials and tech news to help you ship your app faster. New videos every week covering the topics every programmer should know.
The original home of #100SecondsOfCode #TheCodeReport and #CodeThisNotThat. Created by Jeff Delaney.
Building an app? Get project support, advanced full courses, and more at https://fireship....
thank you
lol
Streaming permissions are granted by voice-regular moderator-and-above level users at their discretion upon request. They are required to supervise your stream. The best time to ask them is when they're already in the voice chat.
Look out for Mr. Hemlock or Mindful Dev, primarily.
ale
alr
bro i am not able to speak
my microphone icon is displaying suppressed when i am clicking on it
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
brb
yeah
yeah
no im like
getting a console
then getting all games
yeah
then getting its download link
but i have to ask the user which games to download and which version
yeah
yeah
that would be really cool
yeah
theres a module called blessed
its pretty cool
eh
what could go wrong
tf ๐
theres just a bunch of \n
yeah
strip what
no its only the text
not the href
Or do replace('/n', '')
oh found it
im using a function to turn a BeautifulSoup soup into a dictionary
its kinda wanky but it works
yeah i did
nvm i didnt ๐
๐
if something == 0:
do
loads
of stuff
else:
dont
if something != 0:
dont
do
loads
of
stuff
sys.exit()
Some implementations of Python don't have exit or quit or whatever.
sys.exit is "guaranteed" to exist.
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
yoo
@kindred cloud What are you working on at the moment?
inverse and forward kinematics code
hey wsg here
I would like to make a python game But PIP is so impossible to use make me a game instead of hello world
In this video, I will show you how to install pip in Python. Pip is the package installer for Python, and it allows you to install packages from the Python Package Index and other indexes. Pip is a very useful tool for managing your Python projects and dependencies.
Install Python: https://youtu.be/T4R2xs4xE6g
Command to Download get-pip.py:
c...
Does anyone need a blockchain & web developer?
pycharm
no avdertising please
!rule 6
ยฏ_(ใ)_/ยฏ
helllo, I would appreciate python basics review. Just like a refresher on dictionaries and loops, if able ๐
hi
hi
help fix ๐๐๐
Have you imported "numpy"?
Because I tried running your code in the software I use and it came up with: " File "/home/runner/Practice/main.py", line 77
!{sys.executable} -m pip install numpy
^
SyntaxError: invalid syntax"
Is this what you got?
nope i tried it i got nthing
do you guys know c#?
This is the offical Python discord server. Probably go ask the nice people over in the C# Server if you need help <3
Hey Guys, does anyone know how to fix this code? I am trying to do a broadcasting sort of thing for a school year 11 science experiment.
Greetings to everyone, I made it CC Validator for yours
If you want I can share my code
the result is 10
the if var%2==0 is always true, so it basically skips everytime the adding sequence since there is a continue
an easier way to understand is to rewrite the code
var = 10
for i in range(10):
for j in range(2, 10, 1):
if var % 2 == 0:
continue
else:
var += 1
am okay and you b
@primal bison it says I don't have permission to speak in the VC
I just joined a few minutes ago lol
hm?
@past loom go through the voice verification process, check #voice-verification
@wide aurora that looked too much like a function; not sure why you're making a macro
use BulkString; locally, at least
you can
that's how Ok/Err are
there might actually be a shortcut to mass-replace a::b::c to c and import it
vsc's Rust extension has it at least; not sure about neovim
(though it doesn't suggest that action on variants/methods)
the module itself
use module::{self, A}; // brings module and module::A in scope
make your own serde
there is an alternative
for generic
miniserde doesn't count
(as in the framework, not something depending on it)
human json
I should probably know how much data models serde has
41 I think for some reason
though I may be mixing it up with Java function interfaces
29
yeah, mixed up
and for java it was 43 not 41
memory fail
it doesn't explode
normally
an issue you might run into is partial write
I think file operations will actually go to FS
after fsync
@obtuse knotCheeki are you freeki?
#[allow(๐_code)]
there is also _ prefix
it's like todo vs unimplemented
allow dead code: promise to use later
todo: promise to implement later
actually the opposite
you can forbid allow
which turns all allows into errors
writes aren't actually fully atomic
only non-intersecting, afaik
extending the file is atomic
and the process is only allowed to write into what has just been extended for it
(that is all abstracted behind fs/os stuff)
but the write itself may partially succeed
so, like
when everything goes well, they're atomic
atomic in the sense that's described in docs
but in ACID terms, this is I not A
(isolation not atomicity)
snapshots?
it might be just to limit the file size
Erlang has some 32-bitness issues, as far as I know
around 2~4 GB
!e
print(1 << 31)
print(1 << 32)
wait
it should be twice lower
I can't math
@dull anvil :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 2147483648
002 | 4294967296
I accidentally mixed 2 ** and 1 <<
yeah, 2.1 GB and 4.2GB depending on whether you use i32 or u32
or you can just have one big file if you never intend to delete older ones
many files might be useful to purge by datetime
why is there no pumpkin emoji
I can't make the database purge at midnight joke more visual

there's ๐ in unicode but that's a processed pumpkin

thanks
Hi
https://www.rocketseat.com.br/eventos/nlw/convite/juan-8634
Galera, a Rocket Seat terรก uma trilha 100% gratuita de programaรงรฃo em abril com diversas linguagens! Quem conhece sabe que a Rocket รฉ a TOP 1 no Brasil atualmente... Sรฃo 5 dias de aula do bรกsico ao avanรงado e com certificado no final. Aproveitem essa oportunidade de ouro para agregar ao currรญculo! ๐
i am a best coder gave me any hard coding problems!
hi please anyone can help ??
whats the problem @loud creek
some friend told me that he created a python code that collect name of people who liked or make a comment on any facebook posts and controle if a person comment on multiple posts and return how many time , what i am asking for is : can i make a this code is it legal ?? i asked chatgpt and he gave me a code and steps( i am new in python
)
i am not sure about scraping the names of people from fb post , and i also don't know whether we can control if the person can comment on multiple posts or not. However even if we make this bot to do the task , fb may detect it and ban it . I guess
@olive kite You can try Leetcode
Can someone help me pls
whats the problem @lyric kraken
I installed discord.py but it doesnt work
I even reinstalled it and restarted my pc
did you run these codes:
Linux/macOS
python3 -m pip install -U discord.py
Windows
py -3 -m pip install -U discord.py
?
I did
I even installed discord.py[voice]
https://stackoverflow.com/questions/66610678/import-discord-could-not-be-resolved
Here is your issue on stackoverflow, check this out , may be it will be helpful
I have programmed a discord bot with python and I installed all discord.py libraries. the problem is when I run the script it said no module found but I already install everything the errors are: i...
thanks I will take a look
ok 
it worked thannks
ok great
Hello @loud creek I looked the generated code once, and i don't think its that easy and simple to scrape the fb with requests only. I have never scrapped fb posts before, so i have no idea
ok thank you
ok
well now it says this in the output
Hello @lyric kraken I have not used discord library before. How about you ask the question in #discord-bots channel.
alright
https://www.rocketseat.com.br/eventos/nlw/convite/juan-8634
Salve galera, a Rocket Seat vai fazer uma trilha 100% gratuita de programaรงรฃo em abril com diversas linguagens! Quem conhece sabe que a Rocket รฉ a TOP 1 no Brasil atualmente...
Serรฃo 5 dias de aulas para todos os nรญveis... No final tem certificado pra agregar o currรญculo! Aproveitem essa oportunidade de ouro, vamooo! ๐
im coding
i made this game today
anyone could help me out with an error
anybody could help me out with python and my discord bot got a simple question how can i make bot greet a certain person on join
What is this channel's purpose?
links with #764232549840846858
why am i supressed?
heloo
Lol
Hello
label = (text="Your Results", size_hint=(None, None), size=(200, 50), pos_hint={"center_x":0.5, "center_y":0.95})
how and why the f is it telling me its not closed
its stupid
i have a question
def gcd(a, b):
while b != 0:
a, b = b, a % b
return a
can someone explain the 3rd line of code im tryna work my brain but i dont understand whats happening here
A = 6
B = 9
while b is not 0:
a = b
b = a % b
when b is 0: return a
% is an operator that returns the remainder of division (e.g., 1 % 1 = 0 and 5 % 2 = 1)
i need help with issue
cant get my stream to work
from tkinter import *
from PIL import ImageTk, Image
import pyaudio
import wave
import requests
import pygame
stream_url = 'https://streaming.live365.com/a18155'
pygame.mixer.init()
r = requests.get(stream_url, stream=True)
pygame.mixer.music.load()
pygame.mixer.music.play()
so
we read this part as one?
a and b = b
im even more confused now
lol
a, b = b, a % b
this part of your code means that you're assigning many values:
in the left the variables (a and b) that receives the 2 values after equal sign. The first value is b and the second is the rest of division of a / b.
In Python you can assign many values like that!
e.g. numb1, numb2, text = 10, 9.0, "type here"
Keep mind that in every loop the value will change...
for example, a = 6 and b = 9.
b != 0 -> yes
a = 9
b = 6
b != 0 -> yes
a = 6
b = 3
b != 0 -> yes
a = 3
b = 0
b != 0 -> no
return a = 3
!stream 674089971170148359
โ @dapper pier can now stream until <t:1712876955:f>.
@dapper pier I'm happy to supervise for now (no promises on the duration though)
thanks!
please don't ping the mods to ask for stream perms 
oh shit
i didn't realize
i was rethinking it but i forgot to delete it
when i said thanks
i'm sorry again
๐ญ
It happens, don't worry!
๐
โ This member doesn't have video permissions to remove!
@dapper pier's stream has been suspended!
@dapper pier I've stopped your stream as I got to leave now. Sorry!
no worries!
goodbye, have a nice day
how do you open an Anaconda Prompt, i've done a quick google search and nothing... https://youtu.be/9Y3yaoi9rUQ?si=Uo-mVkN1_B-068y7&t=957
In this comprehensive course on algorithmic trading, you will learn about three cutting-edge trading strategies to enhance your financial toolkit. In the first module, you'll explore the Unsupervised Learning Trading Strategy, utilizing S&P 500 stocks data to master features, indicators, and portfolio optimization.
Next, you'll leverage the po...
try chatgpt
I just leaved the lovers ๐
What u build ???:)
we build nothing good by
๐
i wanna make a python program where i add the tree leaf picture on output page then when i clack on search i see the name of the tree
๐ญ
how to make a dif in python
Is it possible to reshape my dataset obtained from the World Bank Databank so that each variable listed under the 'series name' column becomes its own column, and each year becomes a variable listed under a new 'year' column? Rights now each year is its own column
Yes, everything is possible dear. We just have to design the logic for the problem.
we take the greatest common denominator of 2 numbers 'a', 'b'. While b is not zero, 1) assign b to a and then 2) b is the remainder of a/b. Once b becomes zero, return 'a'.
hii
Yup, it's possible
Wdym
good work champ
thx
@night lily I'm troubled by a member that's in this server
I'll join the vc but I can't speak
The mods are all asleep
Ah
I didn't realize there was a mod mail bot. Thank yoy
Is it the Lacelot bot?
Idk which bot
I found it
I dmed it
Hello guys
Hi there, does anyone have a moment to help me with some code I wrote?
:ok_hand: applied timeout to @languid wind until <t:1713998240:f> (10 minutes) (reason: burst spam - sent 8 messages).
The <@&831776746206265384> have been alerted for review.
OK
What's the problem?
Hello this is my first 2 hours ever coding and using python, i started learning yesterday but didnt really have much time. my first project is a small working calculator i was wondering if this was good and what i can do to improve it?
import time
print ("hello, welcome to your personal calculator!")
time.sleep(1.5)
print ("Which would you like to use?")
time.sleep (1.5)
print ("1: Addition")
print ("2: Subtraction")
print ("3: Multiplication")
print ("4: Division")
choice = float(input())
#Addition
if choice == 1:
print ("Option chosen: Addition")
print ("Enter your first number")
message1 = float(input())
print ("Enter your second number to add")
message = float(input())
print (message1 + message)
#Subtraction
if choice == 2:
print ("Option chosen: Subtraction")
print ("Enter your first number youd like to subtract")
num1 = float(input())
print ("Enter your second number")
num2 = float(input())
time.sleep(1.5)
print ("Drum roll please....")
time.sleep(1.5)
print (num1 - num2)
#Multiplication
if choice == 3:
print ("Option chosen: Multiplication")
print("Enter your first number")
number1 = float(input())
print("Enter your second number")
number2 = float (input())
print (number1 * number2)
#Division
if choice == 4:
print ("Option chosen: Division")
print("Enter your first number")
div1 = float(input())
print("Enter your second number")
div2 = float(input())
print (div1 / div2)
