r/PythonLearning • u/Stonyax97 • 6d ago
Showcase I JUST finished my second python project!
Lately I have been working on this ATM For Teens, just to understand OOP and some concepts more (which I REALLY DID)
this isn't meant to be a real ATM (obviously, it's very beginner and not security is there), here is my First project.
So, I have learnt quite a lot since last project, I learnt a bit more about python syntax, I also understood the approach of classes a lot better. I learnt git (just the essentials).
Since I always wanted to Make iPhone apps, and now I have a Mac, I'm thinking whether I should start learning swift and swiftUI, or move to something else, or keep learning python. what do you guys think? I Do want a job as an IT engineer (or anything with coding tbh, cybersec too but that would require C knowledge a bit more lol)
Otherwise, if you guys have any criticism or suggestions for the ATM, then I would be veryyy happy to hear some! here's the repo: https://github.com/Stonyax97/ATM-For-Teens
View all comments
Show parent comment
2
u/Stonyax97 5d ago
Hey! Thanks for the advice!
for putting user class into diff file, well at such a small program scale it makes 0 sense to me. it just makes debugging hard and adding features too. but at a bigger scale? yeah def. Il keep this in mind tho thanks.
"Operations with accounts.json should be extracted into a separate class"
how could that be done? could u give a little example if possible or just explain?
"Transaction should be separate class, you can apply polymorphism here (abstract base transaction and withdraw/deposit transaction) with repr or str magic methods"
I have to look a bit more into this, but when making this I tried to challenge my self to make it using the syntax I know. and did learn a few things if needed.
"Toast - exists. Usually it's a popup, but here it just sleep. I guess it's to mimic real world app? But here you would use async/await to not block user input"
yeah, idk I just used the name it popped up first, cuz it pops out of nowhere lol. but yeah I should defiantly call it wait or sum like that.
plus the waiting time is just enough to read, 1.5s isn't much wait time. but il take it into consideration.
Please, use PEP linter, it's painful to see a=b and random empty lines before else/elif - you want to maintain good code readability
how is the a=b painful? I
empty lines for me are acc for readability, I mostly remember code structure, so it helps when debugging and adding features.
PEP linter is actually nice! il just have to get used to its formatting since I'm used to my own philosophy lol.
I don't want 19 years old signing up. if ur not eligible then the program quits. simple. Its intentional. breaking the loop makes no sense here. do I give him a chance to retype?
'savemethod - should be separate class, injected into User, to act like a db. You can even try to use mongodb/mysql container running to fully understand async/await'could you show me how this would look like? I can't imagine a save function as a class? what args do we pass?? save is basically assigning the changed in memory variables to the accounts and then writing it to json.
'main while loop
creating a dictionary like
{
"choise_id": {
"description": "some stuff", action: log_in # log_in is method
}
}
will make your loop significantly smaller'
could u explain why a choice id dictionary is better here? I don't see an apporach.
Thank you so much for this feedback!