#python-discussion
1 messages Β· Page 76 of 1
Hey Guys any reccomandation for Python Courses? I think the best way is to create through projects https://www.udemy.com/course/100-days-of-code/
Anyone knows this course and could say something about it
and you want to solve it by putting the data center in the space ? 
!res here are the recommendations for where to learn python
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
automate the boring stuff with python in particular is a good free ebook
its not my idea
i do resist this idea myself
@steady rain i know you definitely have more knowledge than me so do you feel any approach which could improve data storage in like 10 years
i mean like the way of looking to the problem
biological data storage >
I don't really know. the zeitgeist has been "storage is cheap, so just manufacture/buy more"
true
man processing or you can say in simple words reading time is slow
using organic matter like DNA to store data
like some startup was working on storing data or encrypting in the form of dna sequences so yes like it has great potential in increasing storage size
but reading or compute is slower
its just a fart in the wind at this point tho , im not sure how promising it is in the next 10 years
yes
man no cap but i feel what would happen to quantum computing
i wanted to learn but like its too hectic i feel it looks interesting but a lot of consistency is required
i dont understand what quantum computing does rn to guess what it would do if it had more storage
but i have heard the bottle neck in quantum computing isnt data but making a big enough CPU with enough error corrected qbits
anyways, im out
ok
SAUL GOODMAN, i didnt know you code python
'Improve' in what way?
man i am asking myself
File formats like vortex are pretty cool advances in data organization, for instance
idk anything about this but they're doing research with dna data storage
I just created this out of nothing but when I put it to my code it's not doing it's job
scale = 1 + (x-1) * (1.0 - abs(g/2 - 1)/(g/2))
man
We've been promised holographic storage for decades
look research scope is infinite
what even is holographic storage π
idk
on which contex
sounds like a pyramid scheme name for storage
real lol
wdym
nvm changing the topic of the convo
any project one can work on regarding mathematic or physics
Neurram and some of the approximate cpu architecures are really interesting: where if you trade precision for approximate accuracy, you can 'unlock' different performance profiles
a scientific calculator
where you implement all the functionality yourself without using numpy or smth
you are right but i mean like which simplifies some specific hardship so it has more scope or reach
@naive canopy how's it going homie
good man
doing AOC?
did 1 day then had exams
ahh
i dont know
is there some trouble you have in your day to day math / physics work where you think "this would be much easier if there was a computer program for it" ?
maybe some sort of visualizer π€·
i have built a collatz based application
sorry i meant
collatz visualiser
but man i like want to offer a service
If you want to do a math-oriented project, Mandelbrot Set/Julia Set generation is always fun and gives you a cool end result.
most of the popular things and apps originate from a problem founder personally experienced and is trying to solve
look i want to make some type of service or application that actually helps people in some way but is very specific so that less people are there doing that stuff so that it has scope of growing
there should be scope
i want my time to be utilised in helping people or even offering some fun service
collatz conjecture is so peak
voulenteering is pretty helpful
any idea
like something which people suffer in mathematics or physics and its not yet been made easy]
and we can make it easier by offering a service
i was working on a library putting together a bunch of noise functions
look for example pandas was a great library then came polars faster more efficient more scalable
like we build a better solution than existing
ok
there isnt a good game engine for python , you can maybe look into that , will involve tons and tons of maths and physics
then ?
still working on it
game engine yea this involves first of all developing a physics engine lmao
like unity , but with python
i understand
but you dont like the idea ?
man but this is not a one man project
its not , but you can start and see where it goes
idea is good but i have lets say a month
why do you want to make something in a month that is never done before and will help a lot of people
so like you want to build open source software?
you mentioned the word "service" like 4 times tho which i thought was funny
I brought massive improvements to my app by switching from dataframes to SQL
for hobby projects, nobody woke up one day and decided to make these tools, they make it usually because they need a tool to solve some personal hardship
the SQL also included materialized views, so I also kind of cheated by caching
man actually i am myself troubled a lot
my main motivation came from dwsim which is a open source simulation software
now i am learning pyqt so like i am planning to build something not that rigid but helpful
personal being the important word π
yea and they get nailed to the metaphorical cross by the people that enjoy their work enough
oss core dev crisis is a phenomenon and it's always so explosive
what
?
idk
dont think so
headless means without the UI window
My thing is opening it
hi
the most successful projects are created by people who need to solve a problem they are facing themselves. Often called "scratching an itch"
Sir you are right
absolutely
nedbat dropping wisdom π£οΈ π₯
maybe show code
no cap
options.headless = True
driver = None
try:
driver = webdriver.Firefox(options=options)```
from selenium.webdriver.common.by import By
from dotenv import dotenv_values
from selenium.webdriver.firefox.options import Options```
Hey @neat pawn!
Add a py after the three backticks.
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
@visual juniper Do you see ?
#Use this
better call saul
better call saul
yeah but i dont see why it wont work π
thihs looks partial can you show the whole thing ?
in a help thread ofc
Thats the entire code
None of the issues I have ever seen with such sites have been technological, though
options.add_argument("--headless") try doing this instead ?
https://www.selenium.dev/blog/2023/headless-is-going-away/
they have always been about curation - audience, participants, and content - and that's a community-building problem and not a tech problem
crypto scam , nice
are these people whose accounts have been compromised?
<@&831776746206265384> 
or just bots planted ages ago lol who knows
π
raid is approaching
that works, thanks
Usually. Though I remember one particular case where it was intentional.
!compban 198596235395858432
:incoming_envelope: :ok_hand: applied ban to @lapis marsh until <t:1765553414:f> (4 days).
!compban 1290814900859572339
:incoming_envelope: :ok_hand: applied ban to @granite bramble until <t:1765553432:f> (4 days).
sir we have safety right
it's like the person who had the access tokens decided to run the script just now π
2 at once is so funny
wont they expire after so long
Guess I'll go get on Destiny 2 then /jk
wdym
I don't think tokens rotate as long as that session is valid
I made a ransom ware BUT FOR MYSELF ONLY NO ONE else, also it just shutdowns ur pc but in a like idk how do I explain
Ask discord, from what I saw online (discussion about hacked accounts and what to do) they do the tokens in some shitty way that the refresh token is always alive
This is true
And I told them about this in 2019, explicitly defining the issue before it was a big big issue
That's not ransomware, turning off the computer is just a basic random prank
yeah it's like a prank
trollware
Just encrypt all user data and offer to decrypt it at a price tag, then it's ransomware
I remember at some workshop during science camp we decided to do the last man standing game and we were shutting off other people's computer via ssh
Otherwise best I've got is adware/malware/trollware
that's illegal if I did it to another person :/
Yeah, the name is because you ask for ransom.
yea i was just looking in my discord settings, and i couldn't find an option to deactivate all my sessions/log out everywhere (unless i'm missing something)
oh what's adware I never heard of it?
deactivate
You can change your password to do that.
- there should be option somewhere to see active sessions and log out of them... But better to change password as you don't know if they stole only one session or found your pass
?
add authentication I guess
usually just spams ads, it's like installing 30 toolbars for random search engines you've never heard of to your browser. Or like Clippy is technically adware but bro can be converted to malware and spyware pretty easily
if ur trying to like log out or anything deactivate it if ur tokens are stolen
Shit that displays ads. Like fake browser add ons that change your home page or add toolbars that will show you lots of ads
god damn I should do that on myself
so it's like trying to watch a 1 hour video on yt and it shows adds every 15 mins
I hate to have to tell you, but last I remember disabling 2FA and then re-enabling it used to be the only way to do that. Let me see if Discord has something newer posted about that
also do NOT add authentication to ur main email bcs u wont be able to log in if ur out of it
i mean if my account was ever compromised i would change my password and 2fa, it's no biggie. i just wish they had like a common feature to just log out of all sessions
or if ur phone breaks and it needs repair so..
but like the only way your account gets compromised is if u install and run some sketchy app lol

