#voice-chat-text-0

1 messages · Page 201 of 1

vocal basin
#
base_dir = Path(r'C:/Users/danie/')
path = base_dir / "<filename>"
#
base_dir = Path(r'C:/Users/danie/')
path = base_dir / "example.fit"
#

pathlib.Path attempts to be OS-independent in its interfaces

boreal abyss
#

Hello @somber heath !

vocal basin
#

except explicitly for converting from and into OS representation

boreal abyss
#

would you be able to help me out

#

with something

#

but with python

vocal basin
#

the test system?

boreal abyss
#

si

#

having user input code, and then printing the output onto a website

vocal basin
#

how much do you trust the users?

boreal abyss
vocal basin
#

as for isolation, there exist per-language sandboxes and some generic ones

#

generic approach normally involves containerisation of some sort

#

I'd expect namespaces/cgroups or its derivatives (including Docker) to be used there

boreal abyss
#

Yep

#

I think this is a good tool

#

for the whole sandboxing

vocal basin
#

good for what?

#

eh

#

it doesn't itself do the sandboxing, afaik

boreal abyss
#

the sandboxing itself is just docker no?

vocal basin
#

just a message broker

tulip plover
#

do you know sql

boreal abyss
vocal basin
#

just docker isn't enough

#

creating a container per run is too expensive

tulip plover
#

wnat about you @vocal basin

vocal basin
#

I have experience with SQL but not much

#

I prefer using ORMs or simpler data storage mechanisms

tulip plover
#

if a have a sql table from one of the items i get the rowid how can I get that same rowid in a other table

vocal basin
#

rowids across tables aren't correlated, usually

#

FK from one table's column to another's rowid column could be a thing

#

i.e. enforcing that referencing table's rows are each associated to at most one row in referenced table

vocal basin
tulip plover
#

I have 2 table one of the table have the users login the other one have some information's on the account how can I connect them

boreal abyss
#

@vocal basin suppose I am the only user

#

and I am not going rm rf everything

#

how would I go about recreating something like freecodecamp, but for python input/output?

#

I've had several ideas

#

but none of them are elegant

vocal basin
#

does -f suppress errors?

boreal abyss
#

!e

print(5+5)
wise cargoBOT
#

@boreal abyss :white_check_mark: Your 3.12 eval job has completed with return code 0.

10
vocal basin
#

!e

from subprocess import check_output
print(check_output('touch /test'.split()))
tulip plover
wise cargoBOT
#

@vocal basin :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(check_output('touch /test'.split()))
004 |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 |   File "/lang/python/default/lib/python3.12/subprocess.py", line 466, in check_output
006 |     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
007 |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
008 |   File "/lang/python/default/lib/python3.12/subprocess.py", line 548, in run
009 |     with Popen(*popenargs, **kwargs) as process:
010 |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
011 |   File "/lang/python/default/lib/python3.12/subprocess.py", line 1026, in __init__
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/M3KFS5F7VZD2GQHYYR3EUKREVM

vocal basin
#

!e

from subprocess import check_output
print(check_output('rm -rf /dev/'.split()))
wise cargoBOT
#

@vocal basin :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(check_output('rm -rf /dev/'.split()))
004 |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 |   File "/lang/python/default/lib/python3.12/subprocess.py", line 466, in check_output
006 |     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
007 |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
008 |   File "/lang/python/default/lib/python3.12/subprocess.py", line 548, in run
009 |     with Popen(*popenargs, **kwargs) as process:
010 |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
011 |   File "/lang/python/default/lib/python3.12/subprocess.py", line 1026, in __init__
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/QBTFWJZSZQGPAFW666JGEIORAY

vocal basin
#

well, that's one way to deal with that, I guess

#
No such file or directory: 'rm'
#

!e

from shutil import rmtree
rmtree('/dev/')
wise cargoBOT
#

@vocal basin :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 |     rmtree('/dev/')
004 |   File "/lang/python/default/lib/python3.12/shutil.py", line 769, in rmtree
005 |     _rmtree_safe_fd(fd, path, onexc)
006 |   File "/lang/python/default/lib/python3.12/shutil.py", line 680, in _rmtree_safe_fd
007 |     onexc(os.rmdir, fullname, err)
008 |   File "/lang/python/default/lib/python3.12/shutil.py", line 678, in _rmtree_safe_fd
009 |     os.rmdir(entry.name, dir_fd=topfd)
010 | OSError: [Errno 30] Read-only file system: 'shm'
vocal basin
#

!e

from shutil import rmtree
rmtree('/etc/')
wise cargoBOT
#

@vocal basin :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 |     rmtree('/etc/')
004 |   File "/lang/python/default/lib/python3.12/shutil.py", line 769, in rmtree
005 |     _rmtree_safe_fd(fd, path, onexc)
006 |   File "/lang/python/default/lib/python3.12/shutil.py", line 697, in _rmtree_safe_fd
007 |     onexc(os.unlink, fullname, err)
008 |   File "/lang/python/default/lib/python3.12/shutil.py", line 695, in _rmtree_safe_fd
009 |     os.unlink(entry.name, dir_fd=topfd)
010 | OSError: [Errno 30] Read-only file system: 'ld.so.cache'
vocal basin
#

I think that's, like, only part of what disallows it

#

the real general reason is:
current user lacks the privileges

#

within the container even

#

assuming code isn't ran as root

#

basic logic of a runner could be:
clear everything that a sandboxed program can read/write
receive next request
run the code as a restricted user
either wait for the completion or kill on timeout
gather results, send somewhere else
repeat

#

stopping certain programs could be difficult

vale swallow
#

!voiceverify​

wise cargoBOT
#
Voice verification

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

vocal basin
#

it could've been just time-limited

#

I learned C# and Python at the same time

#

