#voice-chat-text-0

1 messages Β· Page 199 of 1

prime bobcat
#

sorry this

#

so the variable value in a dictionary is keys?

tranquil jasper
#

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])
wise cargoBOT
#

@tranquil jasper :white_check_mark: Your 3.12 eval job has completed with return code 0.

key some text
tranquil jasper
#

so my_dict.keys is just a list of all of the keys of that dictionary

#

!voice

wise cargoBOT
#
Voice verification

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

tranquil jasper
#

​!voiceverify

prime bobcat
#

i dont get it the why i want lol

tranquil jasper
#

like how does it work?

prime bobcat
#

yeah

#

i mean i know it works

#

like the logic of it

#

sorry im weird af

tranquil jasper
#

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

prime bobcat
#

they were right

#

w3schools doenst have it right?

tranquil jasper
#
#

its in java

#

you in college rn?

prime bobcat
#

no, is a hobbie

#

but thank you for your time i will figure it out lol

tranquil jasper
#

yeah data structures and algorithms are pretty cool i enjoyed the class i had for it

prime bobcat
#

can you call this

#

my_dict = {'key':'some text'}

for key in my_dict.keys():
print(key, my_dict[key])

#

from another module

tranquil jasper
#

wdym

prime bobcat
#

`import randomshit
xd = randomshit.data

for x in xd:
print(xd[x])`

#

as this right?

tranquil jasper
#

!e

my_dict = {'key':'some text'}

for key in my_dict:
  print(key, my_dict[key])
wise cargoBOT
#

@tranquil jasper :white_check_mark: Your 3.12 eval job has completed with return code 0.

key some text
prime bobcat
#

and now the message im recieving is one key in one line

tranquil jasper
#

oh yeah i didnt realize it worked if you did it that way

prime bobcat
#

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?

tranquil jasper
#

are you having it print each individual character

#

if you do it that way you have to do

print(char, sep='', end='')
prime bobcat
#

because this thing
`output = ''
for x in xd:
output += xd[x]

print(output)`

#

is doing something like thisvalue + thisvalue

#

as strings?

tranquil jasper
#

is your print in your for loop?

prime bobcat
#

thats why isnt taking different lines

#

a = "Hello"
b = "World"
c = a + b
print(c)

like this

tranquil jasper
#

im confused on what you're asking

#

are you asking why it doesnt print on separate lines?

prime bobcat
#

yeah like the other code

tranquil jasper
#

im not sure whats up with the other code

#

it shouldnt print out like that

prime bobcat
#

okay let me show you

tranquil jasper
#

oh wait

#

import randomshit
xd = randomshit.data

for x in xd:
print(xd[x])

#

!e

enemy = {'hp':100}
print(enemy["hp"])
wise cargoBOT
#

@tranquil jasper :white_check_mark: Your 3.12 eval job has completed with return code 0.

100
gentle flint
wise loom
#

Anybody understand this meme?

fervent grail
#

Ye

empty leaf
#

goodmorning

gilded radish
#

guys,

#

how are you?

warped raft
#

hello @somber heath and
@whole bear

#

how are you doing

somber heath
#

@cobalt sphinx πŸ‘‹

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

obtuse geyser
#

what do i need to get started with python

slender sierra
#

@somber heath hi)

obtuse geyser
#

when i open python 3.120 it justs opens a cmd thing

somber heath
#

@signal monolith πŸ‘‹

signal monolith
#

hello

tranquil jasper
#

Morning everybody

signal monolith
#

I need to voice verify

tranquil jasper
#

!voice

wise cargoBOT
#
Voice verification

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

signal monolith
#

😦

#

​!voiceverify

tranquil jasper
#

!voiceverify

somber heath
#

@tepid viper πŸ‘‹

tepid viper
#

wssp

obtuse geyser
#

when i open python 3.120 it justs opens a cmd thing

tranquil jasper
#

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

tepid viper
#

python-idle

obtuse geyser
#

whats that

tepid viper
#

or vscode

tranquil jasper
#

Text editor

obtuse geyser
#

ive already got vscode

#

how

#

thing takes 1 min to load

tepid viper
#

bro

#

dont panic

signal monolith
#

does anyone have minecraft I will code you any mod you would like?

obtuse geyser
#

im not im opening it

obtuse geyser
signal monolith
#

yes

#

But its sorta like python

#

anf I code python too

#

and*

tepid viper
obtuse geyser
#

so is it possible like coding a mod exact like python and still work?

signal monolith
#

not exaclty bu

#

but*

obtuse geyser
tepid viper
obtuse geyser
#

yea and now

tepid viper
#

πŸ™‚

tranquil jasper
#

Write code

tepid viper
#