Under Settings > Devices now (used to be Settings > Sessions before that apparently)
oh I can do It without scripting?
there are ways around this
yes but it'll take a while
?
As a user, no, you don't need to.
idk what this means
oh alr thanks now I can make excuses that an ad popped up if I lost in a game
no like if ur phone breaks u can't do authentication, bcs it's only for mobile not pc

no one gets it :/.
i'm sorry to break it to you...
but 2fa codes are not a strictly mobile device procedure
all of my 2fa syncs with my MacBook, idk what to tell you (I also use PassKeys, highly recommend)
Finished my half a cup of half caf, and now I just wanna be able to focus π
Can anyone find debugpy.2023.XXX vsix file for me?
I've searched all over the internet but can't find it
I ve been debugging for 3 hours and I got absolutely no where, my mind is burning rn
i love python
What are yu debugging
Why
do you not
not sure
Anyone know anything about Telnet communication?
im making a honeypot for Telnet scanners but ive come into a problem where they disconnect before they bruteforce my login page
if this is against TOS in anyway please lmk and ill delete my msg asap
i have done that in the past, but it is for sure not something we will discuss here, it is information someone with mallisious intent can take and missuse
understood
Is telnet still used or attacked
telnet in the big 25
you're seeing port scans, they're just trying to find available/open services
So i know how to do OOP in python but when/why would you?
when it makes sense
for example: when you have several pieces of related data and some functionality taht specifically applies to that data
we need college courses on sense-making
I would argue that building software is an exercise in making a tiny sliver of the world make sense
and it's so subtle
twenny five
but: there's a tendency to over-apply OOP, so try to consciously question it everytime you go to write a class. it's a good tool, ti's widely useful, but not everything should be a class/object
oh, and also prefer composition over inheritance
eehh sort of im in communities that do such scanning but they mostly do ssh or exploits
@acoustic tartan as @dull dune said, if you can observe a common pattern (stable over multiple uses) it's worth trying to make it an interface and then each use becomes a class implementing it with its own specificity
^ I think that's a bit too broad, and could also apply to a function
you see repetition, the question is what's the right way to abstract it
oopsed the oop
"I often want to hit this API endpoint to get data for a list of products", cool, that sounds like a function.
"I often want to hit this API to get data for a list of products, but the API requires that I first hit an auth endpoint to get a token, and then send that token wtih each subsequent erquest" could be a good use for a class, as it has tightly-coupled data (the token and wether or not you've authenticated already) and functionality tightly coupled to that data (you ahve to send the token wtih each request, and autehnticate if you haven't already)
now, you could also solve that with just a function!
but that's the joy of building software: the interesting problems don't have one clear answer
Ok ok i definitely get it better
Not fully but i think ill fuck around with it a bit and see whats up
Thank you very muchπ
yeah, it's an experience thing. keep at it, the choice will become clearer over time
Awesome thanks again!
Does anyone has SMPS π i need it
Are you building pc
what is "SMPS"?
Yes
I am building pc i don't have SMPS
!offtopic you might want to ask in a more relevant forum.
There are three off-topic channels:
The channel names change every night at midnight UTC and are often fun meta references to jokes or conversations that happened on the server.
See our off-topic etiquette page for more guidance on how the channels should be used.
morning coders
Going to sleep coders
It's night in my country
Helloo
Hola
monday night?
Yes
games night nice
What?
Hi everyone π
Hello bro do you have SMPS
SMPS?
Yes
what is an easy to use drawing library for python?
i have heard of pygame and raylib but have no experience with either of them
I ineed
pygame makes it pretty easy
Isn't there one called turtle or smthn
that too
pygame
I do not unfortunately
ππ
there's different kinds of "drawing". if you're looking for something to do graphs and charts, for instance, other better options exist. what kind of "drawing"?
monday night, is games night
Video games?
yeah
drawings consist of simple shapes (i want to make some basic educational tools for famous data structures such as trees or linked lists)
Turtle
you might want to look into the Pillow library
that's one of its functions. it can also draw basic shapes
Oo
also:
general discussion of how to draw things like flowcharts:
https://python.plainenglish.io/4-powerful-python-libraries-to-create-block-diagrams-and-flowcharts-easily-f53d26f6eda4
i want it to be intaractive too
like you press a button and a new node get added to tree
ok, that's much more complicated.
sounds like something you would have to make yourself
but which one of these libraries you guys mentioned can help me with that?
pygame i assume?
something like pygame would be a must for interactivity
what about turtle ?
what about turtle head
I don't think turtle would give you the interactivity you want
Some css and js can easily do this
i didn't know turtle could actually accept input but it doesn't seem very expansive lol
But since you asked python
what are you trying to do? make a game?
Pygame i think
How, does it have forms
i mean it can capture keyboard and mouse events
which is probably all you need tbf, so my remark about it being limited is probably wrong
look at godot
speaking of all of these game engines
how about raylib ? i have heard its super easy to learn
raylib is good for drawing simple shapes yes, literally has DrawRectangle DrawCircle etc
though if you want to do something more involved it is basically opengl
probably. i just love godot
+1 for this great package
If you make a game in godot can you build it for the browser
I saw this somewhere
yup
you can easily export and host on websites like itch
i acutally started learing gdscript first, then python after
apparently it's experimental in v4?
oh, v3 also supports exporting to HTML5
idk what the difference is though
I've been seeing more and more people talking about picking up Godot, honestly...
whats experimental?
Its so so awesome
i have made lots of cool things with it
its so addictive.
It'd be nice to check it out. I've been working pretty much exclusively in data, so if it isn't a spreadsheet or a database, I basically haven't touched it yet.
Web browsers as a supported platform for Godot
But building an actual thing that people can interact with sounds like a lot of fun.
i know its very easy to upload a game to itch, not sure how hard it would be to put it on your own website without iframe
it is, i have made lots of little android apps, and computer games.
How is this Godot related to python 
Thoughts on the glassworm attack?
similar syntax lol thats about it
it's what their docs say Β―_(γ)_/Β―
what now?
with wasm?
Maybe
from the docs
GDScript is a high-level, object-oriented, imperative, and gradually typed programming language built for Godot. It uses an indentation-based syntax similar to languages like Python. Its goal is to be optimized for and tightly integrated with Godot Engine, allowing great flexibility for content creation and integration.
It's still not python
I dunno man. There are some similarities with Python just based on what looks like semantic whitespace, but some of the function declarations and declaring variables with the var keyword almost makes it look like Python and JavaScript had a lovechild.
That's like saying haskell is like python because it also uses indentation
If you are asking what's that, it's a malware using some private use area Unicode to hide the malicious code and it infected some extensions
you asked how its related. i said it has a similar syntax.... i didnbt say its like python
Is it fixed?
Fair.
I am not sure about that probably not
Oh looked it up i know what this is
Asm also uses indentation for labels
So should we start discussing registers here
it's really not that deep, just setup your editor to show invisible characters
thats convention not a syntatic rule iirc?
Idk nasm won't compile it otherwise
What compiler are you using?
you don't need to enforce python only discussion, we can talk about tangential things and try to learn off each other :)
It is that deep bcz no editor showed the code because it's some type of uni code that editors can't read
As long as it doesnt wander of to much
I thought this was #python-discussion
Why not use relevant channel for #game-development
no, because it's characters that hide other characters. its an editor setting to show whitespace
be the joybait you want to see in the world guys
I was here to see comprehensions
Thanks for wise advice
I don't know about how does that even work all I know it's just some special unicode that made the whole suspicious code into this ' ' and it infected some Vs code extensions
I have no idea how either
yap yap
there are unicode characters that are abused to hide text. by displaying the characters it removes the effect and you can see the text insid
very simple setting in all editors
just display whitespace
github has it on by default nowadays iirc
i logged on today morning and i saw people talking about quantum computing and data storage methods in #python-discussion. it did not impact my day enough to comment on it
+ +
!
W
\+-----/. \----+/
!offtopic stop arguing about what goes and doesnt go here
There are three off-topic channels:
The channel names change every night at midnight UTC and are often fun meta references to jokes or conversations that happened on the server.
See our off-topic etiquette page for more guidance on how the channels should be used.
whats a good use case for t-strings?
text sanitation
Do not underestimate the predictability of stupidity
I don't have the knowledge to say whether Ur correct or wrong
zero width spaces
like checking the user input and cleanign it before using it?
i had to look this up, t-strings are in python??? eeeee i love this
But just read that blog maybe you'll be able to get something I couldn't explain
that is the entire designed use case
you can have functions to sanitise the user input before turning the tstring into an sql request
this is probably the least advisable use case for t-strings
you should stick to the safety provided by whatever sql library you're using
If you're looking to sanitize user input, libraries have their own functionality for that.
This, exactly.
newer libraries sanitise t strings as it saves work on there half
you're saving work for .. who?
from pep750:
As a result, incautious use of f-strings can lead to security vulnerabilities. For example, a user executing a SQL query with sqlite3 may be tempted to use an f-string to embed values into their SQL expression, which could lead to a SQL injection attack. Or, a developer building HTML may include unescaped user input in the string, leading to a cross-site scripting (XSS) vulnerability.
they're designed to make it easier to sanitise user inputs as the stuff you want to insert into the template can be sanitised seperately then turned into a string
In this specific case, I'd still stick with sql parameters... but there are some cases where t strings could fill a gap where we need interpolation but parameters won't work.
xkcd 327
i didn't read the pep itself but i based my opinion on this https://realpython.com/python-t-strings/#sanitizing-sql-queries
reinventing a pretty nice wheel
i listened to a podcasst on them
its called talk python to me, lots of episodes
but there are a lot of python podcsats... The real python podcast is another good one
huh
been a while since i even thought about podcasts tbf
esp after i got rid of spotify
thanks will look into it
WHAT
MY RANSOMWARE WAS GONNA DELETE MY SYSTEM 32
WHAT DID I SCRIPT GNG
and it told me "this file is dangerous"
wait.

