#python-discussion
1 messages ยท Page 543 of 1
Gnome
Gnome
it used to
man imagine dwm
I mean honestly I will straight up leave the editor and just use neovim
i buillt a hand tracker that makes it so that if i put down a finger in irl it does it with a mechanical hand in build a boat for treasure in a roblox game for a project with media pipe
@velvet trout
You were right. It was always Roblox.
That's why I never tried it ๐ญ
i dont play roblox it was js for the project
i saw it on tiktok
dont bother urself with costomization, use tty
Customization is cool
customization?
Even my Termux is customized muahaha
what are yall talking abt?
im thinking of trying it out but idk if theres any patch for a i3 tab layout
Linux larpinn
k
Customisation to make it apparent on the calendar pop up about week days within the awesomewm configs.
The guys never made it possible. ๐
I changed the font to Jetbrains-mono-nerd and customized the prompt with oh-my-zsh
To make it look bolded
xD
@raven urchin @toxic smelt @silent fable hi!
Hello!!!
Yoo
how you all doing, i see that you building roblox mods or something
while true:
termux-api-[phone number] "Message"
(i'm not into roblox though)
๐
No hi to me ๐/jk
It was @undone isle
hi to you!
@raven urchin i am so right
all larps need to have a server
HAHAHA
mods?
wahtever
Yoooo!
Not sure about that one. You gotta figure it out it seems.
But at the end of all that, you can make your own anyways

๐
Seed & Syntax
For some reason, i read it as C & Syntax

He's Seedy
EXACTLY
use openbox
well i also made a python program that has a face scanner and hand scanner and some other things dm me if you want the code to try it
i did too
ok so... does anyone here even use python
C is peak, I mean just look we got python from it
me!
even tho we in python server
what it does
Hello, I am the Python learner
So its not just me .. i thought my brain is overly pattern matching lmao
I know it
same
its just a cool thing to try
๐
so uhh joined the discord to learn python (FULL BEGINNER LIKE PRINT HELLOWORLD TYPE OF BEGINNER) and joined to sorround me with people that knows what they doing. i dont really know what to do tho...
hello i am a python major
I even read ART's name as Android Runtime (which he confirmed to be right, that was an intentional reference)
post the code in here
alr
welcome!
or a link to it
Python is peak too,thats why im macro abusing in C to make a for from Python into C
!code
Welcome :3
What
!learn @stoic wigeon a good suggested set of things to begin with
Here are the top free resources we recommend for people who are new to programming:
- Automate the Boring Stuff โ an online book (also available to purchase as a physical book)
- Harvardโs CS50P course โ video lectures (slides and notes provided) with exercises
- Python Programming MOOC 2026 course โ text-based lessons with exercises
- Corey Schafer's YouTube playlist
For a full, curated list of educational resources we recommend, please see our resources page!
I haven't tried CPython nor Cython... Had looked at it once like in the past, 2.5 years ago or smth
do yall know bash
Lol
CPython is just the name for the regular Python interpreter. Cython is something else, though
sure ill try those, thanks!
the president?
Uno Reverse card: asking Python Devs if they've ever written CPython
the code is to big lol
I just chain commands, don't know how to actually make complicated stuff with it
I am thinking of parsing it next time
Use !paste
Oh ok.
I learned about Cython when trying pypy
I have a book from Eric Matthes on python. Such a legend.
!paste
So that everyone can easily read your code, you can paste it in this website:
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.
Writing C files from python now, are we?
interoperability is a thing, yes..
does anyone here even use windows lol
I know it. Not extensively but enough to make simple programs.
I do
Most people do, this is just a larper meeting
same
many probably, i do
Win11
they are not interopping, just a foreach macro rather than an index loop
Interesting life choices...
But it's just automatically open powershell and start neovim in it.
I dont , on main pc i use mint. Eh i wanted to escape microslop
here it is
Hi
Why don't you install Alacritty on Windows?
Hiiiiii
i feel like the convos here are more abt general pc knowledge and os than actual python
Dang one class fits all thingy
I use Arch on main, Debian on server and Alpine on VM. I'm the full larper.
fr
How's it going?
Pretty good, hbu
it took me a few hrs
Unable to sleep
i use mint on main, larp on arch and devuan
like 8
Try segregating based on SOLID as a refactor challenge.
uhm what does that mean??
Want to read but too tired
He usually does that, dw. He speaks some kind of clanker language
lol
Let me simply fetch a portion of my notes on it
lets see who larps the most, tell me os and wm
That's wrong those are legit things
Alpine
TTY
Clanker is shit
w larp 9.9/10
LMAO HAHAHA
anyways im trynna get into a college when i grow up but i need a 4.3 gpa as a minimum ๐
yeah i dont understand why would someone do that in C either
American kinda stuff. My college had 0 requirements for getting into it.
im kinda bored
I've met the dumbest people ever here. Funny.
im not american
techincally you need 22.3 merit which is swedish gpa
You're swedish?
yh
Cool
you?
Five SOLID principles
Single Responsibility (SRP): A class should have only one reason to change, meaning it has only one job.
Open/Closed (OCP): Software entities should be open for extension but closed for modification. New functionality should be added by writing new code, not altering existing code.
Liskov Substitution (LSP): Subtypes must be substitutable for their base types without altering the program's correctness. Any code using a base class must work with an object of a derived class seamlessly.
Interface Segregation (ISP): Clients should not be forced to depend on interfaces they don't use. It's better to have many small, specific interfaces than one large general-purpose one.
Dependency Inversion (DIP): Depend upon abstractions, not concretions. High-level modules should not depend on low level modules; both should depend on abstractions.
Dominican
nice but im still trynna read what @toxic smelt just said
i feel like u used ai for that
It is gonna make your life easier
dude im 13 i dont understand anything
Those are stringent definitions bruh ๐ญ
heres some larping quotes : โI donโt use a computer. I command it.โ
โIf it has a GUI, itโs already too slow.โ
โI donโt break my systemโI recompile it.โ
โMy OS doesnโt crash. It politely informs me of my mistakes.โ
โReal users donโt click. They type.โ
your making my brain explode @toxic smelt
surely you can understand
A class should have only one reason to change, meaning it has only one job.
LARPers will larp.
you definitely used ai
First one is the 14 year old who just learned how to print Hello World
Let's keep this channel focused on Python pls
He just has a whole wikipedia of Obsidian notes
https://www.digitalocean.com/community/conceptual-articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-design
maybe the peeps at digitalocean did?
r u tlkng about me?
We are
I will put it simply then
The point of this is to make sure you are making it compliant to OOPs principles. Which makes code easier to maintain.
ok uh ig letss talk abt python
them the facts
Talking about random computer-related quotes is not
ohh k
Did you pass it through some filters online?
I said print Hello World 
okk
ok bye i gtg
Or did you assess the definition's correctness? Because I will value the latter here.
it's not python, because Pyrhon is
print("Hello World")```
cya
haha, assess
print("Hello World!")
helloworld("print")
YES
helloworld = print
print = "Hello world"
helloworld(print)```
hmh
Dependency Inversion (DIP): Depend upon abstractions, not concretions. High-level modules should not depend on low level modules; both should depend on abstractions.
how is that supposed to be done? i mean, you can introduce a step inbetween, but then there is still a module the purpose of which is to provide higher abstraction and it depends on a low level one
I just passed it myself and it returned nothing.
python when printing: print("Hello world")
C++ when printing: quhfiqkhfiuqfjoiuqbjfukhqfqoubihfohqbyfhjnqofubiqufhjiuqhfouqbijqufqifhqufhqiuhfoqihfuqhfouqiofbqiufnoqufiuqfiugqhfogqyuofgiqyufhqiyfgiu2grfqiufuiqhfouqhfouqfouqhfoquijfqnfuioqnfuqnfoqifhqonfioqfoiqnfouqnifoiqnf("Hello world!")
assert has_brain == True```
(should abstractions also depend on abstractions?
)
Imagine doing CAD or sculpting with a keyboard
- Don't flood.
- C has its reason to be complex, not really comparable.
I was just expanding my notes to that part.
Till now I went to the Liskov section only.
fair
I will check upon DIP and perhaps get it out
๐ค
#include <print>
int main() {
std::println("Hello world");
}
c++23
tbh just puts if you dont format
almighty libc
isnt it include iostream or smth?
if you want to use streams rather than print sure
iostream is for std::cout and such
But this shit about SOLID is based on some source of Robert C. Martin and so far those 3 are mentioned.
i dont rlly know any c lang
def hello_world(foo):
print(f"{foo}")
hello_world("Hello World!")
i only know python css html and lua
Are you by any chance a roblox dev?
f"{foo}"?
i like DI-ing streams rather than hardcoding std::c(in|out)
so like
a function will take the output stream
and then i call it with stdout
C is not complex in any way, it's quite simple, in fact
(unless, idk, we count emergent complexity originating from macro abuse)
i mean i hop on studio one and a while but not rlly
I usually do this too lmao, redundant f-string for the win
What do you use lua for?
I was confused too when I saw DIP, because I heard about it in like... Freaking web dev uni classes when using Angular lol
recite the entire C23 standard

Idk couldn't find a better parameter name
nothin rlly just lor learning
(don't ask me angular I forgot)
print(f"{foo}") is equivalent to print(foo)
I think she meant that you didn't really need an f-string there
Anyways, I will compete these notes
Oh that's actually true mb
Right now it is freaking 2 AM
I do the same thing lol
_BitInt(65535) on my C23 till Segmentation fault (core dumped)
for me its 10 pm
def hello_world(foo):
print(foo)
hello_world("Hello World!")
Yes
Lol I guess it's a given
๐ I had typed out the exact same message
eta reduction
inlining
2200 hours. Peak time to procrastinate on discord
True
Eta what
fr
i tried it and it works lol
In this context, it means depending on an interface instead of implementation.
Both should
ik
ah so like Iterable instead of list whatever
yeah thats good
F strings are legendary like I have used them so manyyyy times unconsciously.
That even my C compiler goes, "bro, stop putting f character there"
LMAO
what are f strings?
F strings are indeed great
!f-string
Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.
>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."
Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.
It's supposed to be printf("") not print(f"")
wait
like i know what it is just what is it used for
Exactly
My compiler screams me that /j
I'm surprised I haven't done the same thing in go
erm well actually it's equivalent to print(foo.__format__(""))
state = "weird"
print(f"something is {state}")
Prints : something is weird
oh wait just to like combine strings and values
This is C and Python
This is much better
Yes
There is also printf()
Go has Printf too
im gonna learn asm soon
!e
class Duck:
def __format__(self, spec):
return "quack"
duck = Duck()
print(duck)
print(f"{duck}")
:white_check_mark: Your 3.14 eval job has completed with return code 0.
001 | <__main__.Duck object at 0x7f75b32786e0>
002 | quack
Or the least liked way to do it
foo = "boo"
print("You are" + foo)
Duck object
Copy cat Go
type(foo).__format__(foo, "") actually
But alright
Go go power rangers
Dangggg
well
not really because it doesnt use the type variable from the current scope but rather the one "baked into" the interpreter
true
Bruh ๐ญ
maybe foo.__class__.__format__(foo, "")?
can you override class such that type(foo) and foo.__class__ will differ?
!e
class NerdLevel3:
def __getattribute__(self, arg):
if arg == "__class__": raise TypeError("nuh uh")
else: return super().__getattribute__(arg)
nerd = NerdLevel3()
print(nerd.__class__)
:x: Your 3.14 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m7[0m, in [35m<module>[0m
003 | print([1;31mnerd.__class__[0m)
004 | [1;31m^^^^^^^^^^^^^^[0m
005 | File [35m"/home/main.py"[0m, line [35m3[0m, in [35m__getattribute__[0m
006 | if arg == "__class__": [1;31mraise TypeError("nuh uh")[0m
007 | [1;31m^^^^^^^^^^^^^^^^^^^^^^^^^[0m
008 | [1;35mTypeError[0m: [35mnuh uh[0m
hmmh
how to reliably access the type
without using a global
Stop making my man as verbose as Java please ๐ฅบ
type = True.__class__.__class__
oh thats cute yeah
Just pass the type explicitly
Just
class YoLo
...
Coding 100
functional programming of balls
What-
starts beatboxing
https://youtu.be/0ebreGjhEvo
Even Java dev won't want their code this verbose.
lloll
does anybody know if you learn python in robotics science colleges
look up the curriculum of the college in question
ok
yk, I always wondered what's the purpose of !s format specifier, but it turns out that without it, it would call __format__ if it's defined, with !s it ensures __str__ is called
that's right https://stackoverflow.com/a/72449614/10295729
for some reason f"{x=}" seems to call repr rather than format?
that's because it's intended for debugging I think
makes sense
print debugging ๐
is it true that you can follow somebody on tiktok in kali with a command
follow as in stalk or doing the same thing as clicking the follow button?
follow button
you can do that, doesnt really require kali as it's not necessary
Fixed by doing f"{x=:}"
yh but i saw it on mr robot
Or as I like to call it: Reverse walrus ๐ฆญ (I know that's a seal, sue me)
jesus christ
lol
@bright shoal they're yours now
Well, I think I don't have an exam on Saturday anymore
My teacher was kicked out of my university.

Sharing the story may be legally inadvisable.
she probably said "Python is Slow"
I mean, I assumed they weren't directly involved in the teacher getting kicked out and have a nondisclosure clause in a settlement. But maybe that's a false assumption
That topic isn't Python-Discussion friendly
But from Saturday on, I'll be 100% focused on Python until I have class again hehe.
They said python was slow and AI will steal all our jobs. I heard they even went manic and told everyone we are doomed because we pioneered skynet./s
Yeah, he vibe coded a Roblox cheat too
Oh... That jerk...
taught all the students how to write a python stockmarket trading bot where they did a 50/50 split with the students. but then they lost everything on memestocks.
hi i need help changing a simple link in my python code but i cant find where to change it, is there anyone that can change it for me
was the code ai generated?
it always fetches from a specific link, but i just need it to auto fetch from a different link,
nope
it was made by someone i ws once close with,
BUT we are not aqcuainted anymore
basically it scrapes my tourney mode page on a game from a website
share a link to the code, or cut/paste a few lines where the link is, and explain what you need
oki so basically, the guys who own the site game api changed their site recently, and instead of dev.uniteapi.dev its now uniteapi.dev
if you need to share a lot of code or post a screenshot make a thread in #1035199133436354600
seems like a relatively simple change, can't you just change the text?
i dont know how to
its something i use a lot for my game but i have no euh good knowledge
anyway, I'm out. let me know if you paste a link to the code or open a thread in #1035199133436354600
i have been remaking a previous code of mine and i would like to know what you guys think(its not fully complete and rn i dont have the newest vertion as i do it in school)
new : https://paste.pythondiscord.com/XIGQ
old: https://paste.pythondiscord.com/NW2A
whats up chat
js chillin
looks like you're off to a good start!
I would suggest
(1) learn about dataclasses
(2) learn about pathlib
(3) use ruff or something to auto format your code. (or at the very least add a blank line between functions)
(4) not a big fan of the "----classes/functions" etc style comments.
but looks like a nice start!
what is ruff?
https://pypi.org/project/ruff/
pip install ruff
checks your code for you. linter and code formatter
can i use it with thonny?
it shouldn't care what ide you use, so yeah.
seems like a fun lil project.
ruff --help
ruff check will check your code
Ruff can also fix sometimes and sometimes safely/unsafely (though it will ask you explictly about that don't worry)
ruff check or ruff format
you can enable/disable some ruff rules as you would like to
well yh but like do i use it inside the code or in a diffrent code to check the code i am coding
--isolated?
yeah
you gotta check cli args it takes, do ruff --help or go to astral docs of it
ruff check /your/file.py
before you run/build your code, you can run ruff on it.
ruffening your code
so like in the terminal thing do ruff --checl
k*, yes
Anyone knows how to code a re-run programm when a condition is satisfied?
loop.
so don't include that in the loop?
Modularize or into small functions
Wydm?
Can't help much without actual code implementation
welcome()
while True:
rest_of_code()
if not condition:
break
print("g'bye")
print(eval(input()))
this is the entire calculator
Yh but eval is not secure, i heard
good , so you know
eval will let you shoot yourself in the foot, but only if you let it. It can be used effectively in controlled circumstances. eval input is not safe though.
Why are you guys still trying to manually code when claude exists?
Then you're more supposed to write code than relying on eval
Check rules
ruff check mainfunction.py
File "<stdin>", line 1
ruff check mainfunction.py
^^^^^
SyntaxError: invalid syntax
what am i doing wrong?
why are you still talking to people when claude exists?
because brain need training
Lol
I write better code than AI. AI code is generally weak, and introduces huge security flaws.
you don;t use ruff in the REPL
In your terminal, that's a python REPL you're inside
since when does adobe illustrator generate code
it is still important to learn to code. To best use AI tools you still need people who know how to code at the helm
Exactly
Claude is an assistant, not a programmer replacement lmao
is it the same with format js ruff format codename.py?
It codes better than a big percantage of programmers
who are actually in the industry
Yes, all commands of ruff, because its a cli program, it runs inside your terminal
Source? Evidence?
Idk, maybe its for the computer to understand what code ur talking bout or smt
why are you trying to convince us of this?
fwiw generating code is not the only job of a programmer / software engineer
Yea understanding networking is apart for sure
But knowning a lot of syntax is pointless now
You can call exit() or hit Control + D to exit and get back to terminal
Read the 10th rule
That's generally not true.
What is does do is generate code faster than a big percentage, and it generates code better than a lot of technical producers.
syntax of particular languages has never been the most important thing for a programmer to know
๐ who is gonna tell bro
Who's gonna tell bro ๐ฅ
seriously: why are you trying to convince us of this?
He needs to read the rules
@mighty bay have you used claude code? Did you like what it produced?
Especially the 10th one
talking about AI tools is not against the rules
its basically syntax and computer networking
He uses AI
Try c++, then ull wanna learn python
shlex
Interesting
What's shlex
!doc shlex
Source code: Lib/shlex.py
The shlex class makes it easy to write lexical analyzers for simple syntaxes resembling that of the Unix shell. This will often be useful for writing minilanguages, (for example, in run control files for Python applications) or for parsing quoted strings.
The shlex module defines the following functions:
Basically, a tokenizer for cli arguments
o
i rely on it for my cliargparse too
Until i write my own implementation
Im just a beginner so im wonder if ur talking in another language ๐ญ
You don't have to worry about advanced stuff when you're starting :b
I feel much happier using ast.literal_eval myself. ( @alpine dragon )
Whats that?
async def _internal_threshold[_T: _U = _V](/, _c: _T) -> _T: ...
See this and get scared, HAHHAHA
๐
!doc ast.literal_eval
It's an eval which basic only accepts expressions with constants in them - no access to variables or function calls.
ast.literal_eval(node_or_string)```
Evaluate an expression node or a string containing only a Python literal or container display. The string or node provided may only consist of the following Python literal structures: strings, bytes, numbers, tuples, lists, dicts, sets, booleans, `None` and `Ellipsis`.
This can be used for evaluating strings containing Python values without the need to parse the values oneself. It is not capable of evaluating arbitrarily complex expressions, for example involving operators or indexing.
Bro lied about being a beginner
Oh God, I AM scared.
HEHEHEHE
๐ญ
does ruff have a fix option or not, i searched it up it does but when i put it into the termianl gives a eroro
I can only do calculators, ive seen a lot more than that, its just that i cant write that stuff
You can configure ruff afaik
--fix
--show-fixes
--unsafe-fix for unsafe fixes iirc
Try to make a tictactoe
fwiw, rule 10 doesn't prohibit being in favor of AI
yh i do ruff --fix codename.py
Nah, cliargparse better
Then do it
ruff --fix rollfunction.py
error: unexpected argument '--fix' found
I think its ruff check --fix ? 
I think you should refer to docs
ruff check --fix && ruff format
Yeah.
Personally I'm only happy running
ruff check \
--fix --fix-only \
"--target-version=$ruff_pyver" \
--select "$ruff_fixes" \
where:
ruff_fixes=${RUFF_FIXES:-'D207,F401,Q003,UP004'}
andruff_pyver=${RUFF_PYTHON_VERSION:-'py38'}
I've got a personal fix script which does that, with a diff to show what was changed/mangled.
Holy Professional
I'm lazy. I just want to type fix some_filename.py
Mine is just a noob bash script:
.../projects/cliargparse $ cat ruff.sh
ruff check --fix --show-fixes
Bourne shell syntax. Basicly it runs ruff check --fix with a restrict set of fixes.
Same, if I've made a .autoformat file in the project dir.
You can't use it without my permission
Though I use yapf for personal code, not ruff or black.
Can I use it Mr Aji?
No
its for me only!!!
damn
๐
lwk ruff kinda seems tuff
wat
i gotta learn these two: dataclasses and pathlib, are they hard to learn?
its a liner and a formatter for python i found out about 15 mins ago
Super easy

how could i use them in my code? https://paste.pythondiscord.com/XIGQ
p = Path("src")
x = p / "abc"
Holy division operator overload ๐ฅ
Why do you have to learn them? They are easier to use if you build something with them.
no. they're easy to learn. pathlib is a simpler version of all the os.filestuff and dataclasses are a simper version of classes.
You using match-case wow
Looks like you already are
Path("thing.csv")? You should use __file__ or something like that as reference

is it bad???
I just have ruff scripted to run whenever I save in nvim
If you want to go all out on pathlib:
- with open('inventory.csv', 'w',newline='') as csvfile:
+ with Path('inventory.csv').open('w',newline='') as csvfile:
- os.remove("inventory.csv")
+ Path('inventory.csv').unlink()
Keep class names in PascalCase case.
Its basically every word's first letter capital and rest small
Me too lol
No, that's cool!!!

Why make complex object if you'll only use them once?

Isn't python convention snake_case?
Why not?
For variables, yes
for variables and functions yes, for classes its PascalCase
idk wtf pascal case is either
I explained it two words later
Ah, didn't see he referred to classes
Hmm... let's find out.
This is:
PascalCase
camelCase
snake_case
HelloWorld
Hello and World are two different words, each word's first letter is Capital
That's the PascalCase
ohhh
IIRC
Imagine,
class person: ...
person = person()
Meh... Types/classes using PascalCase seems easier to read and quickly map them what they are
No, no, I know, I just thought you referred to other stuff, not classes
๐
No. dataclasses are easy to start with, and pathlib's pretty simple.
Go has me thinking in camelCase and PascalCase as public and private ๐ฅ
This is why b-komachi went downhill ๐
Hey guys wssup

so does this simplify the code cuz it looks like it does the same thing?
It didn't ๐
B-komachi always goat ๐
Everyone Hail leading underscore convention ๐ฅ
I wonder what my mom will think after she sees my Ruby rice lmao
no thx
That assumes the code is next to the data. Real world utilities aren't like that - they're installed ... wherever, and usually operate in whichever working directory you're using.
I know bro is Object lover over functions.
Is there a way to like... hire someone to look at your code and give you pointers? Like a coach or something?

Better than that
#1035199133436354600 is free
!paid
Here? No hiring. But you can show your code in a topic in #1035199133436354600 and ask for criticism and suggestions.
!rule paid
I don't understand if you're correcting me or him lol
Sorry, mistyped the rule !
I should go and fix my errors instead of spying in here ๐ฅ
You, in a way. If the program expects to run in the directory with the data, just plain 'inventory.csv' etc is fine.
Thus:
cd datadir1
run the programme
cd datadir2
run the programme
I should do homework
The whole __file__ thing is for when you need to open soething which is colocated with the code.
Maybe default data or config etc.
I changed my terminology, operand -> positional
Now I have to update everywhere
when i finish writeng my code so that it runs in the shell, should i try and program it in smthing like pygame?
๐ฅ is it programming-based?
You should do what you wantt to do.
I say this because I've had problems doing so. I find it more reliable to use Path(__file__).parent / "thing"
.parent is goated
Yes. That is policy. You're saying "my data are in the same directory as the code".
But a general purpose utility will be run somewhere else from its code.
Nope.
I don't study anything programming related.
I'm a med student.
But this homework is reading 2 stories... ๐ญ
Can I have an example of this? I'm interested
So I have my answer. I wanted to confirm my hunch. It's a micro-optimization. That is all.
preocts @ synthwave ~
โโโถ $ python openit.py
Using built in (1_000_000 times): 4.61
Using Path (1_000_000 times) : 7.05
thanks I tried that.
Explain mitochondria
The powerhouse of the cell ๐ฃ๏ธ ๐ฅ
Write a table showing comparison between mitosis and meiosis
Real
Well, take the fix script I mentioned earlier. The code is in (as installed) my ~/bin-cs directory.
But I run it on files in some arbitrary project directory:
cd my-project-dir
fix some-python-file.py
right, I guess I had too narrow a definition of work. would asking for uni recommendations also be breaking the rule if unis aren't free?

No. You were asking about hiring someone to review your code. That's paid work.
Asking people to review it for free is fine.
Same for general advice.
Can you cure cancer with python xD
Aight, bet
That's the best question I've got so far lmao
xD
Technically Python has cured cancer already
๐ i thought snake was slow
Some pattern recognition AI detected cancer before it developed on a lady's mammogram.
Nice
That's the real good use for AI
Well, ML.
I think seeking out educational resources doesn't really fit the category of seeking out "work" but it won't happen again
But can your python cure a disease that existed 9383839 years ago that lasted for a 17 years?
No, seeking edutcational resources is also fine. It was the word "hire" in your request which breaks the rule.
The python would bite me and I'd die to the poison
luckily pythons aren't venemous
Really? They have a really venomous name.
๐ then you'd reincarnate as a baby of an idol with full memories and speech ability of an adult and pastlife
STOP HAHA
they just have a lot of teeth, and are very very strong
Me going back as the daughter of Ado:
Are they slow in real life too?? :D
they sometimes eat aligators, if I'm not mistaken
they're constrictors
do i convert my code to pygame at some point? https://paste.pythondiscord.com/XIGQ
ALIGATORS????
Erhmm, you start in PyGame.
well try and remake it in pygame
Evolution is scared after this seeing this stage ๐
Constrictors are pythons I think, but a python isn't necessarily a constrictor. The diamond pythons here generally just eat small prey.
i js dont know whether its worth the struggle yet
in florida. look it up, and you'll find some interesting stuff.
Oh God, I'll never got to Florida or Australia.
Why am i reading constrictors as constructors (dunder __new__) ๐ญ
HAHAHA
"Are there ways for people who are not employed in tech or in school to access informed mentors who will help them"
Trampin, the question was worded in a way that was misunderstood by others
here:)
regrettably we don't have something good for one-on-one mentoring.
But you can some here for help with specific things.
Hi goat
but we know your intentions, and welcome you with open arms
Why one-on-one mentoring when we have Open Source Mentoringโข?
sup?
I didn't mean "here" as to myself, but to the discord server
Ik, ik, still a goat
informed mentors means? Continuous private helping?
Yes
k lol
Lots of people come seeking either a direct tutor or someone to pair with for learning. We're poorly set up for both.
English has lots of implicit words lol
I don't think I'm goated tbh, why do you think so?
Shoomp helps me every night I ask him because he's a goat too
Or my parser too dumb
You're cool, you know a lot, that's a goat in my books
likely survivorship bias, but I've never heard or seen of pair learning ever working out really
fair
Pair learning?
key-value pairs ๐ญ .items() lmao
interestingly enough, there have been studies on pair programming in XP, that show that the productivity is about the same or slightly less than if they work as individuals
This probably belongs in an #ot but I should probably consider streaming dev work in one of the chats from time to time (maybe stream to Twitch/YT too)
Plenty of people are happier working with another person - immediate person to discuss with, no imposter syndrome etc.
I don't remember the study though
I do, I enjoy a lot studying with Shoomp helping me
what is a constrictor
the main benefit of pair programming is knowledge transfer
Type of snake
Constriction is a method used by several snake species to kill or subdue their prey. Although some species of venomous and mildly venomous snakes do use constriction to subdue their prey, most snakes which use constriction lack venom. The snake strikes at its prey and holds on, pulling the prey into its coils or, in the case of very large prey, ...
well, pair programming is a bit different than pair learning methinks, I suppose learning is implicit in pair programming
The downside is getting distracted by everyone questioning your life choices lol
accurate statement. I made a logical leap lol
There's even a boa constrictor
The boa constrictor (scientific name also Boa constrictor), also known as the common boa, is a species of large, non-venomous, heavy-bodied snake that is frequently kept and bred in captivity. The boa constrictor is a member of the family Boidae. The species is native to tropical South America. A staple of private collections and public displays...
Anaconda
technically yeah I guess I don't need a long term formal mentorship I just hear it widely recommended by youtubers. I think the fact that that is my primary source of advice is sort of the reason I am asking ๐
embeddable js in rust... of course
That project has the cleanest rust code I've ever seen, if you are comfy with rust, I highly recommend looking at it
Oh yeah, of course. The LARPers will larp.
Do these said YouTubers also sell courses or tutoring by any chance?
I don't even know how Rust looks like. Haha.
I told you I'll learn rust in some months after I get comfy with Go and Py
hmm, but has it ever worked out in an online form?
mostly just coffee over ssh tbh lmao
I think it's working for Saber
I am not elaborating I am already on thin ice ๐
coffee over ssh over ip over avian carriers
Saber as in the airway company?
@swift sparrow are you mentoring @raven urchin? (like is that what you would consider whatever you're doing, from your perspective)
Saber as in @raven urchin
ah, I see
YouTubers don't become YouTubers by spreading facts
Iโm about to start a new project. Does anyone have any tips regarding the planning stage ?
Not really mentoring but he helps me with Pyside when he's free
sure, again my problem is I am stretched for good respurces lol
Iโm gonna ask in the python help chat my bad
well, no plan survives the first contact with the enemy
that doesn't mean you shouldn't plan though
gather requirements, break project down into features, do a short informal design of things that are confusing (skip if nothing like that), code with good design in mind, refactor as requirements change. Test as you go.
You just start writing immediately??
I am an airway company? Wow
What kind of resource do you need? What are you trying to learn?
alias Saber = Ruby
Lmao
๐ญ
Pick either the easiest or hardest part and focus on that.
Thank you guys :)
that could work I guess, at least that way you're on the ground and see how things are starting to fit together and what needs planning where, what doesn't at the moment
Iโm just currently deciding on whether I would like for the project to be cli or gui based
Kinda what I do. I either scaffold it, and defer the science to later... or deal with the hard part
I feel like I would learn more doing gui as Iโve mostly done cli based stuff before but gui really hurts my head ๐คฃ๐คฃ
What's the project?
Start with the CLI. It's easier. Then add a gui later.
I've got a CLI tool with subcommands, and one of the subcommands is "gui".
when you are making technology decisions, you are in the "programming immediately" part, in my humble opinion.
secret ๐ฅน
oh hey, since we're talking about planning
god, do I need some resource for this, it's difficult to plan for a team or as a team as I'm finding out during this uni project we're doing
design should be technology agnostic (am I incorrect for saying this?)
Thatโs nice I like that
I donโt fully understand what you mean
making technology decisions early locks you into a solution
Depends on the design. You can absolutely design for specific technologies. In fact, you should at some point of the process!
Many products are designed according to the org chart of the engineering team.
you eliminate possible alternatives, and narrow yourself in.
Mostly meta skills really. I am at the point where I can make stuff that works but I can't answer "is it good, is there a better way, am I doing inefficient stuff". I did post in help here if you wouldn't mind taking a look to see what I mean:
https://discord.com/channels/267624335836053506/1501717282198388836
At some point, you must be focused.
So avoid planning too much ?
I see. I've read the C4 model, and I had an interesting conversation with a gray haired programmer about modeling architecture with the idea of technology decisions in mind, becoming that "focus". He argued it should be emergent, rather than planned. I'll definitely look into that though
As you look into it, be mindful of the extremes. "All technology level design should be emergent" is an absolute. Obviously it won't apply to 100% of the cases. The same goes for "All technology level design should be pre-planned". That doesn't work either.
Hol Horse?
Jojo's?
another thing to think about while planning: what decisions can be separated from each other? You are deciding between cli and gui, but there will be some code that is the same for both. Think about how to break the problem into pieces so that some pieces are independent of the UI
plans change, so you have to make a cost-benefit analysis of whether a lot of planning will be a good use of your time, versus how much time you spend planning on something that may be invalid in a few weeks time.
I would say, plan often and embrace change.
that is a good sounding rule of thumb. I'll keep it in mind then, thanks for the help.
Planning is essential, but plans are useless
i was just typing that out!
narrow=focus
Isn't that just how it works?!
The number of times I've gone into a project with "the plan" and come out six hours later with "the new plan".
(It's an Eisenhower quote!
depth first vs breadth first traversal ^^
I always assume the plan is solid up to where we've written code. Everything else is TBD until it's merged
Thank you all for the good advice I appreciate it
The German version is 'no plan survives first contact with the enemy'
I launched a small automation just this morning. By the afternoon, version three was in review.
Things change. Embrance it.
*embrace
embrance it :V
It's like RegEx.. "".join(re.findall("embrance", "[^n]")) 
That is wrong, but you get the point ๐
maybe its the combination of both
* "".join(re.findall("[^n]", "embrance"))
Turns out, I had it backwards. ๐คทโโ๏ธ
narrow but not too narrow
wide but not too wide
it definitely is. I've read a book a while back called "exploring requirements", and it has a good talk on it. I've experienced it myself a few times as well, for both extremes.
yea both extremes might not be the answer
definitely not fun experiences having constantly changing code vs using a clunky library when there's a better option out there
open closed principle is my enemy
Goldilocks and the three graph traversal theorems.
reading about it just now
the goldilocks rule talks about balance from what i understand... (haven't heard of it before)
What? I was making a joke about Goldilocks and the three bears...
1
yea, i saw the story
i didn't know of it before
It's also used to describe the survivable parts of a solar system
Oh, it's just a story about not liking the extremes
i saw that one here:
https://www.youtube.com/watch?v=CJmX1GwKMdA
i see...
If I must be forced to eat porridge, I do prefer it to be Just Right. ๐ฅฃ
.topic
Suggest more topics here!
Yes.
Hobby!
Also yes.
Shoomp :D
Yup
You use Python for Shoomp?
How touching
Well, I enjoyed Python a lot more thanks to shoomp :3
โค๏ธ
I've been investigating bits in my free time about stuff for the to-do list
There are packages for displaying markdown, that will be really useful hehe
for the list?
It would be really an advanced thing to do, but someday I'll try to make hyperlinks like obsidian
For the base tho, I've seen stuff about the widgets, also planned the layouts a bit
Ooh yeah that would be neat. In my mind I had a to-do list as just a really simple list of things
Have to see what's the style shit thingy about
Remember that my plan is to start simple and make it bigger! >:)
That's a good plan.
Like Vexel is doing with his Axiom text editor, that's a really cool project
Yeah, you could use a simple list as the main to-do selection, and then maybe you can add extra notes to that task
similar to Google Notes
Yessss
QListWidget can handle the main selection, or even QListView if you're feeling spicy
For now, the plan is:
Do all the GUI related stuff first, having proper display with a placeholder task.
Then make the tasks module with all the CRUD stuff.
Then make it cuter.
Then add fun stuff!
There is nothing more permanent than an easy solution, I think you should have deployed a full on kubernetes cluster with properly versionned microservices and a full on CI/CD pipline /s
I did post to help as per the advice here btw. Thanks for the pointers. If anyone could look my project over and help me develop good professional habits I would be thrilled.
I was lost after deployed
Don't worry.

modern meme lingo
Is it pronounced kuber-net-ees or kuber-neets
I like your name
I am soooo excited to start my lil project. :3
I hope I do well on these exams!
First options sounds better for me tbh
Or just kates if you spell it like k8s
You've got this!
ammm hi guys
Ty<3
how is thereee
thanks :3
there is fine
Step 0: uninstall discore
Step 1: install discord
*** is not a valid unpackable
Very interesting
Much Wow
Itโs on my todo list to set up a full CI/CD pipeline for my hello world app. uv, Jenkins, dockerfile, Ansible and kuber-net-ees
andd ammmm, i don't know how to speak En vro ๐๐ป๐๐ป๐ฅ๐ฅ๐ฅ

i try ๐ฅ
And except EnglishError
๐๐๐๐๐๐๐
English should be nuked in my opinion, colonial language fr. We should standardize speaking in Python. Explicit > Implicit.
My hello world is a monolith application
But I guess I could split it into microservices architecture
copy text... translate...
str.translate()
One pod that has the printed string and one pod that displays a string to logs
Communicating over http
after the translation, i completely agree

๐ค
What so you mean has the printed string ? You need to put it in a 3fnbcck normalized db and add a redis layer on top of that
i remember this exists
I imagine debian testing would be quite alright
!doc str.translate
str.translate(table, /)```
Return a copy of the string in which each character has been mapped through the given translation table. The table must be an object that implements indexing via [`__getitem__()`](https://docs.python.org/3/reference/datamodel.html#object.__getitem__), typically a [mapping](https://docs.python.org/3/glossary.html#term-mapping) or [sequence](https://docs.python.org/3/glossary.html#term-sequence). When indexed by a Unicode ordinal (an integer), the table object can do any of the following: return a Unicode ordinal or a string, to map the character to one or more other characters; return `None`, to delete the character from the return string; or raise a [`LookupError`](https://docs.python.org/3/library/exceptions.html#LookupError) exception, to map the character to itself.
You can use [`str.maketrans()`](https://docs.python.org/3/library/stdtypes.html#str.maketrans) to create a translation map from character-to-character mappings in different formats.
See also the [`codecs`](https://docs.python.org/3/library/codecs.html#module-codecs) module for a more flexible approach to custom character mappings.
but i don't know how to use it ๐ฅ
the word "testing" is an ick /hj
I would go straight to mongodb the superior persistent data store
I initially thought Python.org & Google Translate Collaborated for str.translate ๐ญ
I need to make sure my app is Web Scale
Same ๐ฅ
Understandable decision, but in that case http is not enough, you need atleast graphql
oh, i learning now vro, thx
Welcome vro
Deciding terminologies and keeping consistency between them is so hard, damn...
No I was think full SOAP with XML as the transport protocol
debian unstable is a more unstable option if you prefer that
I have been jumping over terminologies instead of writing the freaking real code
beat me there lol, wp
I wonder what the worst choice of transport protocol would be
Legit I do want to write a SOAP application some day to experience the fun
ahmmm, are u Native American or possibly British..?
Neither. I don't even like the concept of nationality. I directly subclass from modern HomoSapien
Depends if itโs only fully automated transport or requires a human in the loop
If the latter I would have some human doing a fax somewhere
Read up quickly on it, and wth
What not to do to not get banned?
maybe audio is feasible, we could do json and xml in different channels at once
not sure why this message made you think i am native american or british...
The world doesn't revolve around those two ๐ฅ
vro i wait the translate now
Ema listen to mozart now bye bye
Guys what is numerical methods and how does it apply to cs?
The violin ๐ป
On a completely different topic (for me anyway)
could reuse my old thing
https://www.ioccc.org/2018/algmyr/
2018 IOCCC entry algmyr - Most cacophonic
vroski what are you saying
He's saying... || meow ||
If I have just null on its own, is that considered valid JSON?
@lone harness vro u soo englisher
Who thought of two union operators as a delimiter for spoilers
surely shoving json and xml into two channels like these is cursed enough
Me no englisher bro, me japanese, me english not understando
Whoa thatโs a bit racist no
๐
Yamate kudasai, watashi no racist. Kiraye! Kiraye! Dai kiraye! Watashi no goodo human!
And is that the only time valid JSON isnโt either {โฆ} or [โฆ] ?
well 42
json can be any valid data
or "blah"
helll naahhhh, u japaneser?
Ngl japanese pronunciation is so freaking cute
some types will be merged
it doesn't have to have a list/dict as its outer data
Nope
so io is diff
japanesest
What do you mean?
u da real japaneser
like I know list/tuple will act the same once converted
๐ฟ
Oh so valid JSON could just be a string or int completely on its own?
sure
yeah, I was referring to the type once inside the json
TIL
Even an array is fine ig
i agree
I read that b4 in docs, I think
๐ค
hmm, so where are u from ๐ฟ?
India
sorry, but amm curious
send json as a scalar json string
It's one of the things I like telling people, because most people think JSON is only ever a dictionary as the outermost.
Why u guys like this sysmbol so much ๐
ohhh, I LOVE INDIA VROOO
I used to think it could only be array/dict as outermost
Indians are the best coders, right? haha ๐
I know it can be more than object but thought it could only be object and array
me hate this country tho ๐
Older versions of the JSON spec only allow objects and arrays as a document, but nowadays, any valid JSON object is a valid JSON document.
Then I saw just null and thought that wasnโt right
"{\"key\": 42}"
It is but you can you put import from a dictionary into other classes.
tbf, they are the useful ones
Tho its heavily context dependent
I should say i hate a subset of people instead , to bs explicit.
null
Iโm going to create a REST interface where the payload is a single string of SOAP XML
hell yeah vro
yeah at that point, you might as well use just a txt file or something
thats just an assumption to be fair
that's not meta though
that's what I said
There is a very strong and ancient mathematical discipline baked into its bones, so I think it's fitting.
I only ever used them like that, so I assumed those were the only possibilities
everyone hate his place vro, i hate iraq too ๐ฅ
i beelieve you've seen them like that, so you assumed it has to be like that
Explain why I am so bad ๐
Let's keep the chat on topic, ok?
thx
Doesn't jq have a function to parse json strings?
๐ค
yea, well, maybe its a mistake i'm doing as well at times
ammm, no
how bout iran?
trying not to at least
Idk, he hates a country, i too hate my country
what about iran ๐ฟ
Can we keep it on topic
that's what i said
ok bro
kid
for the record:
i dont know if it can be anything that isn't a container, but i just dont know the answer
I like it
Context
solve daily problems, but it seems lately i am a servant to the computer
interestingly, this is not following spec
In [4]: json.dumps(float('nan'))
Out[4]: 'NaN'
In [5]: json.dumps(float('inf'))
Out[5]: 'Infinity'
๐ญ
To find problems that I don't know how to solve.
i dont think you should use json dumps and assume it follows spec
when i was young, i started learning python, ok
if you care about json spec read about it in wikipedia
It damned well better follow the JSON spec!
Same ๐ค
What should nan and inf be in JSON?
๐
json doesn't support them
what did you learn?
a "bug" that isn't appearing normally, won't be fixed
It doesn't support valid floating point values?
python's json library is just an implementation
Python's JSON library is an implementation that follows the JSON specification.
took me 2, can i say the word, years
that maybe tries to
JSON supports floats.
NaN and Inf are valid floating values.
Did we evolve or what...
How is threading sensible as a beginner. I didn't even understand two vars getting mutated at the same time.
if you wanna know what the json spec is you dont investigate python's json library, you read abbout the spec in wikipedia
Not tries to, succeeds. And a bug in that implementation would be fixed very quickly.
u know a chat is healthy when several people are typing
If you want to know about a spec you read the spec not a wikipedia article.
I thought implementations are probably close to the spec 
a bug that doesn't appear in any code won't be fixed normally, unless shown of course
valid floating values that don't have any standard JSON representation
The JSON spec does not require numbers to be implemented as floats and does not say that they must be floats. Numbers consist of an integer component and an optional fractional/exponent component.
-# source: https://www.rfc-editor.org/rfc/rfc8259.html#section-6
Asynchronous chatting ๐ฅ
It supports NaN.
oh
getting data about details of a specification from wikipedia is a poor idea
https://datatracker.ietf.org/doc/html/rfc8259#section-6
Numeric values that cannot be represented in the grammar below (such
as Infinity and NaN) are not permitted.
JavaScript Object Notation (JSON) is a lightweight, text-based, language-independent data interchange format. It was derived from the ECMAScript Programming Language Standard. JSON defines a small set of formatting rules for the portable representation of structured data. This document removes inconsistencies with other specifications of JSON, r...
u mean 1 on 1 * 3?
spec is a guide line, implementation if it uses that guide line, can aim for it, not necessarily succeed in 100%
I'm a bit surprised that they didn't include support for NaN and Inf since this comes from Javascript...
You're right
how does chat even work here?
what's your point here? is this not true for every implementation?
you cant know the spec based on the implementation
>>> json.loads("NaN")
nan```๐คทโโ๏ธ
fiery tried to investigate the spec through the implementation, from what i understand, so, bbetter read directly about the spec instead
Comes from, but it is a subset of javascript also. Maybe they didn't want to require the target to support NaN or Inf.
With a little help of websockets and API calls.
the json page say at the beginning
JSON (JavaScript Object Notation), specified by RFC 7159 (which obsoletes RFC 4627) and by ECMA-404
. if it does not follow 7159 and 404 in a fully compliant manner, it should specify on that page, and if it doesn't, it is a bug
is that what was being said? I don't think anyone was disagreeing with the fact that the spec is...well, the spec.
What a particular implementation does and what the spec requires often diverge.
๐ I mean like the human layer
JSON is less specified than you might think. What should 9007199254740993 deserialize to, for instance?
one would still hope the impl would be up to spec
Hello cameron
Spec is the definition of the standard. If an implementation follows the specification you should be able to reference that implementation. It is not a "guideline" It is a definition.
For example, the range of numeric values (eg the max sizes of ints or floats).
is someone claiming that the json module is out of spec somehow?
Note that you can specify allow_nan=True if you don't want it to allow these values.
hope != facts though
Probably some negative number in C ๐
Anybody wants to collab on... AES-128 (tada)
Are we talking int64 vs bigint?
vs double
the implementation might not meet the spec at 100%
We're probably saying it supports more than the minumim required by the spec.
totally unspecified
Y'all accept you're wrong and apologize now or else be ready to get cooked by nedbat
This right here is the worst part of JSON, together with not specifying what happens to fields declared more than once.
i don't think fiery was saying the behavior of python's json library is an authoritative source for what is/isn't valid JSON, they were just observing behavior that didn't follow the spec.