print("hello world")

#

type this

#

and press enter

tranquil jasper
#

Techwithtim goes crazy for learning python

obtuse geyser
#

how do i write a ip logger code

tranquil jasper
#

Like to a server?

tepid viper
#

?

somber heath
#

@true ridge @fading crow πŸ‘‹

obtuse geyser
#

no

#

i just started

somber heath
tranquil jasper
#

Yes for sure

obtuse geyser
signal monolith
#

@obtuse geyser I sent you a friend request

tepid viper
obtuse geyser
#

how

tranquil jasper
#

Techwithtim

obtuse geyser
#

idk where to start

tranquil jasper
#

Watch videos and learn

obtuse geyser
#

whats techwithtim

tranquil jasper
#

YouTube channel

somber heath
#

@mint sun πŸ‘‹

fading crow
tranquil jasper
wise cargoBOT
#
Voice verification

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

obtuse geyser
#

is it like 5 hours long

tranquil jasper
#

Yes

#

You don’t have to watch the whole thing but It will help if you do

somber heath
#

@final quail πŸ‘‹

obtuse geyser
#

ill watch the 1 hour python for beginners

tepid viper
#

@obtuse geyser remember to use documentation when u got stuck

final quail
somber heath
#

@rigid nacelle πŸ‘‹

rigid nacelle
#

Hey

somber heath
#

@solid sky πŸ‘‹

solid sky
#

hello

#

I am new in this python group

tepid viper
solid sky
somber heath
#

@whole bear @dusk spire πŸ‘‹

tepid viper
#

thast why i use python

whole bear
#

i want start study now python

somber heath
whole bear
#

but now study hard

somber heath
#

!resources

wise cargoBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

whole bear
#

Where do I start

#

ok

solid sky
#

can you help me for something

tepid viper
#

i know python

#

but i am bad at logic making

#

i am solving this problem which is low difficulty level

solid sky
#

OK

tepid viper
#

but making my confidence low

solid sky
#

I Understande

tepid viper
#

thisone

#

this is so easy

#

but i cant implemen it in code

solid sky
#

so my problem is how to make a loop in numbers in order

tepid viper
#

make a loop in numbers in order?

solid sky
#

means a loop of number in order way

#

like 1234

tepid viper
#

like u want to print numbers from 1 to n?

#

easy

solid sky
#

not like 1, 10, 15, 18, 84

obtuse geyser
#

its print("1234")

solid sky
obtuse geyser
#

watch a 12 hour python tutorial what im bouta do

tepid viper
#
for i in range(0,n):
    print(i)```
whole bear
solid sky
tepid viper
solid sky
#

What

whole bear
tepid viper
tepid viper
#

one is correct

#

@solid sky

solid sky
tepid viper
#

u learning python or what

#

this is a loop

solid sky
#

But Thank you for helping me

whole bear
#

Which one should I start studying first?

tranquil jasper
#

@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

tepid viper
tepid viper
tranquil jasper
#

algos

whole bear
tranquil jasper
#

out of those id start with algs and learn

solid sky
tranquil jasper
#

its a loop

#

in coding terms at least, its a loop

tepid viper
#

listen dude

#

there is 3 types of loop

#

for , while , do while

tranquil jasper
#

ong

rugged root
tepid viper
#

if u know the starting value , ending value , and steps then use for loop

tranquil jasper
#

yeah no do while in python

#

but thats okay

solid sky
#

sΒ―_(ツ)_/Β―

rugged root
#

Which honestly is kind of a shame

tepid viper
rugged root
#

Sure sure

tranquil jasper
#

you can implement it manually with flags

#

its just super annoying

rugged root
#

Yeah but it's not as clean

tranquil jasper
#

fax

noble solstice
#

Still people use do while loop

tepid viper
#

looks like i start a war for loops

tranquil jasper
#

lmao

rugged root
#

I'm sure there's a pep for it that's been rejected

rugged root
#

Just not sure what the reason would be

tranquil jasper
#

does it say why it was rejected?

rugged root
#

It does in the notes near the bottom

#

There's an email chain

tranquil jasper
#

!e

a = 0
while a < 8:
  print('this while loop go crazy!', end = '')
  a+=1
wise cargoBOT
#

@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!
tepid viper
#
a = 0
while a<100:
   print('i am crazy!')
   a+=1
#

!source[a = 0
while a<100:
print('i am crazy!')
a+=1]

somber heath
#

@wary ridge πŸ‘‹

#

Floosh shot.

#

@steel field πŸ‘‹

steel field
#

Hi

somber heath
#

numpy.lib.stride_tricks.sliding_window_view

rugged root
#

@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

somber heath
#

!e ```py
class MyClass:
def new(self, *args, **kwargs):
print(args, kwargs)
super().new(*args, **kwargs)