I was dumb enough to put "deleting system 32" π₯βοΈ
and that kids, is why you should not try run malware outside a sandbox
real
dw I fixed it
it just shutdowns it now
spooky way tho
0.2/10 bait
no
why does this return this
no
anyone can help really quickly
what's the issue
idk if I can help but lemme see
idk check the thread
I like python but I hate python
I think that's a normal response to any programming language, tbh.
Ahh I mean I hate the python snake it's scary π₯
the urge to pull my hair out when i encounter cyclic imports
But I like the python language
do it
thats how they go bald
My hairs are fine
I haven't dealt too much with cyclical imports, admittedly.
The times I've done it, I've just moved the import itself to the function where I need it and that's seemed to get around most of it.
import the module instead of the items in the module
Ayein
not a bad solution but it bothers me regardless
have you tried importing the module instead of the contents of the module?
i googled it and it's apparently deprecated in favour of native powershell features
Anyone able to quickly alpha test my VCS POC i made in a day?
i need someone good at breaking things
Oh I hate it, are you kidding? It's ugly as hell. :P
Didn't know that was a solution until you mentioned it, to be fair.
Dm her she broke my heart π’
π me too brother. just yesterday even
Much appreciated, Ned, thanks!
So the long and short of it is that we're allowing one thing to get fully loaded before we try to access. Therefore we get both modules and names, yeah?
Or rather we get the names within the module.
ππ
That's pretty cool didn't know that. But it's more like a trick. Might as well have done from two import func_two inside the function then right?
Us movement
Just postponing importing the actual function until it's used
sponsers
i wouldn't call it a trick: it's kind of the same as importing int he function: you're postponing accessing the name until later.
π
Yeah alright makes sense. Cool nontheless
Master any specific field
Yeah. It makes sense because then you're making sure dependencies are resolved before proceeding.
Python as in the....software foundation?
yes
I think they get sponsored by corporations and then also donations.
Grants, etc.
i did't even think about it 
yoooooo
i will gbt it
when i hack peoples money accounts using python, i will donate money to python as a thank oyu
also a viable solution that bothers me. nowdays if i'm starting a new project, i've learned to structure it differently by prioritizing modules over classes to avoid the crazy coupling and circular deps that are so prevalent with forced oop
How's your exam going?
that is the best thing to do, just harder after the project has a lot of stuff
π
not bad actully thanx for asking
Yeah I was gonna say it would be easiest to enforce that sort of convention at the beginning of a project rather than if you've got to refactor.
yea i have to resist the compulsion to immediately refactor when i notice a structural issue lol
And police crying in corner to see that
What is this ?
a gif.
yea
even on my laptop
oooo i see
But if gif can ?
no
only text and emojis can be sent by peasents
π
Understood
snake charmer
I am going to build a pcπ₯Ά
nice, its like lego but even easier
more expensive
Nah i already have all things but don't SMPS
Good night everybody πͺπͺ
Depends on the lego set... But usually the expensive ones get more pieces, so yeah, pc wins the price-per-piece category
step 1. buy 100 million discrete mosfets
you don't know lego. π
how does ctypes deal with struct return types?
iirc it just doesn't lol
I am a full-stack developer.
i saw a yt video about the cost of lego (might have been business insider) but the price per piece has been fairly consistent for larger sets, esp over the years (around $.09 - $.12)
What's a plauncher?
Obfustacted code and likely a token grabber.
Scandalous.
Lib with one release, released as 1.6.3 only 4 days ago, by a new user... And by the description - doesn't do anything the person above claims
<@&831776746206265384> "ad" for a potentially malicious lib
Oh, right.
nice try
I can't verifiy and report it to pypi at the moment.
!cban 145919785211920384 distributing malware
Pure cinema
oh, right
!purgeban 145919785211920384 malware
:incoming_envelope: :ok_hand: applied ban to @open cargo permanently.
But who was Frone?
Petition to bring back !cban
Someone logged into pypi to report the project?
he need to do the mod tutorial
real. it is the same adversary I've been dunking on for the last few weeks
I gotchu twin
It really wasn't subtle tbh
yeah it isn't, hit our heuristics π₯
last time the threat actor was active they were dropping something called "Honey Stealer"
What a bother.
Poor poohbear
πΏ
Was it aliased to something else now?
Clban
Because someone confused compban with cban
Yes, it's !clban now, apparently people confused it with !compban
when non staff know the commands faster than staff 
And now people confuse it with the other one π₯΄
Time to learn to use pban. Purge
mmm, peanutbutter ban
.topic
perforce is terrible
I need to learn Java.... That's the whole thing
a to do lsit obviously cause why wont i be doing that
i just am trying to crawl out of tutorial hell
but i cant really learn by errors if i dont know how to make the errors to begin with
what have you made so far?
THIS IS NOT A TEST
what's the purpose?
just curious
I've got that cli for the writing progress tracking app I use that I need to write for November ~~'25. ~~ '26.
University, so... Now I gotta mess with it.
U can see my GitHub
Java is great
I made some others I just put what I liked most
same shit but i'm already expirienced with python so it wasn't that difficult
I also got some exp in python, I just need to put in the time and I know I'll manage it pretty easily, going to be interesting
Hi guys
π .
...this gets weird fast
what did you find
if I return a struct { char[9] } I see the first four bytes returned as an integer
if I return a struct { char[4096] } I see a segfault
hsaha
I see a segfault for length 17 and above
How do I get python libraries installed
for what purpose?
very noob question here. If i made a program with tkinter and had other mnodules imported. how does the computer that runs the program install the modules?
something to do with size of pyobject *?
definitely not
register size though...
not my expertise, any of this
I wonder too
I really wanna get into low level
i have a computer science mock exam tmr for gcse and all i know is the print cmd i need to learn these topics, 6.1 Develop Code
6.1.3 Be able to convert algorithms (flowcharts) into programs
6.2 Constructs
Understand and use programming constructs such as sequence, selection (if/else), and iteration (loops)
6.3 Data Types and Structures
Use and understand different data types (e.g., integer, string, boolean)
Work with data structures including 2D lists/arrays
6.4 Input/Output
Handle user input and display output
Read from and write to external files
6.5 Operators
Use arithmetic, relational, and logical operators
Understand and apply the MODULUS operator (e.g., x % y)
6.6 Subprograms
Create and use functions or procedures to structure code
Understand parameters, return values, and scope
what do i do gng
accept that ur just cooked
lock in
im set 1 maths and triple science so im a quick learner if that helpsπ₯
cooked π π
That's all easy stuff
how do i do it
Read docs
from where
programming is famously the one thing that makes or breaks comp sci students. its definitely not easy stuff
There is the Mozilla docs, or the python docs you ll find all that
It is? I thought it was calc 1 or linear algebra:)
Is this part of a course? What materials did the teacher provide and cover?
I mean, if it's just a mock exam you could procrastinate learning all that. It's a future-you problem.
is it though? programming is much easier than most analysis and theory courses
its whats going to be on my exam, thats all the info/help he gave us along with the slides we learn in class which i didnt learn anything from
wow the assembly looks totally different
https://paste.pythondiscord.com/GZUQ
I m not a cs student but I code solo and use these stuff in my projects
idk it might just be purely anecdotal but comp sci grads who are terrified of touching code or they swap degrees bc they cannot understand programming is a trend. or maybe its an indication that they never really understood any of it
I also dont get why become a cs student if you are not into programming
money and parents
as many as 1/3 of cs students have not learned programming before starting
How many 17 year olds have any idea what major/degree they'll really be 'into'?
cs used to be my fav subjectπ
ah yes, the 'cs means free money' sticking around from, what, pre-dotcom?
yeah we only did theory
from just a few years ago
!res
If it's tomorrow, you can't learn this in time.
If it's a mock exam (real exam, but not counting towards you assessment), this is a chance to see what you don't yet know.
If the course is Python based, do a Python tutorial or so, see the resources page.
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Good point, I d personally research at least before getting in dept for a college I will attend
do you know things like Object-Oriented Programming and whatnot?
17? I enrolled in my Uni course at 17, turned 18 early in the first year.
Its a mock exam that counts towards if im going to get into sixth form or not bc i need to get a grade 6 in it
no clue what that is
same
I don't know what a "grade 6" is. Is that a high grade or a lower-but-passing grade?
Yah, exactly my point: how are you possibly expected to know what career you want without some experience doing it? And, couple that with the fact that HS is very different than Uni which is very different from Jobs
their are 9 grades in gcse, 1-3 is a fail and 4 onwards is a pass
Except that I went into exactly the course I hoped for. And stayed there, happy.
OTOH, I've a friend who once remarked that he and I are the only 2 people he knows who ended up in their dream work. I'm a software dev and/or sysadmin. And he's a mechanic.
Yah, I think it's very hit or miss. I started as a EE and was miserable
bro this resource page is confusing which option do i click, also by python tutorial do you mean like a video or a quiz because i couldnt find a good video online
i have an engineering mock aswell im so finishedπ
I d recommend a channel called traversy media if you wanna dive into some concepts, you can also grab an hour javascript crash course to grasp some concepts (oop and arrays etc)
alright lemme check it out rq
These are all introductory Python courses for beginners:
Automate the Boring Stuff is a really good book for complete beginners and it's free to read online: https://automatetheboringstuff.com/#toc
If you prefer to watch video tutorials Corey Schafer's playlist is also really good: https://www.youtube.com/playlist?list=PL-osiE80TeTskrapNbzXhwoFUiLCjGgY7
I also recommend Harvardβs free online course, CS50P: Introduction to Programming with Python: https://pll.harvard.edu/course/cs50s-introduction-programming-python
This is an alternative online course with lots of integrated practice problems you can do directly in the browser: https://programming-25.mooc.fi/
I can't read assembly. I can read LLVM IR though.
Apparently a 16-byte struct gets returned as { i64, i64 } but a 17-byte struct-returning function now takes a return pointer
Yeah, I've been lucky. And quotas don't help.
@desert stump if you have your mock tomorrow and you genuinely don't know the content then you're cooked. Have you dedicated time to learning outside the class if the teacher isn't great?
Alright thank you let me look at them
I wonder where that is specified
Tick the "beginner" selection on the left. I hate videos myself, but do what works best for you. Lot of people like them.
I tried revising before by myself when i couldnt learn from my teacher but i ran into a similiar problem online where the videos online didnt help me much and if they did id just forget it the next day, i didnt continue to try study for it because i had several other subjects i needed to focus on and just figured id learn cs later on when i actually needed it (which as you can see rn isnt a very good idea)
Wishing you all the good luck man
With programming it's extremely important to write some code yourself. The most important thing in programming is converting problems into programmes to solve them. That is a skill you will need. All the other stuff (lopps, variables, parameters) are just mechanics.
Thank you, much appreciated
Ah i see that makes sense, so i should focus on converting the question into a programme first then use the mechanics to help me answer it?
Well you're going to need to learn some of the mechanics - a programme's a mechanical thing. But the basics loops and variables and if-statements, then functions etc etc will get you going. Courses/tutorials are all structured to start with the basics first.
hey
can you help me?
Alright thank you ill keep that in mind when preparing/studying for my actual exam later in the year
This forum is about trying to help people.
for now ill try learn all i can but i think im cooked
It's just a mock, why cooked?
I have two files, one .bin and the other .json, on my PC. I need to move them into the Free Fire application, to a specific folder, but I can't restart my phone. Does anyone know if it's possible to move these two files into Free Fire bypassing the sandbox block or using a script? Please help me.
For tomorrow, you're cooked. Unless you already know more that it seems to us. But treat it as an exercise, and just do as well as you can.
Also, writing an informal English language solution to a problem is a first step, so using that, even as a preamble to some solution, ought to be good for some credit.
please
What's free fire?
I don't know enough for this.
game
Because i need the grade i get from it to get into sixth form which is a course/school after high school and before university
Does this have anything to do with Python?
Ah. For me, "sixth form" was just year 6, the last year of high school.
I donβt know
Well, the trick to learning is: pick one thing at a time and learn it. Don't obsess over how much you don't know. Want to talk about modulus?
i see, which country are you from?
I need so much help
I pay money
!rule paid
This has nothing to do with this channel, and we don't allow offers of payment. Take this to a more appropriate server
Also we don't allow discussions of hacks / bypasses which it seems you want to do @subtle needle
I have no time unfortunately ill just try learn the basics from a video or smth and then revise engineering afterwards π
damn exposed lol
You have a channel full of software experts here.
what server would be more appropriate for sum like that?
need invite link
gulp
uh okay what command do i learn after the print command
... and also enthusiastic amateurs.
And enthusiasts
int(input("Something")
Match your parens first
That's nearly legal. Got a question?
what even is free fire dm me
FOR LOOP
fruits = ("Banana", "Strawberry")
ok!
I did some google searches, and it looks like it is not a python project, so you might not find much help here in the channel for discussing python.
it looks like there are discord servers for freefire so you might get better help in one of their rooms.
are you watching "intermadiate Python Programminf Course" by freeCodeCamp?
im watching Python Tutorial for Beginners 2: Strings - Working with Textual Data
by corey schafer
I have absolutely no idea where to ask for help.
In Python it's possible to attach an else clause to a for loop. The code under the else block will be run when the iterable is exhausted (there are no more items to iterate over). Code within the else block will not run if the loop is broken out using break.
Here's an example of its usage:
numbers = [1, 3, 5, 7, 9, 11]
for number in numbers:
if number % 2 == 0:
print(f"Found an even number: {number}")
break
print(f"{number} is odd.")
else:
print("All numbers are odd. How odd.")
Try running this example but with an even number in the list, see how the output changes as you do so.

obviously no /j
yes, #python-discussion message
"expert" is a very vague term, ask your question someone might be able to help.
I'd like to ask if it's still worthwhile to learn programming now? Will it be rendered obsolete by AI?
Personally, I think yes to the former and no to the latter.
AI is going to change some things. Presently I think AI (well, LLMs) is overhyped.
AI is a nice tool. sorta like saying is it worth learning accounting now that excel exists.
My native language is not English, so there may be some translation issues.
do your best. π
I'm afraid that if I learn Python, I'll be rendered obsolete by AI. I don't know how far I need to learn it to avoid being left behind.
yes, and probably no. ai is a tool that can assist with development if you know what you're doing. otherwise, it's probably harmful and definitely not sustainable.
Lots of people like that. It will be fine.
I think there are inherent limitations that mean LLMs will never be able to fully replace a human developer. They'll keep being tools, not fully autonomous developers.
There are AI bots which play games much better than you but does that stop you from playing that game?
Furthermore, my English is very poor, so learning programming will be more difficult for me compared to native speakers.
Unless you're using some great translation software, it seems like your English is very good.
fruits = ("Apple", "Orange")
if x = fruits
print("Correct")
else:
print("Incorrect")
Hello, I'm new to the server :)
I don't professionally use Python (I'm an amateur pretty much ._.)
pretty much just joined this server to submit random code snippets I make when I'm bored
you can learn to code as a hobby and make stuff you enjoy or find useful! pursuing a career is trickier and an entirely different question, but try not to feel discouraged
i'm also not a native speaker, my level was developed only by writing programs
why it doesnt work
Ah, ok.
Anyway, that does just make things more roundabout. But programming is about problem solving, not English / not English. Although Python's keywords are English and such. But there are only so many.
Hello, and welcome
ty
error in line 2
You might want to open a topic in #1035199133436354600 - there's a lot of noise here.
you are trying to assign fruits to x in if statement (you probably wanted to use comparasion operator ==),
also x doesn't exists.
also i see problems with identation
if you're looking to get a job related to programming, it'd be worth learning English
hello - it's also worth noting that being a "professional" (vs. amateur) isn't about how much you get paid to do something; it's how you cultivate it.
I don't get paid to do stuff I use Python for fun
I am studying hard.
which is fine! we cater to all walks of Python people
I want to make Python programming my career, but I'm worried it will be rendered obsolete by artificial intelligence. What level of proficiency does Python need to reach to avoid becoming obsolete?
Good! Just work hard and everything will fall in place, don't worry too much about the things outside of your control and focus on the things you can
more like
fruits = ["apple", "orange"]
x = input("Type a fruit: ").lower()
if x in fruits:
print("Correct")
else:
print("Incorrect")
Not sure if that would be the intended purpose of the code but something close to this probably
Give me a goal that I won't be eliminated from.
Could you ask in #career-advice ?
there's always going to be a need for people with brains.
Okay, sorry.
you cannot build a career with just python knowledge. it is one language among countless others. there's a lot more to this field than just python, and that comes with experience. just focus on learning and building intuition. you'll find out whether you really like this stuff or not
The same level of proficiency that you'd need if AI didn't exist.
Right now the only people outcompeted by AI are nearly useless.
Python + C++
Ask yourself, how does one measure their skill level? You will need to proficient enough so that companies will deem you worthy to hire you. On the other hand you will never stop learning in this industry so there is no specific goal that once you obtain you'll magically get hired by any company. There are skills outside of programming too that you will need to get a job, like communication and social networking too.
it's not actually the language, this is in general programming
you can solve the task with any language you want but the way and how you solve this is the most difficult
.topic
i feel like python has become so common i wouldn't be surprised to see it anywhere
One time I saw a shop that reminded me of the python logo
it was a clinic
I was so confused if it was an off-brand Python logo used for the company or smth
AI implementation
with open(file, 'r', encoding="utf-8") as json_file:
json_data = json.load(json_file)
if isinstance(json_data, dict):
json_data = list(json_data.values())
Yo guys. i am currently writing a function that can write json files to a database but i am in a small problem. I have a json file that is 2 gb large but when i use this function it takes too long to load and sometimes it does not even load. Does anyone know something t hat can work faster.
its pretty common in that field
use a dbms
What do u guys do
json isnt meant to handle large data
I'm gonna post this rn because I gtg
its just a text file afterall, with a funny syntax put into it
I liked the old-fashioned style of CLI, and my personal favourite code (thought probably useless) was when I made a stylized "print()" function. It's definitely not useful but with some bugfixing, I could see this being used as a pretty cool cosmetic thing for CLI games or stuff like that :0
import time
import sys
def typewriter(word: str, letter: float, longchar: float, setlong: set):
import time
import sys
# Checking for validity of parameters
if not isinstance(word, str) or word == "":
print("Error: Word parameter not acceptable")
elif not isinstance(letter, float) or letter == "":
print("Error: Letter parameter not acceptable")
elif not isinstance(longchar, float) or word == "":
print("Error: LongChar parameter not acceptable")
else:
if not isinstance(setlong, str) or setlong == "":
setlong = "!@#$%^&*()<>?/;:{[]}\\|+-*/ ,"
for i in range(len(word)+1):
print(f"{word[:i]}β")
sys.stdout.write(f"\033[1A")
if word[i-1] in set(setlong):
time.sleep(longchar)
else:
time.sleep(letter)
i = i+1
print(f"\r{word[:i]} ")
sys.stdout.write("\033[1B")
typewriter("Hello, World! ^^", 0.1, 0.2, "")
So you're obtaining a list of stuff, basically.
What database is this being inserted into? What kind of data is in the list of stuff?
alr I gtg bye for now π
π€
assert isinstance(word, str) or word != "", "Word parameter not acceptable"
assert isinstance(letter, float) or letter != "", "Letter parameter not acceptable"
assert isinstance(longchar, float) or word != "", "LongChar parameter not acceptable"
...
ASSERT ABUSE CALL THE COPS /s
sqlite database
how about.. removing type validation as it is type annotated
I would probably just remove the instance checks in the hope that a typechecker is being used.
yes, same
Do you think use of AI is a good idea when learning Python? I mean in terms of usage for help?
finished making my face recognition script π
that the purpose of typehints (not talking about dataclasses)
ya do realise that assert doesnt work when -o is on right
ofc, you can replace it with if statements and raises
its better as you can specify a specific exception, TypeError
it's not bad as a "better google search" but it's not great at "write something for me" if you don't already know how to explain to it what it did wrong
i wonder why python doesn't run in optimized mode by default. It should've had another flag specifically for debug mode instead
!compban 757857050695827526
:incoming_envelope: :ok_hand: applied ban to @jaunty haven until <t:1765573849:f> (4 days).
should be banned just for that username.
import sys
if sys.flags.optimize:
raise AssertionError("optimize flag is not supported")
what did he send
...wait a second
social engineering scam
xD
evil pure evil
absolute menace
diabolical
menace to society
Can someone name the next ot channel name after this
What would you name it based on that snippet?
optimize-flag-not-supported
otn-optimise-flag-not-supported
hehe
import sys
assert sys.flags.optimize, "optimize flag is not supported"
π€
That will always raise unless optimize is enabled
might as well assert False
thus the "hehe"
!otn a optimize flag not supported
:ok_hand: Added optimize-flag-not-supported to the names list.
assert sys.flags.optimize, "optimize flag is REQUIRED"
alright, enough goofing off, back to my github docker auto build action optimisation
ciao all!
cya
Is loading json file with ijson faster than normal json.load
have you played around with nektos/act? Pretty great when doing gha work.
the only way for you to find out in your scenario is to try them both and get performance measurements.
No, I've done very little, new to gha and just started playing with stuff.
I build my gha yml's so they can run locally via nektos/act, or on GHA. Saves a lot of debugging time.
its not faster, but it allows you to load chunks at a time instead of all together at once
local testing of gha sounds sexy. I'll add it to the list of things to look at.
I swear I've spent more time in the past several months doing cool things with the tech around my project than actually anything that visibly changes my project.
act runs it locally (in a container). You can also GHA on a self-hosted runner, where it runs on your local system... that's helpful when you're worried about runner minutes.
in other words, with act, you're doing the coordination & running locally. With self-hosted, GHA does the coordination, but it's run locally.
Who know to code with python
Are there people working as a data scientist by any chance here?
Or anyone doing a data science degree?
@true umbra do u have roblox cheats
Noo
Do u play 99 nigths in the forest? @true umbra
!ot
#ot2-never-nesterβs-nightmare
Please read our off-topic etiquette before participating in conversations.
Who play 99 nigths in the roest
π€«
best sockest tut?
what class is it?
this server is largely about helping people. you don't have to help if you don't feel like it, but don't tell people off, either.
high school comp sci im having to do a part on robotics and its all in python and i have no clue what im looking at
this might as well be manderin
don't psych yourself out. you can understand this.
chat gbt isnt even saving me from this
i have to do the jetbot stuff lol if you google it it shoudl pop up but thats the robotics stuff im having to do
programming gets progressively easier the more you do it. but intro classes can also be horribly taught.
Is there a specific issue you're having? Ask about it.
yea its an intro class but this is so hard i dont even know what error to start with
my kid did an intro class where on one project he got the wrong answer for including a \n at the end of the file.
so next project he made sure not to include the \n, only to get it wrong because the answer expected it.
sometimes it's not your fault something didn't work, so just ask about it.
my favorite was when they compared students answers to a multiline text variable, but at some point a formatter indented the text, so every line had 4 extra spaces at the start and the teachers "correct answer" didn't match the problem.
yea idk im so lost at this point idk
so far you've said you're lost a few times, but have yet to share anything you're lost on so I'm not sure how to help you. π
yea well currently im trying to install the extensions to start this lol
very lost rn I could be in narnia for all I know
more like camelot here. π
anychance I could just send you photos/screenshare and show you it lol you might understand alot better than me
Grab a help channel and you can share screenshots there
You can open a thread in #1035199133436354600 and post screen shots there, but typically text is preferred.
Why python has a gil ? How if I don't want to have gil ?
Python 3.13+ has a free-threaded build with the GIL disabled iirc
Do you know what the GIL is?
yeh why do you not want the GIL
... do you know what the GIL is?
yes
ooh, have you run into an issue with GIL, what happened, what did you try so far?
do,.......you?
because it was designed to have gil
but now the community puts all efforts to remove it
Yes. I'm confused by your question of "why do you not want the GIL", since it's a pretty common request for anyone who wants parallel threading but not spawn multiple processes
I'm with spoojitkat here, most GIL questions are resolved by kowing what it is what it does and what versions of python are out there.
We do get people who hear about something called the "GIL" and that it's bad, but don't know much beyond that. So I want to make sure the people who ask about it knows what it does
right, im confused why im being ask why im asking why someone doesnt want a GIL
youtubers tend to picture gil as some evil tool
i run from these youtubers
is it pronouced gil like gif or gil like gif
like in gif
got it
(not like in jiff)
can you tell us more about your situation?
i think guido said the GIL will remain until there are no single core machines left
Are you aware of the recent free threading Python versions?
eventually the free-threading build will be the default.
na im a bit behind
#1447709515628810382 message done thanks!
I can't do python projects without the help of AI, I usually feel lost without using it,and I don't know if it wrong
Next project, ask us for help, not AI
how do you know you are doing (coding) good or bad?
Ok
ai makes it for u or u're using it as an assistant for u
Is there a better way to make use of ai
If you're a beginner, and want to get good at programming, the only way to get good is to practice programming.
I know,but sometimes you can get stuck and may need help
Practicing involves - experimenting, thinking and reading.
So, when you're stuck, you could: 1. spend more time thinking. 2. experiment / try different approaches. 3. read about the problem or other solutions.... or: Z: Ask an AI to solve it for you
So it isn't bad to have AI solve it for you sometimes?
If an AI solved it, you missed out on most of the learning.
I understand now
Agreed. Failing to succeed is some of the most valuable time spent learning.
When you get stuck, and you just get the solution handed to you, you don't progress. It's much more useful to get guidance that enables you to solve the problem yourself.
there are usually good sources for any problem u encounter
The issue with AI is that it's too tempting to just ask for the solution.
ai isn't one of them in my opinion
resources*
i use ai a lot, but u can't really compare chatgpt answer with a realpython thread
hello, is there a solution for the pkg_resources deprecation warning?
Paste the full message?
UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
Thank you all,I fully understand... I'll try to "avoid" the use of ai in my future projects
i think playing backwards and forwards with ai is what i do
What were you installing when you saw this?
vpython
And does it work?
oh well actually yes it works, i thought it was giving an error on the import
me not an expert xD
thank you
Warning are usually not fatal messages. But it looks like at some point in the future this will be a fatal (failing) situation.
It's probably more for the author of vpython (or something it uses) than for you.
Well I would like to make an OSINT tool for this I asked that
I find that often warnings are errors they're just errors that will manifest at runtime instead of compile time
It's like "You can do this, it's valid, and I can compile it, but you better make damn sure you know what you're doing for it to work."
Well, logging messages typically have levels like debug, info, warningg, error. "warning" is usually a "this may not be what is intended" kinds of things, and "errors" are "did not work".
So a warning might be "you left this out and I'm guessing blah". And an error is "blah was not specified, quitting!"
Yeah, it's a little different in the compiling context.
It's really not. Often a warning is dodgy but legal syntax and errors abort the compile.
I just recall the times I've tried to compile C/C++ and it compiles but doesn't link, or compiles and links, but then segfaults at runtime.
Yeah, but that's not logging. That's memory mismanagement.
Hence why I said it's a bit different
Rummages for a compile example:
CSS[~/hg/css-pilfer(hg:pilfer)]fleet2*> gcc vt/_scan.c
vt/_scan.c:2:10: fatal error: 'Python.h' file not found
2 | #include <Python.h>
| ^~~~~~~~~~
1 error generated.
CSS[~/hg/css-pilfer(hg:pilfer)]fleet2*1>
See the word "error" there? My code was not compiled and rejected.
I'll try to find a warning level message for comparison.
By calling the dunder methods lt, le, gt, gt, eq, and ne
Less than, less or equal, greather than, etc.
You forgot what you asked, which was still on screen, in one minute?
It calls (4).__lt__(10)
which does what
Calls C code to compare ints
i was surprised that heapq can compete with sorted for getting top N. to me it doesn't make sense.
I think __lt__ specifically is the one that's used by sorted and list.sort
heap sort(tree insertions) vs powersort?
not heapsort
just heapify + pop top k elems
k << n
but importantly, n is not too big
!d heapq.heapify - just basic heap 
heapq.heapify(x)```
Transform list *x* into a min-heap, in-place, in linear time.
I think
what if it doesn't have lt
You'll get an error if you try to sort something that doesn't have it implemented
imho heapq is impl on python while sorted surely its native codes. so asymptotic behavior is dwarfed by the screeching fast C code vs. slow bytecode
but this does not seem to be the case
so my question is what is slowing down the GOAT
how can the GOAT lose
gt makes sense as well
@abstract ibex what code did you use that shows heapq being faster?
if a < b then b > a
@abstract ibex btw, you often mean afaik when you say imho
sorry
class a:
def __init__(self, b):
self.b = b
def __gt__(self, other_a):
return self.b > other_a.b
def __repr__(self):
return str(self.b)
print(sorted(map(a, [3,1,2])))
that works
ge didn't work
actually ge doesn't make sense in this case...
oh nvm it does
like not a >= b
looking good with that decoration
tbh, i'm not quite sure what it means, or how to see the wrap-up again
i'm not quite sure what it means,
it being what?
how to see the wrap-up again
top right, you'll see a flag
wild
"it" being the decoration
it doesn't mean anything, it's just a decoration you got for checking out your checkpoint
No linkedin spam or advertising here, thank you.
Im gonna do something mature
W
A statement that could go in more than one direction. Let us hope for a positive outcome.
#bot-commands
Yes, strings with a length greater than zero are truthy.
heapq has a C accelerator that's used most of the time
π
Good timezone
Is there any point in using a custom JSONDecoder in json.loads?
you do it if you want to get different data than the default decoder gives you. Maybe you want tuples instead of lists, or objects made from some dicts, etc.
I was able to do that with just object_hook
hmm, i don't know enough to know when you would use each
Sherlock is too slow, I guess python was a bad choice to write this tool
what is sherlock?
This tool: GitHub - sherlock-project/sherlock: Hunt down social media accounts by username across social networks https://share.google/aCcCGL6VivXCDsad3
this seems like it would be IO-bound.
What lang is better for IO bound
Python is fine for IO-bound.
How is a mathematics degree for getting into ds/ml?


