#voice-chat-text-0
1 messages Β· Page 199 of 1
yeah thats they key and when you put it in it outputs the other value
so like
!e
my_dict = {'key':'some text'}
for key in my_dict.keys():
print(key, my_dict[key])
!e
my_dict = {'key':'some text'}
for key in my_dict.keys():
print(key, my_dict[key])
@tranquil jasper :white_check_mark: Your 3.12 eval job has completed with return code 0.
key some text
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
β!voiceverify
i dont get it the why i want lol
like how does it work?
if you want like the technical way of it im pretty sure its just a hash array
nah you're good
look up hash array and im pretty sure thats all it is, its a pretty cool topic and you can code one yourself
hash table
sorry not hash array
its in java
https://www.youtube.com/watch?v=knV86FlSXJ8 this explains the concept pretty well
Hash tables in 4 minutes.
Code: https://github.com/msambol/dsa/blob/master/data_structures/hash_table.py
Sources:
- Introduction To Algorithms, Third Edition (CLRS) [https://www.amazon.com/Introduction-Algorithms-3rd-MIT-Press/dp/0262033844]
- https://wiki.python.org/moin/TimeComplexity
- https://stackoverflow.com/questions/2061222/what-is...
you in college rn?
yeah data structures and algorithms are pretty cool i enjoyed the class i had for it
can you call this
my_dict = {'key':'some text'}
for key in my_dict.keys():
print(key, my_dict[key])
from another module
wdym
!e
my_dict = {'key':'some text'}
for key in my_dict:
print(key, my_dict[key])
@tranquil jasper :white_check_mark: Your 3.12 eval job has completed with return code 0.
key some text
and now the message im recieving is one key in one line
oh yeah i didnt realize it worked if you did it that way
not like this
is printing like this
p r i n t ( " { p l a y e r [ ' H p ' ] } / { p l a y e r [ ' M a x H p ' ] } " )
lol
why?
are you having it print each individual character
if you do it that way you have to do
print(char, sep='', end='')
because this thing
`output = ''
for x in xd:
output += xd[x]
print(output)`
is doing something like thisvalue + thisvalue
as strings?
is your print in your for loop?
thats why isnt taking different lines
a = "Hello"
b = "World"
c = a + b
print(c)
like this
im confused on what you're asking
are you asking why it doesnt print on separate lines?
yeah like the other code
okay let me show you
oh wait
import randomshit
xd = randomshit.data
for x in xd:
print(xd[x])
!e
enemy = {'hp':100}
print(enemy["hp"])
@tranquil jasper :white_check_mark: Your 3.12 eval job has completed with return code 0.
100
this won't work
you should do
for x in xd:
print(x)
or
for x in range(xd):
print(xd[x])
the first is better
Ye
goodmorning
@cobalt sphinx π
Not qalified to speak
less than 50 messages
real
la la
so what projects did you guys do recently?
I made an air piano last week with opencv
and i am fiddling w pyspice
21 messages down 29 to go
beep boop zig zag
ill come back later i guess
what do i need to get started with python
@somber heath hi)
when i open python 3.120 it justs opens a cmd thing
@signal monolith π
hello
Morning everybody
I need to voice verify
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voiceverify
@tepid viper π
when i open python 3.120 it justs opens a cmd thing
You have to write python code in a .py file and then in your command prompt or cmd you type python filename.py and it will run the code that you wrote in that file
use idle
python-idle
whats that
or vscode
Text editor
does anyone have minecraft I will code you any mod you would like?
im not im opening it
aint minecraft like java script code
type in search bar python idle in ur task bar
so is it possible like coding a mod exact like python and still work?
and
open it
yea and now
Write code
Techwithtim goes crazy for learning python
how do i write a ip logger code
Like to a server?
@true ridge @fading crow π
You may need to expand upon this.
Yes for sure
like testing
@obtuse geyser I sent you a friend request
then start learning code bro
how
Techwithtim
idk where to start
Watch videos and learn
whats techwithtim
YouTube channel
@mint sun π
i don't have permission to use the mic π€ !!!
This python course is designed to take you from beginner to pro in the python language. This python course is designed to teach you everything you need to know about python. It assumes no prior knowledge and is a perfect python tutorial for beginners. This course is split into 4 main sections: Beginner Python Programming, Object Oriented Program...
!voice
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
is it like 5 hours long
@final quail π
ill watch the 1 hour python for beginners
@obtuse geyser remember to use documentation when u got stuck
hi
@rigid nacelle π
Hey
@solid sky π
welcome
Thenks my english is bad
@whole bear @dusk spire π
i want start study now python
Catastrophically bad?
but now study hard
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
can you help me for something
i know python
but i am bad at logic making
i am solving this problem which is low difficulty level
OK
but making my confidence low
I Understande
so my problem is how to make a loop in numbers in order
wtf that mean
make a loop in numbers in order?
not like 1, 10, 15, 18, 84
its print("1234")
A LOOP
watch a 12 hour python tutorial what im bouta do
for i in range(0,n):
print(i)```
Thanks
@solid sky
What
i select all? @tepid viper
no problem
see this n = 100 for i in range(0,n): print(i)
one is correct
@solid sky
it is not a loop
But Thank you for helping me
Which one should I start studying first?
@vocal basin i dont think you understand how much time you just saved me it gets all of the html within like 2 mins for like 52k links and now i just need to speed up parsing it
what u mean by not a loop
learn from basics
algos
?
out of those id start with algs and learn
A loop is a infinite type of numbers if that is making sense to me and you
could you elaborate?
its a loop
in coding terms at least, its a loop
wtf
listen dude
there is 3 types of loop
for , while , do while
ong
Not in Python
if u know the starting value , ending value , and steps then use for loop
sΒ―_(γ)_/Β―
Which honestly is kind of a shame
generally
Sure sure
Yeah but it's not as clean
fax
Still people use do while loop
looks like i start a war for loops
lmao
I'm sure there's a pep for it that's been rejected
does it say why it was rejected?
Python Enhancement Proposals (PEPs)
It does in the notes near the bottom
There's an email chain
!e
a = 0
while a < 8:
print('this while loop go crazy!', end = '')
a+=1
@tranquil jasper :white_check_mark: Your 3.12 eval job has completed with return code 0.
this while loop go crazy!this while loop go crazy!this while loop go crazy!this while loop go crazy!this while loop go crazy!this while loop go crazy!this while loop go crazy!this while loop go crazy!
a = 0
while a<100:
print('i am crazy!')
a+=1
!source[a = 0
while a<100:
print('i am crazy!')
a+=1]
Hi
numpy.lib.stride_tricks.sliding_window_view
@ancient rover If you're wondering why you can't talk, check out the #voice-verification channel. That'll tell you what you need to know about the voice gate
!e ```py
class MyClass:
def new(self, *args, **kwargs):
print(args, kwargs)
super().new(*args, **kwargs)
MyClass()```
@somber heath :x: Your 3.12 eval job has completed with return code 1.
001 | () {}
002 | Traceback (most recent call last):
003 | File "/home/main.py", line 6, in <module>
004 | MyClass()
005 | File "/home/main.py", line 4, in __new__
006 | super().__new__(*args, **kwargs)
007 | TypeError: object.__new__(): not enough arguments
class class_name:
def __new__(cls, *args, **kwargs):
statements
.
.
return super(class_name, cls).__new__(cls, *args, **kwargs)
py -3 -m pip install -U disnake
anybody have any methods to speed up parsing around 52 thousand html files
not files but just the text from requests
you can send link python
for study
beautiful soup?
yeah
multithreading
like through concurrent futures?
what are you parsing?
html
!resources We've got a bunch on our resources page on our site. https://python.swaroopch.com/first_steps.html A Byte of Python (the link I have right there) is a good one
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
from sites that allow webscraping?
yes
most sites do not allow it
Or prefer you use their API
well if you want to drop it we can drop it
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
It depends what and where is being scrapped
indeed
So we're not against it being talked about, but it helps if we know what exactly we're helping with
Vast majority of people just need work queues
RabbitMQ is gold standard
well i was more looking just for like common ways to speed up having to parse a lot of files in a list in general ive been messing around with selenium bs4 and requests to kinda learn about it
Cloud based people just use cloud native ones
are you running @dry jasper ?
?
I'm considering making a ratelimiter wrapper for aiohttp
Why do I keep doing this to myself
To be able to set rate limits and have aiohttp follow them?
Yep, but have it so that you're not having to wrangle both libs
Example being: https://github.com/JWCook/requests-ratelimiter
Interesting
There's that one for requests
Tell Hemlock he shouldn't do this. PLEASE
And you just make requests or sessions directly from that. It handles passing stuff to requests itself
PLEASE FOR THE LOVE GOD, PLEASE
https://pyratelimiter.readthedocs.io/en/latest/ That's the underlying lib for requests-ratelimiter
@dry jasper
DevOps Engineers: Build Engineer/Release Engineer/Site Reliability Engineer/Random Script
"You aren't gonna need it" (YAGNI) is a principle which arose from extreme programming (XP) that states a programmer should not add functionality until deemed necessary. Other forms of the phrase include "You aren't going to need it" (YAGTNI) and "You ain't gonna need it".Ron Jeffries, a co-founder of XP, explained the philosophy: "Always imple...
columbian
HA
MIAMI VICE
my door bell rang and I opened, it was a few pretty women representing Jehova's Witnesses asking me if I think a world government could bring upon world peace.
I told them I think it's a bit more complicated than that.. also I'm not trying to get a Nobel peace prize..
I took their flyer and wished them a nice day
guys i have a presentation coming for my uni where i have to present a software architecture for a student management portal, do you know any tool that can help me with creating good informative diagrams for classes and interfaces, database schema and similar components
any UML editor I guess..
i know about draw.io and excalidraw, any others i can test out?
excalidraw is too free-form, but draw.io has UML entities you can use
Hiii
hey
@rugged root I'm here with another interesting underhood questionπ₯² π π
...daddy?
When we assign a value to a variable How does Python handle it? I mean how does it know that it's a float or integer
deez nuts
it guesses
numbers become an int
numbers with a decimal become a float
Okay but How?
what does it do to detect the type?
.
ππ»
The Dutch have a saying: βGod created the world, but the Dutch created the Netherlandsβ. Today we will see why.
Patreon: https://www.patreon.com/AveryThing
Social Media
Discord: https://discord.gg/JYCYPvqba6
Reddit: https://www.reddit.com/r/HistoryScope/
Twitter: https://twitter.com/ScopeHistory
Instagram: https://www.instagram.com/offic...
So nice to drop in, thank you!
ROFL
God created the world, but the Dutch created the Netherlands.
It just gives me cool things, cool stuff, meaning like.. if it has an AI built into it
@whole bear
lol
yes I did
it helps me multi-task
wtf is he talking about
Kapsalon ([ΛkΙpsΙlΙn]) is a fast food dish created in 2003 in the Dutch city of Rotterdam, consisting of a layer of french fries placed into a disposable metal take-away tray, topped with dΓΆner or gyro meat, covered with slices of Gouda cheese, and heated in an oven until the cheese melts. Then a layer of shredded iceberg lettuce is added, dress...
!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.
!d str.replace
str.replace(old, new[, count])```
Return a copy of the string with all occurrences of substring *old* replaced by *new*. If the optional argument *count* is given, only the first *count* occurrences are replaced.
s_word.replace(" ","")
!e
s_word = l e m o n
t = lemon
if t == s_word.replace(" ", ""):
print("excellent")
@dry jasper :x: Your 3.12 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | s_word = l e m o n
003 | ^
004 | SyntaxError: invalid syntax
!e
s_word = "l e m o n"
t = "lemon"
if t == s_word.replace(" ", ""):
print("excellent")
@dry jasper :white_check_mark: Your 3.12 eval job has completed with return code 0.
excellent
print(" ", end="")
for i in range(len(s_word)):
print(v[i], end="")
This is CS50, Harvard University's introduction to the intellectual enterprises of computer science and the art of programming.
HOW TO SUBSCRIBE
http://www.youtube.com/subscription_center?add_user=cs50tv
HOW TO TAKE CS50
edX: https://cs50.edx.org/
Harvard Extension School: https://cs50.harvard.edu/extension
Harvard Summer School: h...
its live
<-----
print(v, sep=" ")
@pulsar light you're writing too much code, way too much code.
you should be spending time reading books and solving small exercises.
#pedagogy message
yes i guess so
im learning with coding
best way to learn
it's how you learn
by writing code
Nothing wrong with writing code sometimes
you can learn by reading or writing. the latter is too expensive.
in what world do you live in where hand-on experience is more expensive than a book?
I disagree. The best way to learn is to read existing code and read the descriptions of small programs so you can understand them. You should only be solving small exercises in a book.
no clearly the best way to learn is to make chatgpt do it for you /sarcasm
hahaha
@pulsar light check the books #pedagogy message
// Kotlin class syntax
class Person{
// Properties
val name:String = "Jonathan"
val age:Int = 35
// Methods
fun walk(distance: Int){
println("Person walk ${distance} distance")
}
}
Very much easier than Java
.
!e
s_word = "l e m o n"
t = "lemon"
if t == s_word.replace(" ", ""):
print("excellent")
!e
s_word = "l e m o n"
t = "lemon"
if t == s_word.replace(" ", ""):
print("excellent")
@willow light :white_check_mark: Your 3.12 eval job has completed with return code 0.
excellent
!e
s_word = "l e m o n"
t = "lemon"
assert t == s_word.replace(" ", ""), "oops"
@willow light :warning: Your 3.12 eval job has completed with return code 0.
[No output]
!e
s_word = "a p p l e"
print(s_word.strip())
what he typed is a p p l e
@willow light :white_check_mark: Your 3.12 eval job has completed with return code 0.
a p p l e
.
import re
pattern = re.compile(r'\s+')
word = re.sub(pattern, '', s_word)
something like this perhaps
I would replace
"apple"
with
"a p p l e"
and then compare directly with user input
apple
cat
bat
_at
car
cat
c a t
to cat because cat = sword and c a t != s_word
I disagree with your method of learning
why
you aren't being hurt by someone other than you learning in a way that's different from your own
You should read more code than you write
What works for you doesn't necessarily work for everyone.
Now if only apple fans could learn that lesson.
only apple fans
gamer synonyms
v = [1, 2, 3]
print(v)
print([1, 2, 3])
print(*v)
print(1, 2, 3)
!e
def x(a=1, b=2):
print(a, b)
y = {'a':3, 'b':4}
x(**y)
@gentle flint :white_check_mark: Your 3.12 eval job has completed with return code 0.
3 4
!e
a={'a':3,'b':4}
print(*a)
@karmic obsidian :white_check_mark: Your 3.12 eval job has completed with return code 0.
a b
positional arguments
def x(a, b):
pass
keyword arguments
def x(a=True, b=False)
pass
this one
!e
print(list({'a': 3, 'b': 4}))
@gentle flint :white_check_mark: Your 3.12 eval job has completed with return code 0.
['a', 'b']
!e
a=['a','b']
print(*a)
@karmic obsidian :white_check_mark: Your 3.12 eval job has completed with return code 0.
a b
As long as the most compute-intensive part of your code is optimised (e.g. written in a lower-level language), and you use Python as the glue code, it can be fairly fast.
yeah I get that point Alex but why* do ppl say that it's slow?
It is, relatively speaking. If the same code written in Python and C, the C program will tend to be faster (than running the python program with cpython).
For every line of python code, there tend to be many lines of machine code executed.
@karmic obsidian You might find this lecture interesting: https://www.youtube.com/watch?v=o7h_sYMk_oc
MIT 6.172 Performance Engineering of Software Systems, Fall 2018
Instructor: Charles Leiserson
View the complete course: https://ocw.mit.edu/6-172F18
YouTube Playlist: https://www.youtube.com/playlist?list=PLUl4u3cNGP63VIBQVWguXxZZi0566y7Wf
Professor Leiserson introduces 6.172 Performance Engineering of Software Systems. The class examines an e...
hey thanks @stuck furnace
They write some code in python (for matrix multiplication), then write it in C and optimise it.
By the end, it's 50000 times faster than the python version π
I was wondering one more thing tho...
let's say I write a code for linear search ....
in python and C....
and both have same time complexity but the great thing about when we are talking about "TIME" is it's about time that it takes to execute ...
and time compelxity is about number of operations
With time complexity, you ignore constant speed-ups.
btw idk what is constant speed-ups
You just care about how the time grows as the size of the input grows.
yeah yeah that's what time complexity is
E.g. one implementation of an algorithm could be 100 times slower than another but still have the same time complexity.
can you give me an example for that
E.g. linear search takes an amount of time proportionate to the length of the list being searched, in the worst case.
It has O(n) time complexity.
But two different implementations of linear search might take different amounts of time to complete for the same input.
Just running them on different computers will yield different computation times.
Nuuuuuuuuuuuu
I was wrong
I can get into the Windows insider, but not the Microsoft 365 insider
If you can, please support the Channel's new project: https://www.patreon.com/101Arabic
Links for previous lessons:
Lesson 1 ΩΩ - Ψ‘ (glottal sounds): youtu.be/Xgzu8DMNNCQ
Lesson 2 Ψ - ΨΉ (pharyngeal sounds): youtu.be/Tje42Lts_XA
In this lesson you'll learn how to properly pronounce the trickiest sound in Arabic /Ω/.
You'll also learn the ne...
@karmic obsidian this explains it better: https://www.khanacademy.org/computing/computer-science/algorithms/asymptotic-notation/a/asymptotic-notation
multilingual is good for coding , math , life in general
coding and math?? how? just curious
multi languages creates plasticity , easy to learn in general - what ever you do
The voiceless uvular plosive or stop is a type of consonantal sound, used in some spoken languages. It is pronounced like a voiceless velar plosive [k], except that the tongue makes contact not on the soft palate but on the uvula. The symbol in the International Phonetic Alphabet that represents this sound is β¨qβ©, and the equivalent X-SAMPA symb...
wondering about using python front to talk to C , to do fast math on a raspi 3B+
guessing Cython
what kinds of math are you doing
math for graphics - pygame - i run it on W10 and ubuntu on raspi
even if you go into linear algebra you still wont see any perfomance increase if you are using a library such as numpy
https://paste.pythondiscord.com/SEBQ
im sorry if i interupt u guys
can u check my code out
You'll likely be fine just doing it in python
yes , most stuff in python optomized already
and you are experiencing performance issues?
likely ineffifient pygame coding - just learning and getting my lumps
using raspi as a ether , usb , wifi - cheapo interface for a MCU project
i really should make aflowchart
An algorithm can affect your codes performance exponentially if it's particularly ineffective, a different lower level language will affect your codes performances with a constant difference (vaguely vaguely, there is much more nuiance to this). My point is you can make a impressive improvements by writing more efficient algorithms rather than writing in a different language
thanks @stuck furnace
python is within my window of speed efficiency for now , there must be faster stuff than pygame
GODOT ?
Godot is just different and not too comparable to pygame
pygame is more of a graphics library and Godot is a game engine
hmmm ok
If I were to go an write a game right now I would choose Godot
!e
meats = ["ham", "pork", "beef"]
if "ham" in meats:
print("Yep, it's there")
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
Yep, it's there
It's really annoying to apply to all of the places, some are on UCAS some you apply through their website
!e
meats = ["ham", "pork", "beef"]
if "ham" in meats:
print("Yep, it's there")
if "chicken" in meats:
print("Chicken is in the meats")
else:
print("Chicken is not in the meats")
@terse needle :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | Yep, it's there
002 | Chicken is not in the meats
pondering - old dual core ( 2 Ghz ? ) , 3 Gig mem , Dell Inspiron 1525 - what ubuntu or mint or what , so i can use python and do pyserial with raspi3 , sluggish Dell....
Older versions used Xfce
TIL Alpine used to have GUI
https://wiki.alpinelinux.org/wiki/Desktop_environments_and_Window_managers
I think Lemon said he would give people references if they need them π
ask chatgpt for advice instead of writing everything for you, I guess
@sage swift
nah ask the discord Clyde ai bot
harder to get access to + unclear policies
!e ```py
def hash(string):
total = 0
for char in string:
total += ord(char)
return total
def contains(hash_table, string):
bucket = get_bucket(hash_table, string)
return string in bucket
def add(hash_table, string):
bucket = get_bucket(hash_table, string)
bucket.append(string)
def get_bucket(hash_table, string):
return hash_table[hash(string) % len(hash_table)]
def new_hash_table(num_buckets):
hash_table = []
for _ in range(num_buckets):
hash_table.append([])
return hash_table
ht = new_hash_table(4)
add(ht, 'ham')
add(ht, 'pork')
add(ht, 'beef')
print(contains(ht, 'ham'))
print(contains(ht, 'chicken'))
print(ht)
just ask , instead of asking to ask -- how to ask ChatGPT - justa brain fart
@stuck furnace :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | True
002 | False
003 | [['pork'], [], ['ham', 'beef'], []]
dont you need to do
def get_bucket(hash_table, string):
return hash_table[(hash(string) % (1 << len(hash_table))]
?
no, that wouldn't work almost at all
for most values, (1 << hash(string)) % len(hash_table) would either be zero (if num_buckets is a power of 2) or raise an error (negative shift)
Are you thinking of a bit set?
purpose of hash_table[something % len(hash_table)] is to reduce something to a value that's a valid index
i just learnt about simple hash tables recenently so idk much
this is isolated from a notion of a hash table
!e
values = [0,1,2,3,4]
print(values[1001 % len(values)])
print(values[1005 % len(values)])
print(values[1009 % len(values)])
print(values[1013 % len(values)])
print(values[1017 % len(values)])
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 1
002 | 0
003 | 4
004 | 3
005 | 2
The Open University in WalesβΒ Applied Software Engineering Degree Apprenticeship programme equips apprentices with the knowledge, skills and behavioural characteristics required to be a competent software engineering professional. The programme provides a broad foundation in the fundamental technologies and techniques of computing and the issues...
here we have a differentiation between a university and an institute
former being more general
@whole bear no, it's not American
To be fair, it's helpful for stem students to have to take some 'communications intensive' courses.
A lot come out of university with zero communications skills π
I think stem/non-stem differentiation is overused
The British system is extremely different from the American system in that in the UK you are directly admitted to a specific degree subject and you only do that for 3 years
So, even British universities are much more focused
there are many places other than US with same system
Yes, but it is very characteristic of the US, and Europe tends to be more like the UK in that regard
South America too
for letter in user_inp:
i see
!e
user_input = "1234"
print(user_input[1])
print(list(user_input))
@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | 2
002 | ['1', '2', '3', '4']
@pulsar light btw strings themselves are iterable
that exatly it
and indexable
so you dont have to turn it into a list unless you want to modfiy them
that too
for letter in word: is common
can u explain iterable to me
i actually forgot it
you can do a for loop on it bassically
wait i rmmber now hahaha
there is a pinned message in #python-discussion about iterable/iterator/generator, I think
!e
word = 'hello'
word[0] = 'b'
@toxic arch :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 | word[0] = 'b'
004 | ~~~~^^^
005 | TypeError: 'str' object does not support item assignment
Koalafications
!e
word = 'hello'
word = list(word)
word[0] = 'b'
@toxic arch :warning: Your 3.12 eval job has completed with return code 0.
[No output]
The off-center mustache is cracking me up
can someone help me out
Back later
our god is out?
S-lang
just had tagliatele + tortellini + rice + chicken breast π + π + π
this is my nocode emoji-based text version of Instagram where I'm telling everyone what I eat
In line 42 u get input as a list and check it in line 46 that if your input list exists in list 's_word'
it depends s_word contains lists or strings
let me show you
if user input = "elephant"
we have ---> user_inp = [elephant]
and --------> s_word =["elephant","zebra"]
this is wrong
you can fix it in 2 way:
1- set your input as string
2- set s_word variable list of lists ----> s_word =[[elephant],[zebra]]
@summer kettle π
@coral prawn π
@opaque coral π
Canβt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
now im fine
If u found good one please share π
Hopefully by then I'll hit the 50 messages mark
Where we all from btw
I'll guess
UK?
i live there
Chicago
Ahahaha
Did I get that right?
But the US
Oh boy
I got that all wrong
you're giving the wildest clues out here
Australia
hint?
Cheerio mate
hello guys
Yeh
austin powers
@split drum π
hello
I got a class in 10 min - I guess I'll have to catch up with you later
Why do programmers always mix up Christmas and Halloween?
Because Oct 31 == Dec 25!
@wind raptor holala
how do we link this
to discord
@wind raptor are you here
kk
@wind raptor give me a begginner level js project
like just using js to create the backend of a webpage
and basic css and html for frontend
react is what i have looked into
but haven't used
any of those
@wind raptor what was your ques
may i have it once again
ok
going to learn express
see ya later
how hard would it be to write a server framework
what fastapi uses internally
i think uvicorn
yes a http server
like the spec is just transfer bytes across a socket
do you know sxhkd
its a linux software for
keybinds
how to get stream perms
hi
!stream 939196353362419722
β @whole bear can now stream until <t:1697119243:f>.
just wait for some years those exhaust vents are going to be vanished from laptops
At CES 2023 Gordon had a chance to chat with Seshu Madhavapeddy, the Founder and CEO at Frore Systems, about the company's solid state cooling device - called AirJet. In this interview Gordon asks about how AirJet works and the practical benefits of solid state cooling in devices like laptops and SSDs. Could this be the future of cooling?
Watch...
@warped orchid π
!stream 275350011619966977
β @wind arrow can now stream until <t:1697120936:f>.
Thanks
@somber heath nice voice acting
No problem
starlette?
Thanks for watching!
Animators:
Jerb: https://twitter.com/jerbjpg?s=20
Vudujin: https://twitter.com/Vudujin
DublyMike: https://twitter.com/dublymike?s=20
Leo "Awez" Chenevert - https://mobile.twitter.com/aweztube
Storyboard:
Jake Smith: https://www.instagram.com/dead_gremlin_comix/
BG Artist:
Kuo Yang: https://www.artstation.com/kuoya...
right
what
(uvicorn is separate; an ASGI server runner rather than a framework/normal library)
I just realised "ASGI server" might be slightly lexically incorrect because "server server"
@wind arrow What are you working on?
Suddenly an awkward silence in voice chat
Um. Just an audio editor + some sort of framework
G'evening
How's it going
continuing the grind
what command waas this
tokei
rust via .NET?
lol
I'm down for it
my programming language
π
hi
I bought a Thinkpad and installed NixOS on it π
i finished it haha
Yeah that was my experience. I gave up
Looks at name color yep, that tracks
mr hemlock did u see it?
Devfile Landing Page
I don't think so.
We know someone who has
try it out (:
YAML sucks. Contribute to cblp/yaml-sucks development by creating an account on GitHub.
Xml π
programmatic configuration
!e python import pyyaml
@amber raptor :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 | python
004 | ^^^^^^
005 | NameError: name 'python' is not defined
eval()
!e import pyyaml
@rugged root :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 pyyaml
004 | ModuleNotFoundError: No module named 'pyyaml'
!e python import pyyaml
@amber raptor :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 pyyaml
004 | ModuleNotFoundError: No module named 'pyyaml'
gotta send this talking about yaml and toml
!e python import yaml
@amber raptor :warning: Your 3.12 eval job has completed with return code 0.
[No output]
!e python import yaml print(yaml.load('country: NO'))
@amber raptor :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(yaml.load('country: NO'))
004 | ^^^^^^^^^^^^^^^^^^^^^^^^
005 | TypeError: load() missing 1 required positional argument: 'Loader'
@amber raptor :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(load('country: NO', Loader=Loader))
004 | ^^^^^^
005 | NameError: name 'Loader' is not defined

!e python import yaml print(yaml.load("""country: NO"""))
@amber raptor :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(load("""country: NO"""))
004 | ^^^^
005 | NameError: name 'load' is not defined. Did you mean: 'float'?
π€£
!e
from yaml import load, Loader
print(load("""country: NO""", Loader=Loader))
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
{'country': False}
!e
from yaml import load, Loader
print(load("""country: 'NO'""", Loader=Loader))
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
{'country': 'NO'}
someone knows pycaw library ?
Wish this version caught on instead: https://hitchdev.com/strictyaml/
!e python from yaml import load, Loader print(load("""country: '12345'""", Loader=Loader))
@amber raptor :white_check_mark: Your 3.12 eval job has completed with return code 0.
{'country': '12345'}
!e
from yaml import load, Loader
print(load("""NO: NO""", Loader=Loader))
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
{False: False}
false false square
bye bye
!e python from yaml import load, Loader print(load("""version: 3.5.3""", Loader=Loader)) print(load("""version: 3.6""", Loader=Loader))
@amber raptor :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | {'version': '3.5.3'}
002 | {'version': 3.6}
!e ```python
import json
print(json.loads('{version: 3.5.3}'))
@amber raptor :white_check_mark: Your 3.12 eval job has completed with return code 0.
"{version: 3.5.3}"
Jake eagerly stepped into his new job, grateful for more experience and new challenges, craving to learn new software stacks and see what his new company had to teach him about the world of software.
They told him heβd be working on some websites, dealing with JavaScript, Node.js, JSON, and the like. It sounded pretty reasonable for web develop...
!e
from yaml import load,Loader
print(load('on:off',Loader=Loader))
@whole bear :white_check_mark: Your 3.12 eval job has completed with return code 0.
on:off
!e python import json print(json.loads('{version: 3.5.3}'))
@amber raptor :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(json.loads('{version: 3.5.3}'))
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | File "/lang/python/default/lib/python3.12/json/__init__.py", line 346, in loads
006 | return _default_decoder.decode(s)
007 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
008 | File "/lang/python/default/lib/python3.12/json/decoder.py", line 337, in decode
009 | obj, end = self.raw_decode(s, idx=_w(s, 0).end())
010 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
011 | File "/lang/python/default/lib/python3.12/json/decoder.py", line 353, in raw_decode
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/HXCJYDGTJZHNRV3ONBSNIWBACE
!e
print(__import__('json').loads('{"version": 3.5.2}'))
@whole bear :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 | print(__import__('json').loads('{"version": 3.5.2}'))
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | File "/lang/python/default/lib/python3.12/json/__init__.py", line 346, in loads
006 | return _default_decoder.decode(s)
007 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
008 | File "/lang/python/default/lib/python3.12/json/decoder.py", line 337, in decode
009 | obj, end = self.raw_decode(s, idx=_w(s, 0).end())
010 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
011 | File "/lang/python/default/lib/python3.12/json/decoder.py", line 353, in raw_decode
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/Z7JU5O52GCQ3EBUNCZDN4IW25Q
!e python import json print(json.loads("{version: '3.5.3'}"))
@amber raptor :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(json.loads("{version: '3.5.3'}"))
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | File "/lang/python/default/lib/python3.12/json/__init__.py", line 346, in loads
006 | return _default_decoder.decode(s)
007 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
008 | File "/lang/python/default/lib/python3.12/json/decoder.py", line 337, in decode
009 | obj, end = self.raw_decode(s, idx=_w(s, 0).end())
010 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
011 | File "/lang/python/default/lib/python3.12/json/decoder.py", line 353, in raw_decode
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/AMXJVNWFV6U3DZ2DS2NWEXN2FI
Listen to "Karma Chameleon" by the Culture Club, and sing along with the HD lyrics on screen!
Remember! I DO NOT own this song or the background image! ALL RIGHTS belong to their respectful owners!
Image source: https://mewallpaper.com/687-purple-night-sky-wallpaper-download-free
Culture Club YT: https://www.youtube.com/channel/UCdfnMLE8x9...
!e python import json print(json.loads('{"version":"3.5.3"}'))
!e
try: __import__('json').loads('{"version": 3.5.5}')
except e: print(e, dir(e), repr(e))
@whole bear :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 | try: __import__('json').loads('{"version": 3.5.5}')
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | File "/lang/python/default/lib/python3.12/json/__init__.py", line 346, in loads
006 | return _default_decoder.decode(s)
007 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
008 | File "/lang/python/default/lib/python3.12/json/decoder.py", line 337, in decode
009 | obj, end = self.raw_decode(s, idx=_w(s, 0).end())
010 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
011 | File "/lang/python/default/lib/python3.12/json/decoder.py", line 353, in raw_decode
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/GHG5OBCSPZDAEZOPSSAKSC6ETY
@amber raptor :white_check_mark: Your 3.12 eval job has completed with return code 0.
{'version': '3.5.3'}
id take non-quoted keys
!e python from yaml import load, Loader print(load("""version: 3.5.3""", Loader=Loader)) print(load("""version: 3.6""", Loader=Loader))
@amber raptor :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | {'version': '3.5.3'}
002 | {'version': 3.6}
!e python from yaml import load, Loader print(load("""country: NO""", Loader=Loader))
@amber raptor :white_check_mark: Your 3.12 eval job has completed with return code 0.
{'country': False}
Amazing
Hard to know without the full traceback as well
!e
from yaml import load, Loader
print(load("""NO: NO""", Loader=Loader))
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
{False: False}
pre-commit maintainer >>> yaml
HAHAHHAHAHAHHAHAHAHAH
ku bettle
where's my cumsum gang?
Every time
Kills me EVERY time
x = { a = b } # this is valid
x = {
a = b # this isnt right?
}
guys i made the hardest hangman game evr i think
Have to guess it in one try?
Looking
hhaha
I don't think that makes it hard. More words keeps it from being boring
Also I'd have everything be lowercase instead
thanks @grave pawner
what i dont like is when your formatter messes up the diff
Or have it check against the .lower() version
@warped maple
how do i do that
wait thats easy to fix
you can maybe implement a timing, to make the game harder
chat gbt got me hard haah
line 20:
s_word = random.choice(secret_words).lower()
line 67:
user_inp = list(input(' \n \n βΊ ').lower())
you have to guess the right answer within 10 seconds or the human chokes
because he hangs
hahahahahahaha that would be extreme
Also in most cases with hangman, you're not trying to guess the whole word each time
It's knocking out the letters
but u need to put conresponding letters
true, you guess a single character#
or ull cheat
@oblique ridge something like a formatter would run on save when i save the file in my editor
what i hate is when it messes up the diff
like it will make diff think ive changed a billion lines while it was just formatted
If you want knock out the most common letters: E, T, A, O, I, N, S, R, H, and L
:incoming_envelope: :ok_hand: applied timeout to @oblique ridge until <t:1697125800:f> (10 minutes) (reason: newlines spam - sent 212 newlines).
The <@&831776746206265384> have been alerted for review.
!unmute 586321204047249423
:incoming_envelope: :ok_hand: pardoned infraction timeout for @oblique ridge.
!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.
we got that good infrastructure
https://paste.pythondiscord.com/BRRQ
don't roast me, i'd rather raise errors than handle them
sudoku solver
def solve(self) -> bool:
"""
Solves `grid` in place.
Returns `True` if solved, otherwise `False`.
`grid` is left unchanged if unsolved.
"""
for r, row in enumerate(self.grid):
for c, digit in enumerate(row):
if digit != 0:
continue
for d in range(1, 10):
if not self._is_valid(d, r, c):
continue
self.grid[r][c] = d
if self.solve():
return True
self.grid[r][c] = 0
return False
self._solved = True
return True
``````php
2115349 function calls (2082272 primitive calls) in 0.899 seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
33078/1 0.122 0.000 0.899 0.899 main.py:69(solve)
297467 0.158 0.000 0.777 0.000 main.py:56(_is_valid)
297467 0.113 0.000 0.401 0.000 main.py:48(_is_valid_box)
297467 0.288 0.000 0.288 0.000 main.py:49(<listcomp>)
297467 0.073 0.000 0.168 0.000 main.py:44(_is_valid_col)
297467 0.095 0.000 0.095 0.000 main.py:45(<listcomp>)
297467 0.032 0.000 0.032 0.000 main.py:40(_is_valid_row)
297467 0.017 0.000 0.017 0.000 {built-in method builtins.all}
1 0.000 0.000 0.000 0.000 cProfile.py:118(__exit__)
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
def solve(self) -> bool:
"""
Solves `grid` in place.
Returns `True` if solved, otherwise `False`.
`grid` is left unchanged if unsolved.
"""
for r, row in enumerate(self.grid):
for c, digit in enumerate(row):
if digit != 0:
continue
for d in range(1, 10):
# if not self._is_valid(d, r, c):
if (
d in row
or d in [_row[c] for _row in self.grid]
or d
in [
self.grid[_r][_c]
for _r in range(r // 3 * 3, r // 3 * 3 + 3)
for _c in range(c // 3 * 3, c // 3 * 3 + 3)
]
):
continue
self.grid[r][c] = d
if self.solve():
return True
self.grid[r][c] = 0
return False
self._solved = True
return True
``````php
176038 function calls (142961 primitive calls) in 0.214 seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
33078/1 0.138 0.000 0.214 0.214 main.py:69(solve)
47110 0.047 0.000 0.047 0.000 main.py:86(<listcomp>)
95848 0.029 0.000 0.029 0.000 main.py:84(<listcomp>)
1 0.000 0.000 0.000 0.000 cProfile.py:118(__exit__)
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
def _is_valid(self, d: int, r: int, c: int) -> bool:
return all(
(
self._is_valid_row(d, r),
self._is_valid_col(d, c),
self._is_valid_box(d, r, c),
)
) # evaluating the tuple every time is what's bad here
this was the first one
An exploration of the mechanisms that drive tribalism βΒ and that offer a way out of it.
You can support the channel at: https://www.patreon.com/TheraminTrees
opening quote:
The individual has always had to struggle to keep from being overwhelmed by the tribe. To be your own man is a hard business. If you try it, youβll be lonely often, and s...
A way for two or more programs to talk to each other
!e
print(r'\n')
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
\n
!e
ham = "bacon"
print(fr"\n {ham}")
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
\n bacon
!e
meat = "spam"
# Concatenation
print("I would like to eat " + meat)
# C Style interpoplation
print("I would like to eat %s" % meat)
# .format() style
print("I would like to eat {}".format(meat))
# f-string style
print(f"I would like to eat {meat}")
@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.
001 | I would like to eat spam
002 | I would like to eat spam
003 | I would like to eat spam
004 | I would like to eat spam
10mod 3 1
f strings 4 lyfe β π€
yea f strings is great and in all versions of supported python
lim x->+infinity ((1-1/x))**x
!d time
This module provides various time-related functions. For related functionality, see also the datetime and calendar modules.
Although this module is always available, not all functions are available on all platforms. Most of the functions defined in this module call platform C library functions with the same name. It may sometimes be helpful to consult the platform documentation, because the semantics of these functions varies among platforms.
An explanation of some terminology and conventions is in order.
β’ The epoch is the point where the time starts, the return value of time.gmtime(0). It is January 1, 1970, 00:00:00 (UTC) on all platforms.
!d datetime
Source code: Lib/datetime.py
The datetime module supplies classes for manipulating dates and times.
While date and time arithmetic is supported, the focus of the implementation is on efficient attribute extraction for output formatting and manipulation.
Tip
Skip to the format codes.
Dude finds out his son gave away his house and this guy tells him daddy chill. What else can I sayπ
Assignment: write a function that returns number a to the power n. (i.e. returns a^n)
Requirements:
amust be some type of number (e.g. int, float)nmust be a non-negative integer
Restrictions:- no imports allowed
- python has a built in power operator
**; don't used that either (i.e. a ** n is not allowed)
Example: ```py
def power(a: float | int, n: int) -> float:...
power(2, 5) # should be 32
daddy chill
wth is even that
okayyyy less go
This parody song is actually called "Numbers" like Drowning Pool's "Bodies" but no one calls it that. They just call it "I can only count to four" by Psychostick. I'm sure people called Bodies "Let the bodies hit the floor" all the time. #psychostick #songparody
See Psychostick perform LIVE every Thursday at 8pm Eastern, 7pm Central.
https://ps...
>>> round(1.5)
2
>>> round(2.5)
2
>>> round(3.5)
4
>>> round(4.5)
4
a solution to this, but i expect yours to be different: ||```py
def power(a: float | int, n: int) -> float | int:
if n == 0:
return 1
if n == 1:
return a
p = power(a * a, n // 2)
if n % 2 == 1:
return a * p
return p
no dont show me
you can use while loop
did you ever mess with CORDIC math ... @oblique ridge
As a data scientist or software engineer, you may often come across situations where you need to compute exponential functions efficiently. One algorithm that can help you achieve this is the CORDIC algorithm. In this article, we will dive deep into the CORDIC algorithm, explaining its working principles and how it can be used to compute exponen...
haven't heard of it
i'm just a simple physics dude who dropped out when i tried out electric engineering
S-lang
32-bit, pipelined CORDIC solver with scale-factor correction
32-bit x 32-bit unsigned multiply with 64-bit result
64-bit / 32-bit unsigned divide with 32-bit quotient and 32-bit remainder
64-bit β 32-bit square root
Hello Guys, do you have experience with OCR in Python?
A little. I futzed around with OpenCV once or twice
!e
a=8
print(a)
def x(a):
global a=7
print(a)
x(a)
b = power(a, n)
print(b)
i using tesseract to read a manga but it work very bad...
so maybe do you have any expiercence with it π
it sometimes take only 50% of page or read the same "letter" sometimes as G sometimes as 6 its crazy
when i using on the same in google : Free image to OCR - it work briliant...
im crucious how it work...
bruh can you gimme a chance to talk i want to get an error solve
did you check out the voice verified channel thingy?
import pil.ImageGrab as ImageGrab
ModuleNotFoundError: No module named 'pil'
HELP
can you please guide?
oi @rugged root can you link channel? i have no visibility
the error says ModuleNotFoundError
so it can't find pil
have you checked out the docs for pillow?
free code camp you mean?
i am currently new in this language ... altho ihave installed PIL but it says its not installed
but it is
checking out the docs, it looks like the proper way to import it is ```py
from PIL import ImageGrab
it's case sensitive
pil doesn't exist, but PIL does
guys, where i can write my issue with OCR here? link chanel i writem more describe π
from PIL import ImageGrab
ModuleNotFoundError: No module named 'PIL'
Top-down method of learning, mostly give practical experienece in short amount of time, availabe on many platforms
then you don't have it installed
Q - i dont think its easy to make money with python ...
i ve tried installing it in terminal as well as CMD but it didnt work
whats with environmental var ?
nothing to worry about rn ;)
in pycharm, open terminal and try ```sh
python3 -m pip install Pillow
python is great for prototyping ideas
py -m pip install Pillow
n = 5 # control the base number
i = 5 # control how many multiplication
x = 0
f = 1
while i > x:
f = f * n
x = x + 1
print(f)
ohhh Pycharm still a 300 Meg install ?
im so sloww
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
: (
use py instead of python3
alr
i m new in this mb guys ...
Requirement already satisfied: Pillow in c:\users\itzuz\appdata\local\programs\python\python312\lib\site-packages (10.0.1)
[it says this but at the other side it says its not installed : ( ]
do you use ( program ) in multiple languages during the day ? @oblique ridge
for work, i exclusively use python and used to use a bit of js since i did a bit of web stuff, but that was mostly django
py -0
i just use python to talk to chips , display data - what do you do ?
general question for every one in room
i donno man this shit is hard af im raging
i see programmers using VS ( visual studio ) more and more even for python
PCharm learning curve is like Mt Everest , and 330 M + in size @rugged root
Eh
0 is a whole number, just not a natural number
W - {0}
N*