r/learnpython • u/AnyAgency9835 • 2d ago
After a while of learning programming
So I am stuck in tutorial hell for a long while and I had to realize that I have no idea what a program’s code looks like so I can’t compare myself from it and can’t learn from it. And tutorials don’t give practice lessons for some reason.
7
Upvotes
1
u/frustratedsignup 23h ago
At some point, you have to put down the tutorial and actually create a solution to a problem you're experiencing. I use tutorials only when I need to learn syntax. Once I know the syntax, it's time to start solving problems. Yes, it's hard when you don't know all of the available modules, but the way you master them is by writing code and testing how things work.
My first script in python was for creating sftp accounts on one of the servers at work. The procedure we had been following up until that point took 20-30 minutes per account. It was tedious because you had to lookup an available user id, run the useradd command with a half dozen arguments, set the password on the account, and duplicate a chroot configuration so that one user couldn't see another user's files. The script reduced the wait time to under a minute per account. Little did I know it at the time, but there were projects coming up that would end up requesting that I create dozens of these accounts in a day. The time it took to write the script easily canceled out the effort that would have been required if I didn't write it. If I recall, it took me half a week of struggling to get it working.