MyClass()```

wise cargoBOT
#

@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
rugged root
#
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

tranquil jasper
#

anybody have any methods to speed up parsing around 52 thousand html files

#

not files but just the text from requests

whole bear
#

for study

tranquil jasper
#

yeah

tranquil jasper
#

like through concurrent futures?

wind raptor
#

what are you parsing?

tranquil jasper
#

html

rugged root
wise cargoBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

wind raptor
#

from sites that allow webscraping?

tranquil jasper
#

yes

wind raptor
#

most sites do not allow it

rugged root
#

Or prefer you use their API

tranquil jasper
#

well if you want to drop it we can drop it

wind raptor
#

thus it goes against our rules

#

!rule 5

wise cargoBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

rugged root
#

It depends what and where is being scrapped

wind raptor
#

indeed

rugged root
#

So we're not against it being talked about, but it helps if we know what exactly we're helping with

amber raptor
#

Vast majority of people just need work queues

#

RabbitMQ is gold standard

tranquil jasper
#

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

amber raptor
#

Cloud based people just use cloud native ones

left leaf
#

are you running @dry jasper ?

rugged root
#

@wind raptor Halp

#

I'm doing this to myself

wind raptor
#

?

rugged root
#

I'm considering making a ratelimiter wrapper for aiohttp

#

Why do I keep doing this to myself

wind raptor
#

To be able to set rate limits and have aiohttp follow them?

rugged root
#

Yep, but have it so that you're not having to wrangle both libs

wind raptor
#

Interesting

rugged root
#

There's that one for requests

amber raptor
rugged root
#

And you just make requests or sessions directly from that. It handles passing stuff to requests itself

amber raptor
#

PLEASE FOR THE LOVE GOD, PLEASE

rugged root
left leaf
#

@dry jasper

amber raptor
#

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...

left leaf
#

Avg Sigma

rigid nacelle
#

columbian

amber raptor
#

@rugged root

rugged root
#

HA

left leaf
#

MIAMI VICE

wise loom
#

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

sacred crystal
#

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

sacred crystal
amber raptor
wise loom
obsidian socket
#

Hiii

cobalt cloak
#

hey

obsidian socket
#

@rugged root I'm here with another interesting underhood questionπŸ₯² 😁 πŸ˜…

rugged root
#

Oh god

#

Alright, hit me

gentle flint
#

...daddy?

obsidian socket
#

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

gentle flint
#

deez nuts

gentle flint
#

numbers become an int

#

numbers with a decimal become a float

obsidian socket
#

Okay but How?

gentle flint
#

well it looks at the value

#

if it's in quotes it decides it's a string

#

etc

obsidian socket
#

what does it do to detect the type?

gentle flint
obsidian socket
#

πŸ‘πŸ»

dry jasper
tall ridge
#

So nice to drop in, thank you!

tall ridge
rugged root
wise loom
#

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

whole bear
gentle flint
#

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...

rugged root
#

!paste

wise cargoBOT
#
Pasting large amounts of code

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

After pasting your code, save it by clicking the 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.

pulsar light
#

l e m o n

#

lemon

rugged root
#

!d str.replace

wise cargoBOT
#

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.
dry jasper
#

s_word.replace(" ","")

pulsar light
#

print(' ' ,v[_],end = '')

#
print('   ' ,v[_],end = '')
dry jasper
#

!e
s_word = l e m o n
t = lemon
if t == s_word.replace(" ", ""):
print("excellent")

wise cargoBOT
#

@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
dry jasper
#

!e
s_word = "l e m o n"
t = "lemon"
if t == s_word.replace(" ", ""):
print("excellent")

wise cargoBOT
#

@dry jasper :white_check_mark: Your 3.12 eval job has completed with return code 0.

excellent
pulsar light
rugged root
#
print("   ", end="")
for i in range(len(s_word)):
  print(v[i], end="")
pulsar light
dry jasper
#

its live

#

<-----

pulsar light
#

print(v[i], end=" ")

gentle flint
#

print(v, sep=" ")

wise loom
#

@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

pulsar light
#

im learning with coding

#

best way to learn

gentle flint
#

by writing code

willow light
#

Nothing wrong with writing code sometimes

wise loom
willow light
#

in what world do you live in where hand-on experience is more expensive than a book?

wise loom
# pulsar light best way to learn

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.

willow light
wise loom
willow light
#
// 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

pulsar light
#
!e
s_word = "l e m o n"
t = "lemon"
if t == s_word.replace(" ", ""):
    print("excellent")
willow light
#

!e

s_word = "l e m o n"
t = "lemon"
if t == s_word.replace(" ", ""):
    print("excellent")
wise cargoBOT
#

@willow light :white_check_mark: Your 3.12 eval job has completed with return code 0.

excellent
pulsar light
willow light
#

!e

s_word = "l e m o n"
t = "lemon"
assert t == s_word.replace(" ", ""), "oops"
wise cargoBOT
#

@willow light :warning: Your 3.12 eval job has completed with return code 0.

[No output]
pulsar light
#

a p p l e

#

s _ word = apple

willow light
#

!e

s_word = "a p p l e"
print(s_word.strip())
pulsar light
#

what he typed is a p p l e

wise cargoBOT
#

@willow light :white_check_mark: Your 3.12 eval job has completed with return code 0.

a p p l e
pulsar light
#

i want to change this output ap p l e

#

into apple which is the s_wor

willow light
#
import re
pattern = re.compile(r'\s+')
word = re.sub(pattern, '', s_word)

something like this perhaps

gentle flint
#

I would replace
"apple"
with
"a p p l e"
and then compare directly with user input

pulsar light
#

apple

willow light
#
/^\+?[0-9]\d{1,20}$/
#

regex is nuts

pulsar light
#

cat

#

bat

#

_at

#

car

#

cat

#

c a t

#

to cat because cat = sword and c a t != s_word

wise loom
#

I disagree with your method of learning

pulsar light
willow light
#

you aren't being hurt by someone other than you learning in a way that's different from your own

pulsar light
wise loom
willow light
#

What works for you doesn't necessarily work for everyone.

pulsar light
willow light
#

Now if only apple fans could learn that lesson.

pulsar light
#

cat

#

car

#

ca_

#

cat

wise loom
pulsar light
#

you win

#

cat

wise loom
#

tryharding

#

Lol

pulsar light
gentle flint
#
v = [1, 2, 3]
print(v)
print([1, 2, 3])
print(*v)
print(1, 2, 3)
karmic obsidian
#

b="asdfafdd"
print(*b)

#

for i in b:

#

print(i,end="")

pulsar light
karmic obsidian
#

a={'a':3,'b':4}
print(**a)

#

this doesn't work

gentle flint
#

!e

def x(a=1, b=2):
    print(a, b)

y = {'a':3, 'b':4}
x(**y)
wise cargoBOT
#

@gentle flint :white_check_mark: Your 3.12 eval job has completed with return code 0.

3 4
karmic obsidian
#

!e
a={'a':3,'b':4}
print(*a)

wise cargoBOT
#

@karmic obsidian :white_check_mark: Your 3.12 eval job has completed with return code 0.

a b
gentle flint
#

positional arguments

def x(a, b):
    pass
#

keyword arguments

def x(a=True, b=False)
    pass
karmic obsidian
gentle flint
#

!e

print(list({'a': 3, 'b': 4}))
wise cargoBOT
#

@gentle flint :white_check_mark: Your 3.12 eval job has completed with return code 0.

['a', 'b']
karmic obsidian
#

!e
a=['a','b']
print(*a)

wise cargoBOT
#

@karmic obsidian :white_check_mark: Your 3.12 eval job has completed with return code 0.

a b
stuck furnace
#

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.

karmic obsidian
stuck furnace
#

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.

pulsar light
#

im sorry if i interupt u guys

#

can u check my code out

#

this is a weird output

stuck furnace
#

@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...

β–Ά Play video
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 πŸ˜„

karmic obsidian
#

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

stuck furnace
#

With time complexity, you ignore constant speed-ups.

karmic obsidian
stuck furnace
#

You just care about how the time grows as the size of the input grows.

karmic obsidian
stuck furnace
#

E.g. one implementation of an algorithm could be 100 times slower than another but still have the same time complexity.

karmic obsidian
stuck furnace
#

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.

rugged root
#

Nuuuuuuuuuuuu

#

I was wrong

#

I can get into the Windows insider, but not the Microsoft 365 insider

pulsar light
#

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...

β–Ά Play video
stuck furnace
short owl
#

multilingual is good for coding , math , life in general

devout bloom
#

coding and math?? how? just curious

short owl
#

multi languages creates plasticity , easy to learn in general - what ever you do

whole bear
#

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...

short owl
#

wondering about using python front to talk to C , to do fast math on a raspi 3B+

#

guessing Cython

terse needle
short owl
#

math for graphics - pygame - i run it on W10 and ubuntu on raspi

terse needle
#

even if you go into linear algebra you still wont see any perfomance increase if you are using a library such as numpy

pulsar light
terse needle
pulsar light
#

i have a weird output

short owl
#

yes , most stuff in python optomized already

terse needle
short owl
#

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

terse needle
#

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

short owl
#

python is within my window of speed efficiency for now , there must be faster stuff than pygame

#

GODOT ?

terse needle
#

Godot is just different and not too comparable to pygame

#

pygame is more of a graphics library and Godot is a game engine

short owl
#

hmmm ok

terse needle
#

If I were to go an write a game right now I would choose Godot

pulsar light
#

guys what is if i in word means?

#

if (i) in word:

rugged root
#

!e

meats = ["ham", "pork", "beef"]
if "ham" in meats:
  print("Yep, it's there")
wise cargoBOT
#

@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.

Yep, it's there
terse needle
#

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")
wise cargoBOT
#

@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
short owl
#

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....

vocal basin
stuck furnace
#

I think Lemon said he would give people references if they need them πŸ˜„

vocal basin
#

ask chatgpt for advice instead of writing everything for you, I guess

toxic arch
#

@sage swift

toxic arch
vocal basin
#

harder to get access to + unclear policies

stuck furnace
#

!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)

short owl
#

just ask , instead of asking to ask -- how to ask ChatGPT - justa brain fart

wise cargoBOT
#

@stuck furnace :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | True
002 | False
003 | [['pork'], [], ['ham', 'beef'], []]
toxic arch
#

dont you need to do

def get_bucket(hash_table, string):
    return hash_table[(hash(string) % (1 << len(hash_table))]
#

?

vocal basin
#

no, that wouldn't work almost at all

toxic arch
#

hmm

#

wait

vocal basin
#

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)

stuck furnace
toxic arch
#

my bad you dont do that

#

you do (1 << len(hash_table))

vocal basin
#

purpose of hash_table[something % len(hash_table)] is to reduce something to a value that's a valid index

toxic arch
#

i just learnt about simple hash tables recenently so idk much

vocal basin
#

!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)])
wise cargoBOT
#

@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
whole bear
#
vocal basin
#

here we have a differentiation between a university and an institute
former being more general

#

@whole bear no, it's not American

stuck furnace
#

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 πŸ˜„

vocal basin
#

I think stem/non-stem differentiation is overused

whole bear
#

So, even British universities are much more focused

vocal basin
#

there are many places other than US with same system

whole bear
#

South America too

pulsar light
#

guys i want to turn user_inp as a list of 1 digit letters

#

what should i do

toxic arch
pulsar light
#

i see

vocal basin
#

!e

user_input = "1234"
print(user_input[1])
print(list(user_input))
wise cargoBOT
#

@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
#

is there a func for it

#

ahhh i see thanks

toxic arch
#

@pulsar light btw strings themselves are iterable

pulsar light
#

that exatly it

vocal basin
#

and indexable

toxic arch
#

so you dont have to turn it into a list unless you want to modfiy them

vocal basin
#

that too

rugged root
#

for letter in word: is common

pulsar light
#

i actually forgot it

toxic arch
pulsar light
vocal basin
toxic arch
#

!e
word = 'hello'
word[0] = 'b'

wise cargoBOT
#

@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
vocal basin
rugged root
#

Koalafications

toxic arch
#

!e
word = 'hello'
word = list(word)
word[0] = 'b'

wise cargoBOT
#

@toxic arch :warning: Your 3.12 eval job has completed with return code 0.

[No output]
toxic arch
pulsar light
#

why is my code wrong ):

#

the 2nd if stateements doesnt run

rugged root
pulsar light
#

can someone help me out

rugged root
#

Back later

toxic arch
#

0x80000000

#

what am i hearing in the vc 🀨

prime bobcat
#

our god is out?

haughty fog
wise loom
#

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

serene inlet
# pulsar light can someone help me out

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]]

somber heath
#

@summer kettle πŸ‘‹

serene inlet
#

how are you dude?

#

do u have any source for how to codeing a discord bot

somber heath
#

@coral prawn πŸ‘‹

serene inlet
#

yes

#

thank you

somber heath
#

@opaque coral πŸ‘‹

opaque coral
#

Hey

#

I need permission to speak apparently

somber heath
#

@subtle quest πŸ‘‹

#

!voice

wise cargoBOT
#
Voice verification

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

subtle quest
#

!voice

#

i am suppressed

opaque coral
#

!voice

#

Damn

subtle quest
#

now im fine

opaque coral
#

50 messages

#

ahhhh

#

I'll keep listening

#

Damn

serene inlet
#

If u found good one please share πŸ™‚

opaque coral
#

Hopefully by then I'll hit the 50 messages mark

#

Where we all from btw

#

I'll guess

#

UK?

subtle quest
#

i live there

opaque coral
#

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

serene inlet
#

Australia

opaque coral
#

damnnnn

#

Guess where I am from

serene inlet
#

hint?

opaque coral
#

Cheerio mate

prime bobcat
#

hello guys

opaque coral
#

Yeh

serene inlet
#

british

#

UK?

opaque coral
#

I live in the UK correct

#

Yes

prime bobcat
#

austin powers

opaque coral
#

Got here a month ago

#

ahahah

#

You know your geography too well

somber heath
#

@split drum πŸ‘‹

split drum
#

hello

opaque coral
#

I got a class in 10 min - I guess I'll have to catch up with you later

split drum
#

what you disgust about?

#

i have question on using python to creat telegram bot

somber heath
obsidian dragon
#

Why do programmers always mix up Christmas and Halloween?
Because Oct 31 == Dec 25!

warped raft
#

@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

whole bear
#

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

novel tangle
#

hi

whole bear
#

@wind raptor yes

#

apiso

#

i want to stream coding

wind raptor
#

!stream 939196353362419722

wise cargoBOT
#

βœ… @whole bear can now stream until <t:1697119243:f>.

whole bear
#

oh its the folder

#

trust me its not

#

i rewrote sxhkd in rust

somber heath
#
import random
random.seed('BIRD')```
#