CLR (C#'s thing) and JVM are VMs

#

in some sense

#

there https+git option for pip or something similar

#

@ebon mist yes, registries normally have a full list of packages

#

it's just an html file

#

relatively large one

#

!e

print(sorted('a2df.898-2f_h'))
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.12 eval job has completed with return code 0.

['-', '.', '2', '2', '8', '8', '9', '_', 'a', 'd', 'f', 'f', 'h']
vocal basin
#

compared based on ord values of characters

#

list(map(ord, s1)) < list(map(ord, s2)) should be same as s1 < s2

#

something literally called "project interpreter", iirc

#

settings > project > project interpreter

#

in normal PyCharm workflow, manually adding new interpreters is only necessarily when fixing/updating a project

ebon mist
#

PYTHONUNBUFFERED=1

vocal basin
#

affects stdout/stderr/etc.

ebon mist
toxic arch
#

@wind raptor can i get stream permssions

wind raptor
#

!stream 750306431223201793

wise cargoBOT
#

✅ @toxic arch can now stream until <t:1697283986:f>.

toxic arch
#

im gonna start coding

#

a gui

#

yes python

#

do you know how i can also get the gui

#

in thje stream

#

nah ive only really used tkinker

#

alright thne

#

yeah for this game

#

it just takes long to loasd

#

its loading all of the containers

#

yeah

#

i use a cache

#

its for a game

#

right now im just trying to figure out what theese files mean

#

nah just making custom levels

#

its offline

#

well i hope so

#

ive been looking at this for a while and i cant wrap my head around it

#

the only thing ive been able to tell is the area loading

obsidian dragon
toxic arch
#

its from the same

#

ai

#

i think

#

nice car

#

brooo

#

i use interactions-py

#

do you think i should get rid off the tearoff?

#

@obsidian dragon i used kivy

vivid gorge
#

what program is this?

#

you can just say it

#

I am in the vc

toxic arch
#

@wind raptor do you know how i can make a new image with some text on it

#

pillow

#

ohh its there

#

just very small

#

do you know how i can make it fill the image

#

oh so i need to make a font

#

to change its size?

obsidian dragon
#

thx

toxic arch
#

hmm but how can i make it filll the image

#

cause the text is tiny

#

i think im gonna have to do some logic

#

to tell how big the font should be

vivid gorge
#

I am making a macro/automation program and I do not know what else to add? Anyone have any ideas?

#

Here are some of the things I have already added

vivid gorge
#

got that

toxic arch
#

not spam key, hold

vivid gorge
#

yea I have that

toxic arch
#

make a macro to spam q then e

#

qeqeqeqeqeqeqeqeqe

#

like that

vivid gorge
#

I wish I could share screen

toxic arch
#

ask @wind raptor

vivid gorge
#

@wind raptor can I?

toxic arch
#

werid the image isnt showing correctlly in

#

tkinter

vivid gorge
#

ok I just want to share my project

#

it is just to get things done faster

wind raptor
#

!stream 720148755973799937

wise cargoBOT
#

✅ @vivid gorge can now stream until <t:1697286634:f>.

toxic arch
#

@obsidian dragon i used kivy a while back

#

wanna see it?

#

i love tkinker

#

(i dont)

#

@obsidian dragon i use the linux cmd thing

#

i forgot what its called

#

nboo its built in windows

#

it starts with w

#

wsl

#

thats it

#

Windows Subsystem for Linux

#

to build kivy for android

#

no clue how

#

lmao

#

its not

#

a calcualtor

#

its a save editor

#

yeah i gave up on it

#

a long time agao

#

werid its not working in tkinker

#

the image

#
  preview = Image.new('RGB', (512, 512),(0,0,0))
  draw = ImageDraw.Draw(preview)
  draw.text((0, 0), "nice Car",(255, 255, 255),ImageFont.truetype("arial.ttf",128))
  tk.Label(preview_view,image=ImageTk.PhotoImage(preview)).pack()
#

you

#

not showing the function

#

@vivid gorge

toxic arch
#

its just a grey square

#

PROGRAM ON CHROMEBOOK TOO

vivid gorge
toxic arch
#

ITS JUST GREY

#

man i cant wait

#

making a level editor in tkinker gonna be fun!

#

(not)

vivid gorge
#

I would get into web programing but for it to be useful I would have to buy a domain

toxic arch
#

im just doing an empty image

obsidian dragon
#

moved the text_color specification outside the draw.text function, ensuring that the text is drawn in white on the black background

toxic arch
#

just testint stuff rn

#

this is probably just some left over compiled stuff

#

maybe i can find out this debug

#

menu

#

is this markdown?

#

this is NOT markdown

somber heath
#

What is preview_view?

#

Oh, tk parent.

#

Durr.

toxic arch
#

its a frame

#

@somber heath

somber heath
#

Ya, I was slow on the uptake.

toxic arch
#

i dont think this game is apporate for this server so im gonna stop streaming now

vivid gorge
#

Right now the way my program works is you type in a bunch of commands. The way it does that right now is by having one function manage running all of that with the exception of looping. To make it worse in the one function there is just a whole lot of elifs. Right now this is the best I have because I started this project when I was very new to python. I have tried to simplify code but there is just soo much.

toxic arch
obsidian dragon
#

why it no work

toxic arch
#

just use

#

pip install

#

smh

wind raptor
#

for powershell i think it's activate.ps1

toxic arch
#

why they name it ps1

#

i alwys thinkg ps1 console

vivid gorge
#

In my program to automate things you just type in a lot of commands and they get executed when it's ran. Would it be better to tokenize or stick with what I have which is arguments

wind raptor
#

Set-ExecutionPolicy Unrestricted -Scope CurrentUser

obsidian dragon
toxic arch
#

afk

somber heath
#

@toxic arch I've had a tinker with tkinter. Following an example from elsewhere which ought to work...doesn't. I packed and I mainlooped and it doesn't want to display. Tkinter isn't something I'm particularly good at, but I am a little perplexed.

#

I know I've got image stuff to show up in tkinter, before, so I'm buggered if I know why it's being stupid.

obsidian dragon
#

@dire quarry try !voice

#

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

vivid gorge
#

Hello

toxic arch
#

im back

pulsar light
#

hi

whole bear
#

I've been watching videos about Python and I didn't understand anything. I'm going to start studying with chatgpt and I saw a video saying is it worth it?

dry jasper
#

lol totaly forgot i was here

wind raptor
#

lol

dry jasper
#

i am playing cs2

#

and i am on teamspeak

#

😄

wind raptor
#

Ahh, best of luck to you!

dry jasper
#

with the same push to talk button

wind raptor
#

lol. that could have ended badly 🤣

dry jasper
#

could you hear me speak?

wind raptor
#

I just got there

dry jasper
#

kk

whole bear
#

Chatgpt is a good place to study

#

?

wind raptor
whole bear
#

What is the best way to study py today?

wind raptor
#

If you need a second source for info on something, or review on something you kind-of know already, I'd use it

#

I prefer Udemy 40+ hour well-structured courses. I learn best by watching good videos and following along / deviating from them.

whole bear
#

The problem is that I'm Portuguese

wind raptor
#

YouTube is fine, but the 5-10 hour all-in-one courses are just not long enough to really learn something all that well.

wind raptor
hasty blaze
#

@wind raptor

wind raptor
#

I hear you and am talking back

#

I know my mic is working

#

I was just talking with someone else

#

I'll brb. I have to trim my dog's nails quick.

hasty blaze
#

@wind raptor

#

im back

#

welcome voice chat if anyone wnat to help

jovial wigeon
#

I am back in black

#

Hard to send 50 message

#

Kind of funny

#

And new

wind raptor
#

!stream 456056298522279946

wise cargoBOT
#

✅ @hasty blaze can now stream until <t:1697301670:f>.

pulsar light
#

discord past

wind raptor
#

!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
hasty blaze
wind raptor
#

!stream 456056298522279946

wise cargoBOT
#

✅ @hasty blaze can now stream until <t:1697302022:f>.

pulsar light
wind raptor
#

!stream 360284932469293056

wise cargoBOT
#

✅ @ebon mist can now stream until <t:1697303829:f>.

ebon mist
vale swallow
#

hey

#

hows it goin everyone

haughty fog
vale swallow
#

s lang

wise loom
#

Windows 12 in the cloud

#

no internet, no OS

wind raptor
#

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

whole bear
#

i have one question

#

age = 7
if age < 5:
print("You're too small!")
else:
print("You're all grown up!!")

#

if you are over 5 years old I use IF but if you are less than 5 I use ELSE

#

.

#

else is for when I don't have the q requirement and request

#

.

#

if is for if you have more than the requirement

#

sure?

#

.

wind raptor
#

!stream 500168097852948482 2w

wise cargoBOT
#

✅ @desert wolf can now stream until <t:1698517590:f>.

whole bear
#

chris

wind raptor
whole bear
#

And see if what I sent you is right the code and the explanation

#

@desert wolf What are you creating?

#

one variable need "?

#

" "

vale swallow
#

nut

#

hey how long do u guys think it will take to learn enough python for ai automation

scarlet halo
#

has someone made a file explorer type thing for the terminal?

whole bear
#

What is the difference between else and elif

scarlet halo
whole bear
#

age = 7
if age < 5:
print("You're too small!")
else:
print("You're all grown up!!")

#

In this code you could also use elif instead of else

scarlet halo
#

!e ```py
age = 18
if age > 5:
print(True)
if age > 6:
print(True)
if age > 7:
print(True)
if age > 8:
print(True)
if age > 9 :
print(True)
if age > 10:
print(True)
if age > 11:
print(True)
if age > 12:
print(True)
if age > 13:
print(True)
if age > 14:
print(True)
if age > 15:
print(True)
if age > 16:
print(True)
if age > 17:
print(True)
if age < 18: # less than 18 btw
print(True)
else:
print(False)

wise cargoBOT
#

@scarlet halo :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | True
002 | True
003 | True
004 | True
005 | True
006 | True
007 | True
008 | True
009 | True
010 | True
011 | True
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/XZB75MQROYS5VCCAA4XOE7FCPU

scarlet halo
#

True
True
True
True
True
True
True
True
True
True
True
True
True
False

#

elif would only return 1 True

faint raven
#
age = 18
if age > 18:
print("you're a sore fucking loser")
else: 
print("hey buddy grab a drink :laughing: ")
scarlet halo
#

get a drink

#

is what itll return

#

THATS A REALLY GOOD QUESTION

faint raven
#

a buzzz light

#

😄

scarlet halo
#

cls is great

#

ram.xyz

whole bear
scarlet halo
#

basically elif only runs if the previous if statement is False

#

and else cant have expressions

#

like you cant do: else x == y: but youll have to do elif x == y:

whole bear
#

So if the if ago is false, use if elif for true

scarlet halo
#

well

#

you can have multiple elifs

#

and an else

whole bear
#

Okay this time I realized

scarlet halo
#

so if ... elif(s) ... else (optional)

whole bear
#

If the IF command is false, the next true and elif

scarlet halo
#

if the if is true no elifs will run either

whole bear
#

If IF is true the next and else?

scarlet halo
#

no if if is true no other elifs or elses will be run

whole bear
#

If IF true I don't need to add any of them

scarlet halo
#

elses and elifs are good to have incase your if is false

whole bear
#

Age = 20
if age < 19:
print("ok")
else:
print("okkk")

#

In this code I use elif

#

sure?

scarlet halo
#

no that should be else

#

theres no expression

#

in the elif

#

so its useless

#

should be else

#

elif 1==1:

#

else:

#

see?

whole bear
#

Why should it be else and not elif

scarlet halo
#

your elif doesnt have an expression/condition

#

therefore it doesnt know whether to run or not

#

and it gets confused

#

and might throw an error

whole bear
#

Can you give an example of each

#

Age = 20
if age < 19:
print("ok")
else:
print("okkk")

Age = 18
if age < 19:
print("ok")
elif:
print("okkk")

#

Sure?

scarlet halo
#
if 1==2:
  quit(1) #doesnt execute as 1 is not equal to 2
else:
  quit(0) #runs because previous if is false
#
if 1==2:
  pass
elif 1==3:
  pass
elif 1==1:
  print("success")
whole bear
#

If false and elif false but last elif true

scarlet halo
#

as i said there can also be an "else:" after the last elif

scarlet halo
whole bear
#

If the first if is false I use elif false and dps a correct?

scarlet halo
#

you should try reading some more about if statements as theyre pretty similar for each programming language.

whole bear
#

Ok

scarlet halo
whole bear
#

Ok thanks for trying to help me

vale swallow
#

yo

#

hows it goin everybody

shy raft
#

good

vale swallow
#

kool kool

prime bobcat
#

hello bro

wise loom
#

there's nobody online

prime bobcat
#

i hear you

wise loom
#

you hear me, that's good

prime bobcat
#

how are you?

wise loom
#

not much else

prime bobcat
#

im learning physics lol

wise loom
prime bobcat
#

all i can

#

im with gravity right now

wise loom
prime bobcat
#

yeah but i cant understand it lol

#

i dont know how to type exponential numbers

#

python recognize this?

charred pilot
#

yo guys

#

quick question

#

how can i prevent a kali linux attack

wise loom
charred pilot
#

klai linux its a thingy for hacking

#

been gettin popukar in my school and people gettin hacked left and right

wise loom
charred pilot
#

how can i prevent it

wise loom
charred pilot
#

idk something ot do w kali linux

#

ik i sound like a 60 year old rn

#

but im just aksin about it

wise loom
prime bobcat
#

maybe they are using open wifi networks on school

#

thats why they are getting hacked

charred pilot
#

well i asked a kids

#

and he said

#

he can hack someone by watching their stream on discord

#

like is that even possible?

#

im completely new to python i have no idea id it possible or not

prime bobcat
#

lol

#

just stop listening to him

charred pilot
#

so its not even possible?

prime bobcat
#

im not an expert but i think that almost everything is possible

#

but time consuming for what?

#

stealing fb account from an 12 year old?

#

worthless

#

almost every account right now uses 2 step verifications

#

like your cellphone

#

hello File

wise loom
prime bobcat
#

Is something wrong with this?

#

`import math

G=6.67pow(10,-11) #Universal Gravitational Constant 6.673 x 10-11 Nm2/kg2[4]
M1=5.98
pow(10,24) #Mass of the first Object
M2=70 #Mass of the second Object
D=6.38*pow(10,62) #Distance between the two objects.

Step1=M1M2
Step2=Step1
G
Step3=math.sqrt(D)
Step4=Step2/Step3
Result=Step4

print(Result)`

whole bear
#

Can someone explain to me what a function is

hardy viper
#

something that you make to use a certain chunk of code over and over again throughout the code

#

usually used for big projects

gusty kindle
#

def myFunction(): [your code]

#

then you call the code by myFunction

#

a function can have parameters, like this:
def myFunction(param): [tab]x = param * 2 return x

#

then you would call it like myFunction(2) and it will return 4

somber heath
#

!e ```py
def times_two(v):
return v * 2

result = times_two(3)
print(result)```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.

6
cosmic bison
wise loom
#

@cosmic bison what's the question being discussed?

cosmic bison
#

running a concurrent processes with django I think?

wise loom
vocal basin
#

just ASGI + uvicorn

#

whatever the regular uwsgi does -- likely involves multiple workers too

#

for IO-bound task, ASGI will be better for most, if concurrency is the issue (as compared to WSGI)

#

for CPU-bound task, you shouldn't be doing them inside a web server

#

offload to a separate worker process, connect them via a message queue

cosmic bison
gusty kindle
#

o

shy raft
#

what happened lmao

cosmic bison
#

he was showing me a project he made

#

you working on your idioms lang?

shy raft
#

no idk what to add

#

yeah

#

no

#

how are ya

#

😬

#

ayoo

#

review this beautiful code @cosmic bison

valid_fruits = ['apple', 'orange', 'banana', 'kiwi', 'blueberry']
fruits = []
for _ in range(10):
  fruit = input('Enter a fruit (apple, orange, banana, kiwi, or blueberry): ')
  is_valid_fruit = False
  for valid_fruit in valid_fruits:
    if fruit == valid_fruit:
      is_valid_fruit = True
      break
  if is_valid_fruit:
    fruits.append(fruit)
  else:
    print('Invalid fruit.')

apple_count = 0
orange_count = 0
banana_count = 0
kiwi_count = 0
blueberry_count = 0
for fruit in fruits:
  if fruit == 'apple':
    apple_count += 1
  elif fruit == 'orange':
    orange_count += 1
  elif fruit == 'banana':
    banana_count += 1
  elif fruit == 'kiwi':
    kiwi_count += 1
  elif fruit == 'blueberry':
    blueberry_count += 1

print('Apples: ' + str(apple_count))
print('Oranges: ' + str(orange_count))
print('Bananas: ' + str(banana_count))
print('Kiwis: ' + str(kiwi_count))
print('Bluberry: ' + str(blueberry_count))
cosmic bison
#

can confirm, is code

shy raft
#

ikr

somber heath
#

@rare belfry 👋

rare belfry
#

hey

karmic sage
rare belfry
#

I don't have persmission to talk

somber heath
wise cargoBOT
#
Voice verification

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

#

:incoming_envelope: :ok_hand: applied timeout to @karmic sage until <t:1697339627:f> (10 minutes) (reason: newlines spam - sent 110 newlines).

The <@&831776746206265384> have been alerted for review.

somber heath
#

@worldly sinew 👋

#

@noble robin 👋

cosmic bison
#

I fixed the bug 😎

somber heath
#

@trail sphinx 👋

trail sphinx
somber heath
#

@storm furnace 👋

lavish rover
somber heath
#

@whole bear 👋

boreal abyss
#

!e

import numpy as np
import pandas as pd
speed = pd.Series([32,111,138,28,59,77,97])
mean = speed.sum()/speed.count()
variance = (((speed-mean)**2).sum())/speed.count()
#or
speed2= [32,111,138,28,59,77,97]
vary= np.var(speed2)
var=speed.var()
print(var,variance, vary)
wise cargoBOT
#

@boreal abyss :white_check_mark: Your 3.12 eval job has completed with return code 0.

1670.9523809523807 1432.2448979591834 1432.2448979591834
boreal abyss
#

????????????????????????

#

@tulip gyro it's very fun to use!

#

do you use c# or the godot language

#

how similar is the godot with python

#

?

#

@tulip gyro it's for learning

#

it's why physicists keep delving into smaller and smaller particles

vocal basin
#

then make a JIT-compiler to sometimes not run it on VM and make everything even more confusing

boreal abyss
#

(into the very small of string theory even)

#

or for mathematicans and foundation of math

#

@lavish rover you're my soul person

vocal basin
#

useful => can get relied on => sad situation

lavish rover
vocal basin
#

does something like haskell/f# allow to just do this instead of if?

condition "condition is true" "condition is false"
wise loom
#

Python with typehints?

#

or Rust?

lavish rover
#

it's my own language

wise loom
#

Ocean?

vocal basin
#

Ocen

cosmic bison
#

ocen

lavish rover
lavish rover
vocal basin
#

"even if you don't know language design, you can still contribute to, for example, documentation's CSS"

wise loom
#

The best way to learn something is to make it
-- @lavish rover

#

I disagree

cosmic bison
#

it is the best way to learn something. Just not the fastest or easiest

wise loom
#

Actually I'm wrestling with the temptation to build certain things just to understand them..

#

Studying code would be great if there were better tools to annotate code and to study code.
We definitely don't have enough of those

lavish rover
#

what spider said

#

it's not the most efficient if your goal is to just get a high level understanding

vocal basin
#

there isn't "the best" way at all, but usually making something yourself improves knowledge compared to not making

lavish rover
#

or even useful for most things

wise loom
#

@vocal basin I would rather find a good explanation of something instead of building it myself.

lavish rover
#

A good explanation will almost never give you a taste for all the actual real technical issues

#

it tells you what is being done, very rarely why it is, or why it is not done other ways

vocal basin
#

use the thing => learn what it needs to do (and what you'd need to do if you were to create it)
build the thing => learn how what the implementation challenges are
study your and other's implementation => learn how it affects the use and design

like, every interaction with the concept/system/etc. helps with other interactions
and there isn't a step-by-step guide to it (asynchronous learning)

wise loom
#

@cosmic bison I was expecting a percentage but okay

lavish rover
#

But also - there's a personal factor. I really enjoy the process of figuring out how to implement things - not just knowing how they work

#

it makes me understand the nuances and complexities of the issues, and why people might decide to do it a certain way

wise loom
#

for @cosmic bison it would be great to not take anything for granted, challenge all possible assumptions, write tests for them and eventually you should find the issue

vocal basin
wise loom
#

@lavish rover what's your test coverage? for the ocen language

vocal basin
#

measured in what?

wise loom
vocal basin
#

percentage of what?

#

lines? code paths? functions?

#

usecases?

wise loom
vocal basin
#

so, basically "lines"

wise loom
#

let's say yes?

lavish rover
#

I don't track it, I don't think that's really a meaningful statistic IMO

vocal basin
#

yeah, statement/expression/line coverage, even if too basic, is still useful

lavish rover
#

I also don't really have tooling to track it if I wanted to, considering my language is implemented in itself

wise loom
vocal basin
#

not necessarily UB

#

it's defined, just not in tests

#

and some things are inherently untestable

wise loom
vocal basin
#

IO isn't UB; UB, as a term, applies more to "you failed and the system is free to do whatever it wants"

vocal basin
#

"you can't unit-test IO" is basic level for issue;
many aspects (mostly, ones that anyone actually cares about) of a system require testing in a larger setting;
some IO can be tested by increasing the scope that you're dealing with (from unit to integration) but that also decreases the control;

wise loom
#

still IO test generation is performed using fuzzers

hasty blaze
#

@wind raptor ))

hasty blaze
#

im waiting you)

wind raptor
#

It's 5am here.

gentle flint
#

@hasty blaze

hasty blaze
gentle flint
#

echo cancellation

somber heath
#

@charred torrent 👋

gentle flint
#

the Netherlands

whole bear
#

can someone explain to me what a function is, i had to see it in videos and i didn't understand it very well

gentle flint
somber heath
#

!e ```py
def func(): # This is where we say this function is referred to by the variable, func
print('Hello.')
print('Goodbye.')

func() # This is a "call". It causes the function to run.
func()
func()```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | Hello.
002 | Goodbye.
003 | Hello.
004 | Goodbye.
005 | Hello.
006 | Goodbye.
somber heath
#

A function also has an "inbox" and a few different, but one main "outbox".

whole bear
#

def function() :
print ("hey ")
print("hey world")
function()
function()
function()

gentle flint
whole bear
#

He'll send Hey and Hey World 3 times

somber heath
#

!e ```py
def func(parameter):
print(parameter)

argument = 'Hello.'
func(argument)```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.

Hello.
whole bear
#

What's that inside Parameter

somber heath
#

A function can have parameters. These parameters are variables. The variables are assigned to the objects given in the call. The objects given in the call are called arguments.

#

Here, I call func. The argument, a string, 'Hello.', has parameter assigned to it within the function.

whole bear
#

I'm going to try to make something that has a function

somber heath
#

For later reading: The LEGB rule. Write it down.

#

Functions also have, as mentioned, an outbox.

#

!e ```py
def func():
return 123

print(func())```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.

123
somber heath
#

The object given to return, here 123, replaces the call to the function.

#

The call becomes/evaluates/transforms into the object returned.

#

The function still runs, but when it hits return, the object is passed out of the function and into where the call is.

#

When you hit return, the function terminates.

#

!e ```py
def func():
print('A')
return
print('B')

func()
func()```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | A
002 | A
somber heath
#

All functions that complete, return.

#

If nothing is explicitly given to be returned, the object None is returned.

#

!e ```py
def a():
'Code goes here blah blah.'

def b():
return

print(a())
print(b())```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | None
002 | None
somber heath
#

We see this in some other calls we can make, to print, for example.

#

!e py print_return = print('Hello.') print(print_return)

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | Hello.
002 | None
somber heath
#

We just don't usually assign variables to such function calls/their return.

#

Functions can also have more than one parameter. It can get complicated.

#

!e ```py
def add(a, b):
return a + b

print(add(5, 2))
print(add(50, 2))```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | 7
002 | 52
somber heath
#

Arguments and parameters are both separated by commas.

#

Though you can nest other structures that do have commas.

#

!e ```py
def func(a, b):
print(a)
print(b)

func((1, 2), 3)```

wise cargoBOT
#

@somber heath :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | (1, 2)
002 | 3
somber heath
#

I still have two arguments, it's just that the first one is a tuple.

whole bear
#

ty

somber heath
#

Making a bit more sense, now?

whole bear
#

yes

somber heath
#

Smashing.

gentle flint
whole bear
#

mods can i stream please

#

Is this a library and modules?

#

just import genius

#

But import just doesn't happen

#

@whole bear DONT LISTEN TO IT

#

its cringe

#

@dusky lynx im a mod

#

<@&831776746206265384>

obsidian dragon
#

@scarlet halo

original_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
chunk_size = 3
split_lists = [original_list[i:i + chunk_size] for i in range(0, len(original_list), chunk_size)]
hasty blaze
#

im still waiting you

#

@somber heath

#

come here

#

))))

somber heath
#

Stop.

obsidian dragon
#

@hasty blaze is there something you need?

obsidian dragon
#

@hasty blazeor are you just harassing poeple

hasty blaze
#

there was a problem

obsidian dragon
#

@hasty blaze describe the issue

hasty blaze
#

yesterday

hasty blaze
#

and stop tagging me

obsidian dragon
#

@hasty blaze @Chris is not the only person to give access adn try screen shots of code copy

hasty blaze
#

he is my friend

#

ok joint to the chat

somber field
#

!e

print('hello world')
wise cargoBOT
#

@somber field :white_check_mark: Your 3.12 eval job has completed with return code 0.

hello world
somber field
#

wait thatttt

#

omg

#

I wanna make this!

somber heath
#

@obsidian dragon We're all good here, thank you. 🙂

somber field
#

is the bot conected to a server that runs all the code????

hasty blaze
somber heath
hasty blaze
somber heath
wise cargoBOT
#
Bad argument

Unable to convert 'It runs something called Snekbox. It's a sandboxed environment.' to valid command, tag, or Cog.

somber heath
#

.source

viscid lagoonBOT
somber field
somber heath
#

!source

wise cargoBOT
somber heath
obsidian dragon
#

oui, what happened?

#

@somber heath are we friends? 🤩

vocal basin
#

#bot-commands

somber heath
hasty blaze
#

omg

somber field
#

!e

import time
while True:
  time.sleep(1)
hasty blaze
#

r u friends

wise cargoBOT
#

@somber field :warning: Your 3.12 eval job timed out or ran out of memory.

[No output]
obsidian dragon
#

I'll take it :dab:

vocal basin
somber field
#

?

vocal basin
#

do that there not here

somber field
#

sry

vocal basin
#

just to avoid clutter

karmic obsidian
#

hey hi @whole bear

#

u voice enabled?

whole bear
#

no

#

@karmic obsidian

novel tangle
vale swallow
#

Python tutorial for beginners full course
#python #tutorial #beginners
⭐️Time Stamps⭐️
#1 (00:00:00)​ Python tutorial for beginners 🐍
#2 (00:05:57​) variables ✘
#3 (00;17;38​) multiple assignment 🔠
#4 (00:20:27​) string methods 〰️
#5 (00:25:13​) type cast 💱
#6 (00:30:14​) user input ⌨️
#7 (00:36:50​) math functions 🧮
#8 (00:40:58...

▶ Play video
dusk raven
gentle flint
whole bear
#

?

gentle flint
#

Utrecht Hill Ridge (Dutch: Utrechtse Heuvelrug) is a ridge of low sandhills that stretches in a direction from southeast to northwest over the Dutch province of Utrecht and over a part of North Holland. The total length of the region is about 50 km. It covers an area of approximately 23,000 hectares. The part of the ridge in North Holland is com...

dry jasper
gentle flint
#

@terse needle

whole bear
#

birany

#

chicken binary

terse needle
#

Biryani

gentle flint
#

Biryani () is a mixed rice dish originating among the Muslims of South Asia. It is made with spices, vegetables, rice, and usually some type of meat (chicken, beef, goat, lamb, prawn, or fish). In some cases without any meat, and sometimes with eggs and potatoes.Biryani is one of the most popular dishes in South Asia, as well as among the diaspo...

dry jasper
whole bear
#

do anyone knows about sicprts on python

#

sicprts?

#

yes

#

you mean scripts?

#

how to fix that

#

:(

#

pip install requests

#

how

#

same problem

#

what i do :(

#

there is nothing we can do

#

nah

#

it's a money printer

#

loock at me username

#

3letters only

#

yes

gentle flint
#

two letters, actually

#

z, p

whole bear
#

two letters worth 50-10

#

100

#

yes

#

why

#

:(

#

bro:(

#

waaa

wind raptor
#

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

whole bear
#

it's a username man

#

i am not Japanese lol

#

:(

#

:(

gentle flint
vale swallow
#

212121 21212121

#

212121_21212121

whole bear
#

🥲

#

i joined right now

#

so that's why i cna't talk

#

i just wnaa get cool usernames

#

:(

#

you said you wanted to sell the usernames

#

i wnaa get cool one

#

i was seling

#

i sold 505_

#

1200

#

$

#

:)

gentle flint
whole bear
#

lol

#

i am just asking for a fix not a project

#

yep !

vale swallow
#

age=14

#

age = 14

whole bear
#

sus

#

! text

gentle flint
#

def x(age=14):
pass

whole bear
#

xDDD

#

HE said it

#

he said it

#

i am from the middle east soo ....

#

how to fix my problem guys do u know a disocrd server or smothing

#

:(

#

i need to send 50 massge to just talk

#

beacuse i am new

#

lol

#

@pulsar light

#

where u from

#

:)

#

i know it

#

i am from plastine

#

hahah

#

:)

#

<3

#

hbibi

#

same

#

ofc

#

my honey

pulsar light
#

habibi

whole bear
#

yeah

#

i am living on jordan right now :(

pulsar light
#

dude the world is bad rn

whole bear
#

yeah yeah

#

true <3

#

i am sad about the people on G

#

but i am on jordan

pulsar light
#

yeah bro )

whole bear
#

u know

#

a safe palce

#

better than gaza

pulsar light
#

alhamdulilha

#

lets go dm

whole bear
#

k

gentle flint
#

Snarky Puppy feat. Väsen - Shapons Vindaloo
From Snarky Puppy's live CD/DVD - "Family Dinner - Vol. Two"
Stream/Download/CD/Vinyl: https://orcd.co/familydinnervol2
©GroundUP Music 2016

Written by André Ferrari
Arranged by André Ferrari, Michael League & Snarky Puppy
Recorded and filmed at Esplanade Studios in New Orleans, LA, February 12-14, 2...

▶ Play video
vale swallow
#

human = "false"

if human = "False" print("i am a robot")

wind raptor
#

:

vale swallow
#

if:human = "Flase"

#

print("i am a robot)

whole bear
#

flase

wind raptor
#

!e

human = "false"

if human == "False":
    print("I am a robot")
else:
    print("I am a human")


human = "False"

if human == "False":
    print("I am a robot")
else:
    print("I am a human")
wise cargoBOT
#

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

001 | I am a human
002 | I am a robot
wind raptor
#

No problem

gentle flint
rare epoch
#

what is

#

happend

#

this

#

i cannot talk in the mic

#

tf

#

haha

#

its funny why is this happening

wind raptor
wise cargoBOT
#
Voice verification

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

whole bear
#

did you just open your home directory in vscode?

cosmic bison
#

?

whole bear
#

I've read all this and I know at least what I'm doing now? Variables and Data Types
Control Structures
Functions
Libraries and Modules
Problem Practice
Small Projects
Study the documentation
Learn How to Debug
Python Community
Advanced Language
What's the next thing I should do?
object oriented programming, i.e. classes

I would like to do 2 things but 1 has nothing to do with Python and another I don't know how to do
I liked to create a website or a program
(I don't know how to create this)

cosmic bison
#

What kind of program would you want to create?

#

Also, have you actually written any code?

#

even doing print("hello world")

whole bear
#

I've written some basic ones

whole bear
cosmic bison
#

you have to decide that first. Is it a terminal app or GUI app? What will it do? etc.

whole bear
#

What's the difference

cosmic bison
#

Terminal app is just text in the console. So basically just uses print and input

#

GUI is what most apps you use have. GUI is a Graphical User Interface. So it has buttons, text, tabs, headers, images, sliders, etc.

#

GUI is a lot more difficult. But python does have the Tkinter module for making very basic GUI's

whole bear
#

Which one do you recommend

cosmic bison
#

how long have you been writting code?

#

and what level experience would you rate yourself? beginner, noob, novice, intermediate, advanced?

whole bear
#

Short time

cosmic bison
#

okay. I would recommend making simple terminal apps then

whole bear
#

beginner or noob

cosmic bison
#

after a few simple projects, you should take a look at tkinter for basic UI

#

when you get comfortable doing both, then just research whatever you want from there

#

you could lookup how to make discord bots, website backends (using django), more complex UI with pyQT/pyside, More complex terminal apps using curses, sockets, or anything else that interests you

#

learning a bit of pygame is a good way to start learning more stuff while still keeping it basic. But do that once you feel comfortable making a few basic tkinter apps on your own.

whole bear
#

what is tkinder and can give me code suggestions to create

cosmic bison
#

you could create a basic GUI calculator app. That is a good first project for tkinter

whole bear
#

what is tkinder

cosmic bison
#

it is built into python. It lets you make GUI's

#

you just do import tkinter

whole bear
cosmic bison
#

that is what it is

whole bear
shy raft
#

start simple

whole bear
#

ok

#

your game?

cosmic bison
#

probably don't do that yet

#

but when you feel comfortable that could be a cool project

whole bear
#

I try to make a calculator or I try to create basic codes

cosmic bison
#

try to make a calculator with tkinter. That is a simple project that should help expand your knowledge

whole bear
#

I don't know how to make calculator

cosmic bison
#

That's the challenge

#

you need to look up how to use tkinter

whole bear
#

and now?

cosmic bison
#
#

hundreds if not thousands of tutorials on tkinter

#

take that knowledge and then use it to create your calculator

#

I can't just give you the code. You won't learn that way

#

if you have a specific tkinter question then I can help. But if you don't take the first steps, I can't do much

whole bear
#

I'll try to do the calculator every day

#

thank you for suggest

shy raft
#
import random
password = random.randint(0, 100)
cosmic bison
#

@shy raft would it be weird to have __putdiv__ as an equivalent to __idiv__ in my lang (and the same for all the other inplace ops)

shy raft
cosmic bison
#

okay cool

forest yacht
#

@shy raft Cant talk yet

#

Need 50 messages

shy raft
#

ah ok

whole bear
#

@cosmic bison Is Tkinter used to create the window?

spark wolf
#

I want to make it so my command will only work with people in allowed.json but idk what to put in either

cosmic bison
whole bear
#

Spider I have no idea how to create a calculator

cosmic bison
#

look up how to use tkinter

#

follow those tutorials. Use the stuff you learn

shy raft
#
import your_mom
spark wolf
#

I want to make it so my command will only work with people in allowed.json but idk what to put in either

whole bear
shy raft
#

its just a calculator

#

im sure you've used them at least 100 times

whole bear
#

Yes, I use it and have used it many times but I don't know how to program a cal

hardy viper
#

instead of doing calculator

#

i decided

#

to create a gui for a login system that would log you into an image rescaler

#

as my first ever project

whole bear
#

It will take me a long time, even months, to create a calculator

#

But I will get it

hardy viper
#

i dont think so

#

think about what a calculator does

#

what do you do

#

when youopen the app

whole bear
#

I do math

hardy viper
#

and how do you do math

shy raft
#

S1. Why don't programmers like nature? It has too many bugs.
2. Why do programmers always mix up Christmas and Halloween? Because Oct 31 == Dec 25.
3. Why do programmers prefer iOS development? Because on iOS, there are no Windows or Gates.
4. Why did the programmer go broke? Because he used up all his cache.
5. Why was the JavaScript developer sad? Because he didn't Node how to Express himself.

#

There are 10 kinds of people in the world. Those who understand binary and those who don’t.

whole bear
whole bear
#

I'm going to start studying tkinter

shy raft
#
while True: # based
  pass # super based
#

bai

hardy viper
#

you input

#

you get one button to run the command of its corresponding number

#

and the operators the same

wise loom
magic basin
#

oh

nocturne sail
#

oh

#

hi

cedar briar
#

@nocturne sail here

#

Yes

#

Hello

magic basin
#

@cedar briar whats up

trail kite
#

hello

#

Just tryna learn some python

#

I'm doing functions right now and calling them

magic basin
cedar briar
trail kite
#

but having trouble with knowing how to call them

nocturne sail
#

im not a coder at all, im an electronics engineer by profession and im currently working on a script to toggle tags bits in the PLC, i just need little help

#

@cedar briar

magic basin
#

@cedar briar what kind of project would be great for working on and learning from? in python

magic basin
#

@wise loom what is the Channel # for the exercises

#

o

wise loom
nocturne sail
#

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

nocturne sail
magic basin
#

sweet! ty @wise loom

nocturne sail
#

@cedar briar can you see

cedar briar
#

Yes. Send it to me over a DM. I'll take a look at it later. Gotta sleep in some time.

nocturne sail
#

@wise loom i also send you the code

wise loom
#

yeah I had a look, looks like you want to use threads..

sage cape
#

hello is anyone up to help me rq

#

@dire folio

#

hey can u help me rq

dire folio
#

you should not ping people randomly, we have a help system for this. bu what do you need help with?

#

i have a moment

sage cape
#

Sorry

#

itll be quick

#

do you know why I get a permission denied error

#

for this?

#

I mean it works for another folder in the same directory so

#

idk why it just wont work

dire folio
#

I dont know, never used that package before. maybe the folder name parses incorect, maybe it needs to have a file like object instead of a string, since strings easaly breaks on windows

#

or maybe it needs the file and not the folder

#

maybe you dont have access to that folder, there are many things that can go wrong

sage cape
#

But I have the same access to another folder in the same directory

#

here look

#

I used Bias 0 sec 9_27 before and it worked but when I put the same line of code as before here, it just doesn't grant me permission regardless of the folder name

dire folio
#

well if you used it before, then that folder is now locked to that instance where you used it

#

you cant have two applications working with the same data

#

restart your computer and try again

sage cape
#

but i was under the impression that they weren't the same data. After all they are different FOLDERS

#

Let me restart my computer rq

dire folio
#

well, permission errors can be many things, instead of having me guess, you should just restart and see

sage cape
#

I am still getting the same error @dire folio

#

I am very worried

#

I dont know if this suggests the project is like, corrupted maybe?

dire folio
#

#❓|how-to-get-help is a great place to ask for help, maybe someone knows, but do share what your doing and using

dire folio
#

or, windows issue

#

it might be code issue as well, but i dont know what your doing, you should share that as well in a help thread

#

third party file reading packages are hard to troubleshoot when you dont know what they are

somber heath
#

@craggy sundial 👋

craggy sundial
#

@somber heath hello there. I'm new here. do not have permision for voice chat yet

wise cargoBOT
#
Voice verification

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

craggy sundial
#

reading now the instructions

#

@somber heath ahh ok. I just joined yesterday , so not yet 3 days. and I'm sure I didn’t have 50 messages on the server aswell by now

#

@somber heath I need help 😄

#

I am creating an small ecomm with django and htmx + tailwind and I have problems with stripe webhooks

somber heath
craggy sundial
#

@somber heath my app is saving different payment_intent_id in the database than the one stripe is asking for

somber heath
craggy sundial
#

@somber heath very complex this Discord channel ... a lot of options 🙂

#

@somber heath what is your main field ?

#

@somber heath so instead of photoshop you are using python to manipulate images ?

#

@somber heath I am trying to do everythin and I'm good at nothing. still looking for the exact path of IT that I m loving the most and will choose one

somber heath
#

@daring wind 👋

pine ridge
#

Hi

somber heath
#

@pine ridge 👋

pine ridge
#

i cant speek

#

the server block my micro

somber heath
#

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

pine ridge
#

!voice

#

i have not 50 messages ^^

#

sorry

#

whatsup

#

Do you now linux server

#

but

#

i try to install a website

oblique ridge
#

Ctrl + S

pine ridge
pine ridge
oblique ridge
#
    def __repr__(self) -> str:
        repr = "\n"
        for r, row in enumerate(self.grid):
            repr += " "
            for c, digit in enumerate(row):
                if not digit:
                    digit = "."

                repr += f"{digit} "
                if c % 3 == 2:
                    repr += " "

            repr += "\n"
            if r % 3 == 2:
                repr += "\n"

        return repr
#
>>> grid = [
...     [5, 3, 0,   0, 7, 0,   0, 0, 0],
...     [0, 0, 0,   1, 9, 5,   0, 0, 0],
...     [0, 0, 0,   0, 0, 0,   0, 6, 0],
...
...     [8, 0, 0,   0, 6, 0,   0, 0, 3],
...     [4, 0, 0,   8, 0, 3,   0, 0, 1],
...     [9, 0, 0,   0, 2, 0,   0, 0, 6],
...
...     [0, 6, 0,   0, 0, 0,   2, 8, 0],
...     [0, 0, 0,   4, 1, 9,   0, 0, 5],
...     [0, 0, 0,   0, 8, 0,   0, 7, 9],
... ]
>>> sudoku = Sudoku(grid)
>>> sudoku.solve()
>>> print(sudoku)

 5 3 4  2 7 6  9 1 8
 6 7 8  1 9 5  3 4 2
 2 9 1  3 4 8  5 6 7

 8 5 7  9 6 1  4 2 3
 4 2 6  8 5 3  7 9 1
 9 1 3  7 2 4  8 5 6

 1 6 9  5 3 7  2 8 4
 7 8 2  4 1 9  6 3 5
 3 4 5  6 8 2  1 7 9
#
    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),
            )
        )
``````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}
#
                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)
                    ]
                ):
``````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}
somber heath
#

@versed bane 👋

wise loom
#

Very interesting site collecting benchmarks for many software packages

versed bane