#voice-chat-text-0
1 messages ยท Page 192 of 1
i will hide the comments i upload on youtube from every single human being thats close to me
there is a library to handle all that simply, but I forgot what it is
they shall not be seen
to interface with message queues specifically
this but long-running
https://www.rabbitmq.com/tutorials/tutorial-six-python.html
with exclusive queues that web thing would listen on
why is wikipedia diagram with such a weird text layout
screenshot maybe
!e
from abc import ABC
class A(ABC):
pass
class B(ABC, A):
pass
@vocal basin :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 6, in <module>
003 | class B(ABC, A):
004 | File "<frozen abc>", line 106, in __new__
005 | TypeError: Cannot create a consistent method resolution
006 | order (MRO) for bases ABC, A
!e
from abc import ABC
class A(ABC):
pass
class B(A, ABC):
pass
@vocal basin :warning: Your 3.11 eval job has completed with return code 0.
[No output]
this
@rugged root I was showing this for mro failure not for ABC specifically
"In object-oriented systems with multiple inheritance,
some mechanism must be used for resolving conflicts when inheriting different definitions of the same property
from multiple superclasses." C3 superclass linearization is an algorithm used primarily to obtain the order in which methods should be inherited in the presence of multiple inherita...
what Python uses
for error
for error it needs, I think
eh
not exactly
it says this is abc
this specific class
!e
from abc import ABC
class A(ABC):
pass
# concrete
class B(A):
pass
@vocal basin :warning: Your 3.11 eval job has completed with return code 0.
[No output]
!e
from abc import ABC
class A:
pass
class B(ABC, A):
pass
@vocal basin :warning: Your 3.11 eval job has completed with return code 0.
[No output]
!e
from abc import ABC, abstractmethod
class A(ABC):
@abstractmethod
def method(self): ...
# factually abstract
class B(A):
pass
@vocal basin :warning: Your 3.11 eval job has completed with return code 0.
[No output]
!e
from abc import ABC
class A(ABC):
pass
A()
@vocal basin :warning: Your 3.11 eval job has completed with return code 0.
[No output]
eh
sadly, this works
the solution is:
don't use inheritance
really don't use inheritance
interfaces are more reliable
but inheritance seems simpler until issues start
OOP and inheritance aren't really related
it is not.
with how many different definitions of OOP are
OOP is not Java
also, prototype orientation isn't object orientation
Lua
prototype orientation is closer to inheritance than object orientation
it is built out of it
and in a more formal concatenation and/or overwriting way
Right
inheritance in earlier OOP-ish languages was concatenation in name and in implementation
earlier as in before OOP existed as a (buzz)word
Right
yes, it will cause issues
if overwritten
"but it will fail reliably"
not exactly
Python's Protocols are
you don't need to inherit from a protocol
you must inherit from an interface
!d typing.Protocol
class typing.Protocol(Generic)```
Base class for protocol classes.
Protocol classes are defined like this:
```py
class Proto(Protocol):
def meth(self) -> int:
...
``` Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example...
which is why, even if they are superior to concretion inheritance, they are inferior to traits
dynamic type check is the only thing which that model truly gives
Gotcha
=> you can't implement an interface for something you didn't define
but you can implement a trait (in Rust)
and you can describe existing type with a new Protocol (in Python)
Protocols can be checked dynamically
if enabled
Raymond Hettingerr Super() <- depenency injection talk
https://www.youtube.com/watch?v=EiOglTERPEo
"Speaker: Raymond Hettinger
Python's super() is well-designed and powerful, but it can be tricky to use if you don't know all the moves.
This talk offers clear, practical advice with real-world use cases on how to use super() effectively and not get tripped-up by common mistakes.
Slides can be found at: https://speakerdeck.com/pycon2015 and ...
class AsIntegerRatio(Protocol):
def as_integer_ratio(self) -> tuple[int, int]: ...
DI is great but misunderstood
super is weird
partially taps into the same mechanisms as self.__private
both know the class context
somehow
leetcode's timing is unreliable, but if 90% solutions do it in <100ms and your solution takes 4996ms, you can make conclusions
!projects
The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
for a day I had beats 100% on some relatively popular problem
but that often includes some cursed optimisations
and also that's Python so doesn't matter much
I had one of those type of 100% too
but it was thanks to the input set being small
there is multidimensional A* in some leetcode problems
now that I spoiled the solution...
https://leetcode.com/problems/shortest-path-to-get-all-keys/
almost sure this was A*
eight dimensional, I think
I don't publish them
usually
(i.e. don't click the button)
lazy
it adds to the ranking
but without contents
caching but strict
@functools.cache + asyncio.create_task() -- a truly cursed approach
but it has low stack height
though
no, decorator cache wouldn't help
I think
or it might
the function would have to return a task
then, yes, there it would work
Lol. A lot of things are like "Minimum number of coins needed to achieve some result"
But I suppose you know all of this becasue you leetcode

LEET ALL THE CODE
!e
import asyncio
import functools
def schedule(f):
@functools.wraps(f)
def wrapped(*args):
return asyncio.create_task(f(*args))
return wrapped
@functools.cache
@schedule
async def cursed(n: int) -> int:
if n <= 0:
return 0
else:
return ((await cursed(n - 1)) + (await cursed(n - 2))) // 2 + n
async def main():
print(await cursed(20000))
asyncio.run(main())
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
133340000
not exactly efficient
but at least doesn't crash
"why don't coordinates also include time"
I was trying to make a game with coordinates that would work like they would in special theory of relativity
I made a thing that correctly accelerates at constant speed and then gave up
From whose perspective?
those aren't http though
both server and whatever accelerates, and any other perspective
Uh...
"the server" is two fixed points that a game server treats as base
two events rather
I think from the perspective of the unit traveling it would feel a constant acceleration where from the server's perspective it wont be constant
From a physics POV
Yah, and the time of the universe speeds up relatively?
!stream 133817562646577153
โ @alpine crow can now stream until <t:1695843138:f>.
everything in game happens after the first event
universe simulation starts at the same spacetime interval as second event
universe evolves in such a way that a point (with a specific associated speed (part of server "config")) starting at second event would experience constant change of time
at each moment, everything in the universe is the same spacetime interval away from first event
That's weird because events experienced by the relativistic person would not be in sync to the global clock
yes, obviously
the key is that spacetime interval changes at constant speed
scuffed paint diagrams time
each next yellow line (yes, very visible on white background) is after the previous one for every observer
i.e. lozentz transformations that keep the origin in the same place, keep those hyperbolic thing layers as is
only move points within them
I had an interactive Jupyter thing with animation, but that's gone now
def __send_discord_put_request(self, uri:str):
statuscode = 0
for x in range(0,3):
r = requests.put(uri, headers=self.__generate_discord_header())
statuscode = r.status_code
if statuscode == 429: #If
sleep(int(r.headers['X-RateLimit-Reset-After']))
elif statuscode in range(200,299):
return r```
!e python for x in range(0,3): print(x)
@amber raptor :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
!e py for x in range(3): print(x)
@alpine crow :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
haskell ๐ฉ
Rust
Rust is Haskellified C
nanocentury sounds like around 3.1 seconds
[0..10]
not objectively while Maths exists with [0,3)
just because we need to support Maths as a legacy notation
or [0;3) depending on country
yeah
(60*60*24*365)/1,000,000,000 = ~ 0.031ms = 1 Nano Century
missing * 100
>>> timedelta(days=365*100)/1_000_000_000
datetime.timedelta(seconds=3, microseconds=153600)
Where does the 100 come from ?
century not year
...Of course
[1,3..10]
[0,...,1]
!e hs x = [1,3..10] x
!e
[0,...,1]
@vocal basin :warning: Your 3.11 eval job has completed with return code 0.
[No output]
!e ```py
def i_havent_made_this_yet():
...
print('hello')
!e python import datetime dt_now = datetime.datetime.now('2023-01-21T23:36:33.435Z') print(dt_now)
@amber raptor :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | dt_now = datetime.datetime.now('2023-01-21T23:36:33.435Z')
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | TypeError: tzinfo argument must be None or of a tzinfo subclass, not type 'str'
strptime?
!e
...
it might alternatively be from-iso-something
!e python import datetime print(datetime.datetime.strptime('2023-01-21T23:36:33.435Z'))
@amber raptor :x: Your 3.11 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(datetime.datetime.strptime('2023-01-21T23:36:33.435Z'))
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | TypeError: strptime() takes exactly 2 arguments (1 given)
!e ```py
import datetime
print(datetime.datetime.fromisoformat('2023-01-21T23:36:33.435Z'))
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
2023-01-21 23:36:33.435000+00:00
turns out this
!e python import datetime print(datetime.datetime.utcfromtimestamp('2023-01-21T23:36:33.435Z'))
@amber raptor :x: Your 3.11 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(datetime.datetime.utcfromtimestamp('2023-01-21T23:36:33.435Z'))
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | TypeError: 'str' object cannot be interpreted as an integer
@amber raptor this
!e ```py
import datetime
print(datetime.datetime.fromisoformat('2023-01-21T23:36:33.435Z').timestamp())
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
1674344193.435
!e
import platform
# Architecture
print("Architecture: " + platform.architecture()[0])
# machine
print("Machine: " + platform.machine())
# node
print("Node: " + platform.node())
# system
print("System: " + platform.system())
# distribution
dist = platform.dist()
dist = " ".join(x for x in dist)
print("Distribution: " + dist)
@meager shuttle :x: Your 3.11 eval job has completed with return code 1.
001 | Architecture: 64bit
002 | Machine: x86_64
003 | Node: snekbox
004 | System: Linux
005 | Traceback (most recent call last):
006 | File "/home/main.py", line 16, in <module>
007 | dist = platform.dist()
008 | ^^^^^^^^^^^^^
009 | AttributeError: module 'platform' has no attribute 'dist'
!e
# processor
print("Processors: ")
with open("/proc/cpuinfo", "r") as f:
info = f.readlines()
cpuinfo = [x.strip().split(":")[1] for x in info if "model name" in x]
for index, item in enumerate(cpuinfo):
print(" " + str(index) + ": " + item)
@meager shuttle :x: Your 3.11 eval job has completed with return code 1.
001 | Processors:
002 | Traceback (most recent call last):
003 | File "/home/main.py", line 3, in <module>
004 | with open("/proc/cpuinfo", "r") as f:
005 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
006 | FileNotFoundError: [Errno 2] No such file or directory: '/proc/cpuinfo'
!e
import platform
print(platform.freedesktop_os_release())
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
{'NAME': 'Debian GNU/Linux', 'ID': 'debian', 'PRETTY_NAME': 'Debian GNU/Linux 12 (bookworm)', 'VERSION_ID': '12', 'VERSION': '12 (bookworm)', 'VERSION_CODENAME': 'bookworm', 'HOME_URL': 'https://www.debian.org/', 'SUPPORT_URL': 'https://www.debian.org/support', 'BUG_REPORT_URL': 'https://bugs.debian.org/'}
!e py import platform print(platform.uname())
@alpine crow :white_check_mark: Your 3.11 eval job has completed with return code 0.
uname_result(system='Linux', node='snekbox', release='5.10.0-21-cloud-amd64', version='#1 SMP Debian 5.10.162-1 (2023-01-21)', machine='x86_64')
!e
print("Memory Info: ")
with open("/proc/meminfo", "r") as f:
lines = f.readlines()
print(" " + lines[0].strip())
print(" " + lines[1].strip())
@meager shuttle :x: Your 3.11 eval job has completed with return code 1.
001 | Memory Info:
002 | Traceback (most recent call last):
003 | File "/home/main.py", line 2, in <module>
004 | with open("/proc/meminfo", "r") as f:
005 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
006 | FileNotFoundError: [Errno 2] No such file or directory: '/proc/meminfo'
platform is one of "use this instead of os" libraries
!e
import platform
print(platform.processor());
print(platform.platform());
print(platform.version());
@meager shuttle :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 |
002 | Linux-5.10.0-21-cloud-amd64-x86_64-with-glibc2.36
003 | #1 SMP Debian 5.10.162-1 (2023-01-21)
along with pathlib, threading, random, secrets and maybe others
!e
import socket
print(socket.gethostbyname(socket.gethostname()))
@meager shuttle :x: Your 3.11 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(socket.gethostbyname(socket.gethostname()))
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | socket.gaierror: [Errno -3] Temporary failure in name resolution
#bot-commands
k
!user
You are not allowed to use that command here. Please use the #bot-commands channel instead.
https://www.youtube.com/playlist?list=PLrQMyTCtW0DZolJHWBLELne1EF2gqMaHc
... recording of the group coding sessions we did over in the cucumber project.
The Trial (German: Der Process, previously Der Proceร, Der Prozeร and Der Prozess) is a novel written by Franz Kafka in 1914 and 1915 and published posthumously on 26 April 1925. One of his best-known works, it tells the story of Josef K., a man arrested and prosecuted by a remote, inaccessible authority, with the nature of his crime revealed ne...
discord has partial message
HTTP defines a set of request methods to indicate the desired action to be performed for a given resource. Although they can also be nouns, these request methods are sometimes referred to as HTTP verbs. Each of them implements a different semantic, but some common features are shared by a group of them: e.g. a request method can be safe, idempot...
hi, could someone help me with a python package pls, im super confused how to get working
what package?
https://github.com/acoustid/mbdata im trying to import a dataset called musicbrainz into postgresql
they advise to use this tool on their website to import into postgres and create schema
but i cant figure out how to get it working
any errors?
theres no instructions anywhere how to use xd
they just say on their website use it im not sure how
lol
yeah im trying to use it for a personal project
but
their tool is garbo or im stupid
do you have postgres running?
what format is the dataset in?
.tar.gz
unpack it
does it work with something other than postgres?
(I know the tool does; asking whether you tested)
.tar.gz would probably contain .db file(s) which are SQLite
so it would be
DATABASE_URI = 'sqlite:///path/to/database.db'
ok i might give it a break and try again tomorrow ty for helping
> giveaway bot
aka scam bot
F
ChatGPT is terrible as a teacher
it's irresponsible
there is no one to blame for its mistakes
making discord bots is useful for learning async
Rust's async support is extremely good
but I would advice against using it to interact with Discord
ill prolly try python since I haven't tried async
apparently there's this, but it relies on tokio (very frameworky async runtime)
https://github.com/serenity-rs/serenity
rule 5 is only for asking/providing help
not past experiences
To be clear, you don't need to be discussing executing malware or abuses of Discord's infrastructure or API either.
i love hacking schools i mean what
bc its a type of DDOs?
@whole bear make a CLI
yeah, in details would potentially provide help
and mention of it (documented) would get in trouble with Discord itself
what
yes
Our rules extend to voice channels as well.
we exist
ping pythondiscord -t
!user
You are not allowed to use that command here. Please use the #bot-commands channel instead.
!e
for _ in range(1000000000000000000000000000):
print('You are not allowed to use that command here.')
it saves as temporary file when it overflows if it can
oh
thats nice
#bot-commands
Websites for you and your projects, hosted directly from your GitHub repository. Just edit, push, and your changes are live.
help with what?
ki nik om zbi
a rock paper scissors project
what is the issue?
or do you need general guidance/advice/etc.?
guidance , like w what should i start
i alr started
but idk if im headin to thr right path w this
am i allowed to send my code in here?
first, you can make a function which decides (based on choices of two players) which one wins
!paste
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 Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
import time
import random
menu_options = ('r', 's', 'p',)
while True:
print()
print('MENU')
print('r = rock')
print('p = paper')
print('s = scissor')
user_input = input('Enter an option: ')
if user_input in menu_options:
break
else:
print()
print('OPTION NOT AVAILABLE')
choices=["rock","paper","scissor"]
choice=random.choice(choices)
print(choice)
as this would be useful regardless of which interface you pick
garbage ik but im tryna figure out what to do next
!code use this to format it
(highlighted)
import time
import random
menu_options = ('r', 's', 'p',)
while True:
print()
print('MENU')
print('r = rock')
print('p = paper')
print('s = scissor')
user_input = input('Enter an option: ')
if user_input in menu_options:
break
else:
print()
print('OPTION NOT AVAILABLE')
choices=["rock","paper","scissor"]
choice=random.choice(choices)
print(choice)
so, for now it only checks where is valid, right?
idk what to do nect just lost
wdym?
i just started coding to be clear i have 0 expereince
you have user_input and choice
based on this data, you can decide whether the user won or lost
(or tied)
where should i get started on learning howto even do that tho?
i looked up tutorials on how to make a menu and make the computer do a ra ndom choice
?
TYSM
I was trying to link something like what they did
this might be easier to use
https://docs.python.org/3/tutorial/controlflow.html#tut-match
but the bot put something way too complicated
well thank yall anyways
how can i use this on a rock paper sisccord project tho
its quite simple ngl
if choice == 'rock' and user_input == 's':
print('You lose')
this is one example case
wait
question
how do i generally refer to the computer
ik u refer to urself with user_input
!e
player_1, player_2 = "p", "r"
match player_1, player_2:
case ("r", "s") | ("p", "r") | ("s", "p"):
print("player 1 wins")
# fill the rest
@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.
player 1 wins
user_input is just any name they set user_input = input('Enter an option: ')
yeah but they prolly use if else for the first time ever lol
so this is general scheme you can adjust to meet requirements of your usecase
I think match is sometimes more user-friendly than if
though that's more for staticly typed languages
3.10 I think
!d match
8.6. The match statement
New in version 3.10.
The match statement is used for pattern matching. Syntax:
match_stmt ::= 'match' subject_expr ":" NEWLINE INDENT case_block+ DEDENT
subject_expr ::= star_named_expression "," star_named_expressions?
| named_expression
case_block ::= 'case' patterns [guard] ":" block
```...
so, previous version
markdown primarily compiles to HTML
you need a rendered
either before generating HTML or after
I can't really remember much about 3.11 apart from asyncio updates
and optimisation
ummm
how do i make it a lopp
loop
like play again without running the code again
with the same construct you have for retrying to get user input
ummmmmm didnt work
well the choice is random
should i just go on yt?
BRO
that will only work if the choice is rock and u pick scissor
i put in s and the ai chose r
yes
showed nothin
it works only for certain choices (one out of 9 possible)
use chatgtp
23 @whole bear
yes
wich was the case
no.
!e ```py
while True:
do program
if input('Exit Program? N') != 'N':
break ```
input can't !e
ye
ok this is very complicated gotta understand this 1st
can someone xplain what while true is geenrally for?
while x repeats while x is true
so while True will just always repeat until you break
aight basically a loop till an error pops
yeah break means stop whatever loop im in
it's good for exiting nested loops IIRC
i still dont understand why this didnt work
return handles it better for nested
guys for i in range doesnt work
that as well
!e py choice = 'rock' user_input = 's' if choice == 'rock' and user_input == 's': print('You lose')
@alpine crow :white_check_mark: Your 3.11 eval job has completed with return code 0.
You lose
try-except around everything adds extra indentation, which probably is already far from none given the nesting
at root level it would be the same, ig
ok now we have a new issue
it shows you lose everytime
import time
import random
menu_options = ('r', 's', 'p',)
while True:
print()
print('MENU')
print('r = rock')
print('p = paper')
print('s = scissor')
user_input = input('Enter an option: ')
if user_input in menu_options:
break
else:
print()
print('OPTION NOT AVAILABLE')
choices=["rock","paper","scissor"]
choice=random.choice(choices)
print(choice)
choice = 'r'
user_input = 's'
if choice == 'r' and user_input == 's':
print('You lose')
basically remove choice =r and use input
wsp
fr?
import random
import time
menu_options = ('r', 'p', 's')
while True:
print()
print('MENU')
print('r = rock')
print('p = paper')
print('s = scissors')
user_input = input('Enter your choice (r/p/s): ')
if user_input in menu_options:
break
else:
print()
print('OPTION NOT AVAILABLE')
choices = ["rock", "paper", "scissors"]
choice = random.choice(choices)
print("Computer's choice:", choice)
if user_input == 'r':
if choice == 'rock':
print('It's a tie!')
elif choice == 'paper':
print('Computer wins!')
else:
print('You win!')
elif user_input == 'p':
if choice == 'rock':
print('You win!')
elif choice == 'paper':
print('It's a tie!')
else:
print('Computer wins!')
elif user_input == 's':
if choice == 'rock':
print('Computer wins!')
elif choice == 'paper':
print('You win!')
else:
print('It's a tie!')
if user_input == 'r':
if choice == 'p':
print('you lose')
elif choice == 's':
print('you win')
else:
print('tie')```
why did u put
in if =
but in elif
==
@alpine crow
i dont think i still quite understand$
the difference
wsp
!e py x = 5 y = 7 print(x) print(x == y) print(5 == 5)
@alpine crow :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 5
002 | False
003 | True
im new bro
chill
yo japlic how old r u
yup
u sound young yet ur experienced
im 16
TF
honest reaction
nobodys seen nothin we gud?
we gud
!e ```py
if 5 == 5:
print('this is true')
if 7 == 5:
print('this is not true')
else:
print('7 is not equal to 5')```
@alpine crow :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | this is true
002 | 7 is not equal to 5
!e print(7 == 5)
@alpine crow :white_check_mark: Your 3.11 eval job has completed with return code 0.
False
!e py print(5 > 2) print(3 >= 3) print(5 > 7)
@alpine crow :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | True
002 | True
003 | False
!e
print(5 > 2)
print(3 >= 3)
print(5 = 7)
<, <=
!e import random
import time
menu_options = ('r', 'p', 's')
while True:
print()
print('MENU')
print('r = rock')
print('p = paper')
print('s = scissors')
user_input = input('Enter your choice (r/p/s): ')
if user_input in menu_options:
break
else:
print()
print('OPTION NOT AVAILABLE')
choices = ["rock", "paper", "scissors"]
choice = random.choice(choices)
print("Computer's choice:", choice)
if user_input == 'r':
if choice == 'rock':
print('It's a tie!')
elif choice == 'paper':
print('Computer wins!')
else:
print('You win!')
elif user_input == 'p':
if choice == 'rock':
print('You win!')
elif choice == 'paper':
print('It's a tie!')
else:
print('Computer wins!')
elif user_input == 's':
if choice == 'rock':
print('Computer wins!')
elif choice == 'paper':
print('You win!')
else:
print('It's a tie!')
@whole bear :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 28
002 | print('It's a tie!')
003 | ^
004 | SyntaxError: unterminated string literal (detected at line 28)
import time
import random
menu_options = ('r', 's', 'p',)
while True:
print()
print('MENU')
print('r = rock')
print('p = paper')
print('s = scissor')
user_input = input('Enter an option: ')
if user_input in menu_options:
break
else:
print()
print('OPTION NOT AVAILABLE')
choices=["rock","paper","scissor"]
choice=random.choice(choices)
print(choice)
if user_input == 'r':
if choice == 'p':
print('you lose')
elif choice == 's':
print('you win')
else:
print("DRAW")
if user_input == 's':
if choice == 'r':
print('you lose')
elif choice == 'p':
print('you win')
else:
print("DRAW")
if user_input == 'p':
if choice == 's':
print('you lose')
elif choice == 'r':
print('you win')
else:
print("DRAW")
says line 31
wait
import random
import time
menu_options = ('r', 'p', 's')
while True:
print()
print('MENU')
print('r = rock')
print('p = paper')
print('s = scissors')
user_input = input('Enter your choice (r/p/s): ')
if user_input in menu_options:
break
else:
print()
print('OPTION NOT AVAILABLE')
choices = ["rock", "paper", "scissors"]
choice = random.choice(choices)
print("Computer's choice:", choice)
if user_input == 'r':
if choice == 'rock':
print("It's a tie!")
elif choice == 'paper':
print('Computer wins!')
else:
print('You win!')
elif user_input == 'p':
if choice == 'rock':
print('You win!')
elif choice == 'paper':
print("It's a tie!")
else:
print('Computer wins!')
elif user_input == 's':
if choice == 'rock':
print('Computer wins!')
elif choice == 'paper':
print('You win!')
else:
print("It's a tie!")
!e import random
import time
menu_options = ('r', 'p', 's')
while True:
print()
print('MENU')
print('r = rock')
print('p = paper')
print('s = scissors')
user_input = input('Enter your choice (r/p/s): ')
if user_input in menu_options:
break
else:
print()
print('OPTION NOT AVAILABLE')
choices = ["rock", "paper", "scissors"]
choice = random.choice(choices)
print("Computer's choice:", choice)
if user_input == 'r':
if choice == 'rock':
print("It's a tie!")
elif choice == 'paper':
print('Computer wins!')
else:
print('You win!')
elif user_input == 'p':
if choice == 'rock':
print('You win!')
elif choice == 'paper':
print("It's a tie!")
else:
print('Computer wins!')
elif user_input == 's':
if choice == 'rock':
print('Computer wins!')
elif choice == 'paper':
print('You win!')
else:
print("It's a tie!")
@whole bear :x: Your 3.11 eval job has completed with return code 1.
:warning: Note: input is not supported by the bot :warning:
001 |
002 | MENU
003 | r = rock
004 | p = paper
005 | s = scissors
006 | Enter your choice (r/p/s): Traceback (most recent call last):
007 | File "/home/main.py", line 13, in <module>
008 | user_input = input('Enter your choice (r/p/s): ')
009 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
010 | EOFError: EOF when reading a line
nice
lol
are you using visual studio? Visual Studio Code would be better for python....
yes
I got visual studio and vsc
I rather visual studio
oh painful. but you can't even do ctrl + / by default
@vale scarab ๐
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
dang i hadn't talked in this server for a bit
@void forge ๐
I only know English. Sorry. ๐
A collection of groups.
Each group, akin to a house, having rooms.
This is the voice room.
A voice room.
On this server/group, we talk about Python.
We also talk about other things.
Some rooms are for talking about something specific.
Some rooms are for general conversation.
xd
@whole bear ๐
i cant talk ๐ญ
but hi
i dont meet the criteria yet ๐
๐คฃ
@whole bear ๐
now you guys god 3 ppl in here who cant speak
@rugged rooti am christian. I have to be a good person! Pls verify ๐ฅบ ๐ ๐
!voice
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@twin pond ๐
@somber heath Is my service to God not satisfactory enough? ๐ญ
@woeful basalt ๐
Some Reason i Cant't Use my Mic
Talking to co-worker, be a bit
@cosmic dust ๐
?
I Don't Meet the Requirements
can u recommend me some good voice changer
No.
ok
w did u say?
Ok But i am Unable to Turn On my Mic
I Actaully use Pycharm for Scripting
Nice
Ok Sometimes I Like to Use Idle as my Status
I Wish i can talk with my Voice
But i Can't
Yes i Think it is a Good System
That's Alright
I Understand That
I Like How The Way You Talk
Your Welcome
Hi
I Want to Really Learn Python i am just Learning Python
Oops Mistake with my Grammer
When i Can Talk can Someone Teach me Python
I'm always happy to help with Python. Is there something specifically that you're stuck on?
Or just needing help getting started
!resources I typically recommend "A Byte of Python". https://python.swaroopch.com/
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
That's the link to A Byte of Python proper
And the bot is linking to a big ol' list of resources we have on our site
@ocean galleon ๐
Wow so Much to Read Maybe i Need to Follow the Tutorial
hello!
Hi Pain
can't use voice chat just yet
That kind of is a tutorial
Ok
You can just jump to the Installation chapter
Ok
i'm learning to code just to automate the boring stuff at my work
Im going through it right now. its excellent for beginners
I Could Not Install Python i Can't find the Application on my Operating System
Automate the boring stuff book is aimed for people who never programmed before and not for (people who are into programming in general) to make your life easier at work
Ok
@naive hedge ๐
'Row %s, Column %s is %s' % (c.row, c.column, c.value)
f'Row {c.row}, Column {c.column} is {c.value}'
!e py a = 1 b = 'abc' print(f'{a = }, {b = }.')
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
a = 1, b = 'abc'.
songs = ['Take me back to Eden', 'Alkaline', 'Ascensionism']
f"This is the playlist: {", ".join(songs)}"
songs = ",".join(['Take me back to Eden', 'Alkaline', 'Ascensionism'])
Python Enhancement Proposals (PEPs)
I converted an article to a video.
Check out this promo for the SpeechRecognition module in Python ๐
croc wearing crocks, nice
What's the purpose of this.
Are you making some youtube video ?
to remind you what was possible, no I'm not making yt videos
Anyways i will Get off the Voice Chat Channel
have fun in the real world
Converted using python ?
i don't know what kapwing uses, but it would be a fun project to try that with python
hi
@somber heath if you're going to make a game
would you make it in python
or C++
or JS
?
Doesn't matter, whatever you feel most comfortable in
Do you need fast?
and python is really easy
idk
Python is fast.
not really
C++ is faster.
btw does python has a good 2d/3d physics library?
or smth like that
There are scientific libraries. I don't know about physics, specifically.
oh
This isn't a problem, all of the heavy lifting will be bound to some low level program anyway
@rugged root #ot0-psvmโs-eternal-disapproval message
Isn't there some urban legend about licking envelopes ๐ค
@stuck sun What's your question?
๐
I know of it, yeah
For the americans: college means last two years of high school
so that is a guy in this sever called shiny diammond he chat me for know me be cuz in my perfile in discord we have the same severs. the python and other in inglish and he came to me mak
making* question about if im proggraming
so
he said its hard to begginer and etc and he can help me taking my account and if he get a job in my upwork account he gonna give me 10%
did you guys get any that like that
@rapid crown
make them play minesweeper
that's the same scammers
can i show my screen and send some screen shots ?
Screensharing doesn't help for the report
can you guys delete everting i said in this chat after ?
You're able to
I try not to delete messages of others unless it's something that needs to be for moderative reasons
I've been doing isometric exercises lately ๐
Isometric?
Like, planks and wall-sits.
They're supposed to be good for lowering blood pressure ยฏ_(ใ)_/ยฏ
im just saiyng in case of the scammer see this chat
You can delete the messages yourself if you want.
so can you guys do something about this guy ?
thanks
A "Polish joke" is an English-language ethnic joke deriding Polish people, based on derogatory stereotypes. The "Polish joke" belongs in the category of conditional jokes, whose full understanding requires the audience to have prior knowledge of what a "Polish joke" is. As with all discriminatory jokes, "Polish jokes" depend on the listener's pr...
ye but i cba
ยฏ_(ใ)_/ยฏ
https://developer.intuit.com/app/developer/qbo/docs/workflows/run-reports Their SDK coverage/ REST API endpoint support is weird
To whoever it was that I was talking about the one kind of REST query I couldn't remember, it was PUT
Like it was mentioned, but I don't see it very often
!pypi future
Weird
What's interesting is no release since 2019 so they gave up
asus rt-ac68u
Anatel UniFi U-6 Lite
Thinking
So two options
First option, you might be able to set your router (the ASUS) to a repeater mode and just have that as your primary access point, only using the other device as the line into your place.
Other option is asking them directly if they can just have your router's MAC added to the whitelist
But given the access point they're forcing you to use, you don't have a lot of options
brb
k
the annoying thing is, they have a switch via which the unifi accesspoint connects, but I can't connect my own device to it either because of the same issue
Well no, it's a managed switch
Which is important that they do it that way. Gives them more control to keep everyone's network separate
Which is likely why they want you to use only their access point
well, I wish they'd provide one with ethernet ports
oh well
That'll at least give you the ethernet ports
true
!stream 152515077512232960
โ @quasi condor can now stream until <t:1695921776:f>.
!stream 181496379816935424
โ @gilded rivet can now stream until <t:1695921781:f>.
@rugged root โค๏ธ
delicious
@rugged root i can help you.. probably. Is it a large XML dataset?
!pypi rsa
!pypi chess
!doc re
Source code: Lib/re/
This module provides regular expression matching operations similar to those found in Perl.
Both patterns and strings to be searched can be Unicode strings (str) as well as 8-bit strings (bytes). However, Unicode strings and 8-bit strings cannot be mixed: that is, you cannot match a Unicode string with a byte pattern or vice-versa; similarly, when asking for a substitution, the replacement string must be of the same type as both the pattern and the search string.
"worst part of Erlang"
(Erlang docs are in XML)
!d pathlib.Path.glob
Path.glob(pattern)```
Glob the given relative *pattern* in the directory represented by this path, yielding all matching files (of any kind):
```py
>>> sorted(Path('.').glob('*.py'))
[PosixPath('pathlib.py'), PosixPath('setup.py'), PosixPath('test_pathlib.py')]
>>> sorted(Path('.').glob('*/*.py'))
[PosixPath('docs/conf.py')]
``` Patterns are the same as for [`fnmatch`](https://docs.python.org/3/library/fnmatch.html#module-fnmatch), with the addition of โ`**`โ which means โthis directory and all subdirectories, recursivelyโ. In other words, it enables recursive globbing...
!man grep
ยป mutable-default-args
ยป if-name-main
Here is a 350$ Cable @gentle flint
Jameco Electronics is a leading electronics store with over 45 years in business selling electronic components, parts, and kits at competitive prices. Shop now.
cool
noice
:incoming_envelope: :ok_hand: applied timeout to @nova dove until <t:1695925770:f> (10 minutes) (reason: newlines spam - sent 11 consecutive newlines).
The <@&831776746206265384> have been alerted for review.
is this it?
@gentle flint
i want to speak to your manger๐คฌ ๐ก
lmao
?
i want to speak to your manger ๐คฌ
Bot auto muted because of spam, yes
Mr. Hemlock is the manager LOL
so how are you doing manger๐คค ๐ณ ๐ ๐
The Elo rating system is a method for calculating the relative skill levels of players in zero-sum games such as chess. It is named after its creator Arpad Elo, a Hungarian-American physics professor.
The Elo system was invented as an improved chess-rating system over the previously used Harkness system, but is also used as a rating system in as...
gtg boys
it's all about Glicko-2 now
fr?
it's basically elo with some extra variables to tack onto players
definitely a more accurate spread results from this
idk I mostly just adjust the resume I already have
look at that beautiful bell
Free online chess server. Play chess in a clean interface. No registration, no ads, no plugin required. Play chess with the computer, friends or random opponents.
mean and median both ~1500
iirc chess com doesn't have a weekly distribution, so we can't get good data and are stuck with possible dead accounts weighing their all time distribution
on chess com, you'll see that the ratings are highly skewed left
not bad
i can't view the curve on mobile, but you should be able to find it under stats
ill have to try it
looks like this, but i found this on a recent forum so it may be slightly dated
both don't let you go below 100 rating iirc. but chess com has way more active players at low ratings
so "average" is like anything from 600-800
true but this distribution is a result of the rating system chess com uses lol
Join the challenge or watch the game here.
HOl up LOL
gg lmao
chess.com players just trash confirmed?
maybe 2 is way better than 1 lmao
8BitDo is an innovative technology company founded in 2013 that specializes in gaming peripherals. Our vision is to use the latest technology and distinctive design to create a range of high-quality, high-performance, high-compatibility, high-portability and affordable game controllers for gamers.
gtg go byee !
true. but ye glicko is a bit different from glicko-2. also from what i recall, chess com asks you to estimate your own rating which kinda skews things. lichess puts anyone new at 1500 with 10 games with a wide sigma before setting an actual rating
this helps the distribution stay more uniform
also we can't know if many of those accounts are dropped because the rating went low
it would be much nicer if we has weekly data from chess com to compare against. id imagine the two would look much more similar, with chess com just being lower by maybe 300 points idk
An individual between 18 and 21 years of age may acquire a handgun from an unlicensed individual who resides in the same state, provided the person acquiring the handgun is not otherwise prohibited from receiving or possessing firearms under federal law. A federal firearms licensee may not, however, sell or deliver a firearm other than a shotgun or rifle to a person the licensee knows or has reasonable cause to believe is under 21 years of age.
way the fuck are we talking about guns
๐
uwu
@rugged root people are talking about guns in vc
@left leaf unmute me
@alpine crow
@alpine crow

Guys play nicely please ๐
Ok fair enough
Btw, feel free to ping the mods if someone's causing a disruption.
@rugged root
wrong gif
@whole bear stop annoying the others please, or you'll be server muted.
im not
perma ban or i leave
Alright. What were you guys talking about?
guns
@stuck furnace @left leaf is being super toxic
@left leaf
perma ban me or him
!tempvoicemute 1045011821838475334 1d Constantly interrupting and being a disruption in voice chat. Please be more considerate in future.
:incoming_envelope: :ok_hand: applied voice mute to @whole bear until <t:1696023764:f> (1 day).
If you want to appeal, DM @rapid crown
your the reason im haveing a bad day
Me explaining proper voice chat behavior and you getting the voice mute are two sides of the same coin
Both were going to happen regardless.
i will go to bed, bb
hope you have a good night
now men >?
Sometimes companies like that actually want stricter regulations, because it creates more of a moat for them.
I.e. it makes it harder for competitors to emerge.
@visual mango you've got a bit of an echo.
I'm heading off too ๐
ay @rugged root back in admin
||btw how you get that moderation alumni badge?||
@static quiver ๐
?
hello @somber heath ๐
@dense ibex https://noyaml.com/
Database normalization:
brb
Hi ^^
i have a question
Hmm?
i have pycharm is there any other dowlands just like it
Visual Studio Code.
I see people recommending Thonny.
There's Spyder.
IDLE is Python's native IDE. IDEs being what we're talking about.
ok thx brother ill see if it works for me
@somber heath srry to bother u agian but i do have python.org downlanded do i keep that for thonny
You probably point to the installation of Python from within Thonny.
ok
I don't use it so I don't know specifics.
ok thx agian
@warm warren ๐
guys i have a question about pytube, how do I continue downloading even after one video fails due to age restrictions
All graphics are made up of 8x8 pixel tiles. Large characters like Mario are made from multiple 8x8 tiles. All the backgrounds are also made from these tiles. The tile system means less memory is needed (was expensive at the time) but also means that things like bitmap pictures and 3d graphics arenโt really possible. To see all the tiles in a game, download Tile Molester and open up your .NES file. Scroll down until you see graphics that donโt look like static. You can see that small tiles are arranged by the game to make large images.
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)
@buoyant orchid
@unreal dust ๐
Battlefield 1 @wind raptor
goodbye, sorry that i was eavesdropping a little bit :o
You're entirely welcome to.
@somber heath I promise next time I'll have a topic to talk about
You are released from that promise.
Why tho?
Whimsy.
๐
I'm happy to chat.
I just don't want you to feel like you're under any obligation to generate it.
Least of all for my sake.
@somber heath imagine being offline for 48h
Pardon?
Badly as in, you're having a lot of trouble, or badly urgent?
urgent as far as I know
What big issues?
I was busy with it and looking at the new decorations then this pops up
I cant access it on my main pc
I wouldn't worry about it.
Iv uninstalled it completely as well
It's likely temporary.
I can use discord tho
You needn't have done that.
you htink its gonna go away?
I think that's likely.