@novel reef πŸ‘‹

novel tangle
#

just wait for some years those exhaust vents are going to be vanished from laptops

novel reef
#

@somber heath Hi there

#

Lol not a problem

novel tangle
somber heath
#

@warped orchid πŸ‘‹

wind arrow
#

How can I start streaming?

#

Do I need a special permission?

wind raptor
#

!stream 275350011619966977

wise cargoBOT
#

βœ… @wind arrow can now stream until <t:1697120936:f>.

wind arrow
#

Thanks

novel tangle
#

@somber heath nice voice acting

wind raptor
#

No problem

vocal basin
whole bear
vocal basin
#

I just realised "ASGI server" might be slightly lexically incorrect because "server server"

wind raptor
#

@wind arrow What are you working on?

novel reef
#

Suddenly an awkward silence in voice chat

wind arrow
swift valley
#

G'evening

rugged root
#

How's it going

swift valley
#

continuing the grind

whole bear
#

what command waas this

swift valley
#

tokei

whole bear
rugged root
#

rust via .NET?

whole bear
#

lol

rugged root
#

I'm down for it

amber raptor
whole bear
rugged root
#

Dude hold on

#

via .NET via Python via Rust

#

I just realized that full chain

stuck furnace
#

πŸ‘‹

rugged root
#

hi

swift valley
#

I bought a Thinkpad and installed NixOS on it πŸ˜›

whole bear
#

have you tried

#

void linux

stuck furnace
#

Yeah that was my experience. I gave up

amber raptor
pulsar light
#

mr hemlock did u see it?

rugged root
amber raptor
rugged root
pulsar light
#

its good

rugged root
pulsar light
#

try it out (:

amber raptor
whole bear
#

i dont like toml

#

id rather write my own format

wind arrow
#

Xml πŸ’€

whole bear
#

programmatic configuration

amber raptor
#

!e python import pyyaml

wise cargoBOT
#

@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
whole bear
#

eval()

oblique ridge
rugged root
#

!e import pyyaml

wise cargoBOT
#

@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'
amber raptor
#

!e python import pyyaml

wise cargoBOT
#

@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'
oblique ridge
amber raptor
#

!e python import yaml

wise cargoBOT
#

@amber raptor :warning: Your 3.12 eval job has completed with return code 0.

[No output]
whole bear
#

yaml DSL

#

toms a geinus

mighty robin
#

GUYs

#

i need HELP

amber raptor
#

!e python import yaml print(yaml.load('country: NO'))

wise cargoBOT
#

@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
#

!e python from yaml import load, dump print(load('country: NO', Loader=Loader))

wise cargoBOT
#

@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
novel tangle
amber raptor
#

!e python import yaml print(yaml.load("""country: NO"""))

wise cargoBOT
#

@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'?
amber raptor
#

I HOPE YOU CATCH FIRE PYYAML

mighty robin
#

🀣

rugged root
#

!e

from yaml import load, Loader
print(load("""country: NO""", Loader=Loader))
wise cargoBOT
#

@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.

{'country': False}
whole bear
rugged root
#

!e

from yaml import load, Loader
print(load("""country: 'NO'""", Loader=Loader))
wise cargoBOT
#

@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.

{'country': 'NO'}
mighty robin
#

someone knows pycaw library ?

stuck furnace
amber raptor
#

!e python from yaml import load, Loader print(load("""country: '12345'""", Loader=Loader))

wise cargoBOT
#

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

{'country': '12345'}
rugged root
#

!e

from yaml import load, Loader
print(load("""NO: NO""", Loader=Loader))
wise cargoBOT
#

@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.

{False: False}
whole bear
#

false false square

novel tangle
#

bye bye

amber raptor
#

!e python from yaml import load, Loader print(load("""version: 3.5.3""", Loader=Loader)) print(load("""version: 3.6""", Loader=Loader))

wise cargoBOT
#

@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}
amber raptor
#

!e ```python
import json
print(json.loads('{version: 3.5.3}'))

wise cargoBOT
#

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

"{version: 3.5.3}"
oblique ridge
#
whole bear
#

!e

from yaml import load,Loader
print(load('on:off',Loader=Loader))
wise cargoBOT
#

@whole bear :white_check_mark: Your 3.12 eval job has completed with return code 0.

on:off
amber raptor
#

!e python import json print(json.loads('{version: 3.5.3}'))

wise cargoBOT
#

@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

whole bear
#

!e

print(__import__('json').loads('{"version": 3.5.2}'))
wise cargoBOT
#

@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

amber raptor
#

!e python import json print(json.loads("{version: '3.5.3'}"))

wise cargoBOT
#

@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

dry jasper
amber raptor
#

!e python import json print(json.loads('{"version":"3.5.3"}'))

whole bear
#

!e

try: __import__('json').loads('{"version": 3.5.5}')
except e: print(e, dir(e), repr(e))
wise cargoBOT
#

@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'}
whole bear
#

id take non-quoted keys

amber raptor
#

!e python from yaml import load, Loader print(load("""version: 3.5.3""", Loader=Loader)) print(load("""version: 3.6""", Loader=Loader))

wise cargoBOT
#

@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}
amber raptor
#

!e python from yaml import load, Loader print(load("""country: NO""", Loader=Loader))

wise cargoBOT
#

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

{'country': False}
mighty robin
#

guys whats wrong wit this

#

😭

whole bear
rugged root
#

Amazing

rugged root
#

!e

from yaml import load, Loader
print(load("""NO: NO""", Loader=Loader))
wise cargoBOT
#

@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.

{False: False}
whole bear
#

pre-commit maintainer >>> yaml

amber raptor
mighty robin
#

HAHAHHAHAHAHHAHAHAHAH

whole bear
#

ku bettle

oblique ridge
#

where's my cumsum gang?

rugged root
#

Every time

#

Kills me EVERY time

whole bear
#
x = { a = b } # this is valid
x = {
  a = b # this isnt right?
}
pulsar light
#

guys i made the hardest hangman game evr i think

rugged root
#

Have to guess it in one try?

pulsar light
#

i added alot of words

#

i think i mean a LOT

rugged root
#

Looking

pulsar light
#

hhaha

rugged root
#

I don't think that makes it hard. More words keeps it from being boring

pulsar light
#

well it makes it hard when u lose like 10 games

#

alot of words would be hard

rugged root
#

Also I'd have everything be lowercase instead

pulsar light
#

thanks @grave pawner

whole bear
#

what i dont like is when your formatter messes up the diff

rugged root
#

Or have it check against the .lower() version

pulsar light
#

@warped maple

pulsar light
#

wait thats easy to fix

dry jasper
#

you can maybe implement a timing, to make the game harder

pulsar light
#

chat gbt got me hard haah

rugged root
#

line 20:

s_word = random.choice(secret_words).lower()

line 67:

user_inp = list(input(' \n   \n        β–Ί  ').lower())
dry jasper
#

you have to guess the right answer within 10 seconds or the human chokes

#

because he hangs

pulsar light
rugged root
#

Also in most cases with hangman, you're not trying to guess the whole word each time

#

It's knocking out the letters

pulsar light
#

but u need to put conresponding letters

dry jasper
#

true, you guess a single character#

pulsar light
#

or ull cheat

whole bear
#

@oblique ridge something like a formatter would run on save when i save the file in my editor

oblique ridge
#

yeah that's the other thing i forgot to mention
i do that

#

much more convenienter

whole bear
#

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

oblique ridge
#

but i do like the hangman drawings
i gotta add that

rugged root
#

If you want knock out the most common letters: E, T, A, O, I, N, S, R, H, and L

wise cargoBOT
#

: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.

rugged root
#

!unmute 586321204047249423

wise cargoBOT
#

:incoming_envelope: :ok_hand: pardoned infraction timeout for @oblique ridge.

rugged root
#

!paste

wise cargoBOT
#
Pasting large amounts of code

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

After pasting your code, save it by clicking the 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.

oblique ridge
whole bear
#

why are people on the internet elitists?

#

not taking about you guys

dry jasper
#

we got that good infrastructure

oblique ridge
#

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
oblique ridge
rugged root
#

A way for two or more programs to talk to each other

oblique ridge
pulsar light
#

what does \ means?

#

double \

rugged root
#

!e

print(r'\n')
wise cargoBOT
#

@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.

\n
rugged root
#

!e

ham = "bacon"
print(fr"\n {ham}")
wise cargoBOT
#

@rugged root :white_check_mark: Your 3.12 eval job has completed with return code 0.

\n bacon
oblique ridge
rugged root
#

!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}")
wise cargoBOT
#

@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
pulsar light
#

10mod 3 1

oblique ridge
#

f strings 4 lyfe ✊ 😀

amber raptor
#

yea f strings is great and in all versions of supported python

oblique ridge
#

uninstalling this garbage app

pulsar light
#

lim x->+infinity ((1-1/x))**x

rugged root
#

!d time

wise cargoBOT
#

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.

rugged root
#

!d datetime

wise cargoBOT
#

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.

pulsar light
oblique ridge
#

Assignment: write a function that returns number a to the power n. (i.e. returns a^n)
Requirements:

  • a must be some type of number (e.g. int, float)
  • n must 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

cobalt cloak
pulsar light
stuck furnace
#

Nah you can't use or.

#

One I think pithink

cobalt cloak
oblique ridge
#
>>> round(1.5)
2
>>> round(2.5)
2
>>> round(3.5)
4
>>> round(4.5)
4
oblique ridge
pulsar light
#

no dont show me

oblique ridge
#

yeye it's spoilered

#

mine doesn't do it the standard way anyway tho

short owl
#

did you ever mess with CORDIC math ... @oblique ridge

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...

oblique ridge
haughty fog
#

S-lang

short owl
#

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

pulsar light
lavish pollen
#

Hello Guys, do you have experience with OCR in Python?

rugged root
#

A little. I futzed around with OpenCV once or twice

karmic obsidian
#

!e
a=8
print(a)
def x(a):
global a=7
print(a)
x(a)

oblique ridge
#
b = power(a, n)
print(b)
lavish pollen
#

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...

wind spire
#

bruh can you gimme a chance to talk i want to get an error solve

oblique ridge
#

did you check out the voice verified channel thingy?

wind spire
#

import pil.ImageGrab as ImageGrab
ModuleNotFoundError: No module named 'pil'

HELP

wind spire
oblique ridge
rugged root
oblique ridge
#

so it can't find pil

#

have you checked out the docs for pillow?

karmic obsidian
#

free code camp you mean?

wind spire
#

but it is

oblique ridge
#

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

lavish pollen
#

guys, where i can write my issue with OCR here? link chanel i writem more describe πŸ˜‰

wind spire
#

from PIL import ImageGrab
ModuleNotFoundError: No module named 'PIL'

thin fox
#

Top-down method of learning, mostly give practical experienece in short amount of time, availabe on many platforms

oblique ridge
#

then you don't have it installed

wind spire
#

i ve installed it using ..(pip3 install Pillow
)

#

pycharm

short owl
#

Q - i dont think its easy to make money with python ...

wind spire
#

i ve tried installing it in terminal as well as CMD but it didnt work

#

whats with environmental var ?

oblique ridge
#

nothing to worry about rn ;)

#

in pycharm, open terminal and try ```sh
python3 -m pip install Pillow

short owl
#

python is great for prototyping ideas

rugged root
#

py -m pip install Pillow

coarse rock
#
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)

short owl
#

ohhh Pycharm still a 300 Meg install ?

wind spire
#

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
: (

oblique ridge
#

use py instead of python3

wind spire
#

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 : ( ]

short owl
#

do you use ( program ) in multiple languages during the day ? @oblique ridge

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

rugged root
#

py -0

short owl
#

i just use python to talk to chips , display data - what do you do ?

#

general question for every one in room

wind spire
short owl
#

i see programmers using VS ( visual studio ) more and more even for python

rugged root
#

I'm reinstalling PyCharm

#

I'll double check

#

Might be a moment or two

short owl
#

PCharm learning curve is like Mt Everest , and 330 M + in size @rugged root

rugged root
#

Eh

stuck furnace
#

rip Bram

#

Moolenaar

#

creator of Vim

#

Yeah, he did a tonne of charity work.

rugged root
#

0 is a whole number, just not a natural number

whole bear
#

W - {0}

pulsar light
#

N*

sour willow
#

sup hem

#

from tabulate import tabulate

list, indx: int = [[] for i in range(10)] , 0

for i in range(1, 101):
    list[indx].append(i)
    indx = indx + 1 if i % 10 == 0 else indx

print(tabulate(list, tablefmt="grid"))

anyone know how i can simplify this ?