I have a feeling I’m stuck in tutorial hell, and I need to start actually building things. But I don’t know where to start :/
Also I’m really bad at syntax. I only know concepts like for loops, while loops, if-elif-elses, etc…
So maybe something that helps me learn more about coding syntax would be helpful.
Thanks!
I wanted to use TheFuck on latest Linux Mint so I had to download the source and make some upgrades to make it work.
Another small project was a small app for extracting file differences between two folders, the idea was that I can mod games in windows, make a diff between vanilla and modded versions, then copy the diff onto my Linux machine and extract it into the game root installed there. Works great.
Personally, I initially practised my Python through making little ASCII art games. It taught me a lot about how to use variables, functions, that sort in neat ways. I remember that my first game involved turn-based battles, and you type things like “attack” or “magic” to use different moves. Making weird little games is always fun!
I never did learn how to use PyGame since I jumped from ASCII art python programs to games made with Godot (still make the occasional Python script though), but I hear it’s great if you want to make graphical games!
def main(): print("Hello world") if __name__ == "__main__": main()/s
I think a small one I worked on was extracting URLs from a CSV file in a certain column. Not too difficult, but a very specific use case.
yeah and after doing this you will thank library like pandas and numpy which really makes our life easier
Just a thought, install ipython. Then start exploring modules. ipython is very helpful with this.
Here is a small example. After ipython is installed in a terminal start ipython shell by typing
ipython. In my example we will usepsutil.import psutil as psYou can access different methods in that module with a dot and you can see all available methods by hitting tab after the dot.
ps.<tab>, then you can use the arrow keys to select different methods that interest you.Here i will use process_iter to get programs that are running. I’ll use firefox as an example.
for proc in ps.process_iter(): print(proc)You can start to figure out how to access properties. Some properties are methods and require the () and others are attributes and dont.
for proc in ps.process_iter(): if proc.name() == "firefox": print(proc.status()) # or even kill the process proc.kill()This can be fun. It can help you explore and familiarize yourself with different modules as you read their documentation.
You could teach yoursel list comprehension.
[ x for x in ps.process_iter() if 'fire' in x.name() ]This gives you a list of processes with ‘fire’ in the name. A powerful way to sift generators, lists and the like becomes available.
psutil is fun but you dont have to start there. The
osmodule is very handy.import os down = os.path.join(os.path.expanduser('~'), 'Downloads') for zip in os.listdir(down): if os.path.splitext(zip)[1] == '.zip': # delete all zip files in Downloads os.remove(os.path.join(down, zip)) # or with list comprehension zips = [ z for z in os.listdir(down) if os.path.splitext(z)[1] == '.zip' ] for zip in zips: os.remove(os.path.join(down, zip))Maybe try https://en.wikipedia.org/wiki/Fizz_buzz for fun.
Do your todo apps, sudoku solver etc. Simple problems are fine. Don’t look down on them, don’t tell yourself that they’re too simple for you. There is always more complexity that you first expect once you start tackling it seriously.
Also, every self respecting tutorial ought to have exercises after every chapter. Don’t skip them either.
It was a tiny TicTacToe server I made to learn machine learning. I basically played TTT against it and it would train on the former games to improve. It didn’t work since I’m not a data scientist, but at least I know how to create Web Sockets!
I can give you a few advice if you want
- Single Responsibility Principle: don’t do everything in the same place, separate between functions, classes or files. In my server, one file contained anything related to the server, another anything related to game logic and another anything related to machine learning.
- Don’t reinvent the wheel: unless you’re making it as an exercice, don’t create something that already exist as a library. Python is wonderful for its libraries
- Don’t optimize stuff: if you feel that “it could be faster”, either benchmark it or give up. “Premature optimization is the root of all evil”
- Learn how to make useful naming, tests and documentation: this is not something developers like to do but you’ll love yourself if you read your code after a few months
- Don’t code with an AI: If you’re bad without an AI, you’ll be bad with it. If you’re good with an AI, you’ll be good without it. You can still ask one for snippets or use it as a tool to discover concepts you don’t know about but I strongly advice against autocomplete and coding agents (I talk from experience).
If you don’t know how to start, you can make a really simple Tic Tac Toe game with its rules and play it in a CLI. Then you can decide how to pimp it: a better interface, game saves, an opponent played by the computer, a game server for a multiplayer game… you decide!
I can’t answer your question in the title, but I can say what I do whenever I learn a new programming language (even if its temporary just to play around with new languages). My personal Hello-World like program I tackle in most cases is something that runs another program. Lot of my personal projects are actually like that. You can start simple, to learn how to do associated tasks with it. There is a lot you can learn by diving into this (first) simple exercise.
This will help you understanding how to read directories, handle file names and paths correctly, read text files in example, how to spawn a process, handle possible errors and react to error codes, possibly read and process stdout of the program. Also handle commandline options, output stdout so it can be used with other programs easily. Write configuration file and so on.
An alternative thing you can try is, doing a simple grep like program. Or maybe a simple game that asks you a few questions and gives points. Or a note taking app.
A bit offtopic, but it’s relevant.
My first attempt to learn to code was more than a decade ago with python. I went through the basics, and decided to start a small project to practice. At the time python didn’t really have too many applications apart from automating tasks (before Hugo, flask, etc), so what did I think up? To make an automated propositional logic theorem prover. You input a formula, it tells you whether it’s a tautology or not.
Great idea, there are some relatively simple algorithms we’ve learned for pen and paper, it doesn’t seem too hard, etc. After a month I learned that it’s an extremely complex problem with billions invested in solving it because it’s directly relevant to PCB manufacturing.
That attempt failed horribly, and it took me a few more years and attempts before I found a good method. Web dev was actually crucial because I had direct feedback on simple logic.
So if you’re anything like me, make a blog from scratch or something else that’s actually simple, but gives you immediate visual feedback. And just to be clear, I ended up absolutely hating frontend, but it was a great stepping stone.
For basic mechanics it’s really good to start with a text based tic tac toe.
It forces you to use for loops, read from input, parse, arrays, small amount of state, rendering said state and conditionals.
To go the extra mile try to make it look tidy. This can be done by using a class to represent a state and having single purpose functions.
Maybe try it from the other way around : look for tutorials that help you achieve your goals, and contextualise the tutorial to your project.
I am wrapping up the Django tutorial because I needed to make a database that held the information on where I put my taxes instead of just ramming them in the downloads folder. I just followed the django tutorial on the official website, but changed variable names etc to make it suit my needs.
I’m also working on improving my bash skills. I made a clock chime to learn cases :
AWS Lambdas at work. None of them are particularly complex and the logic is often very targeted.
Edit: Just realized you said “hobby project”. For me, that would be a simple web scrapper.
can also try cloudflare worker which are free and as easy as aws lambdas
A small script to append some characters to a string based on whether the letters in the file name were capitalized. Super simple, but I had a data migration project to a system that doesn’t recognize case and people before me coded information into case. It is essentially tutorial level but real life application. Maybe you have something similar? Practical and working before anything complex.
One of the first small projects I worked on when i was starting with python was a telegram birthday reminder bot as i really didn’t want to rely on Facebook for that. At first I was just looping over all the entries in a list, then went to a database, at some point added fuzzy search, adding and removing entries. Still use it today.
Imo the best way to learn is to think of a project that you personally find useful and need solved for yourself, not some abstract exercise.
I started programming after I played some PlayStation 1 game when I was a kid. Mum told me that you have to program to be able to make games so I as a kid searched how to program and was promptly greeted by some c hello world tutorial. 9 year old kid seeing hello world in terminal did not a programmer make.
Few years later the various javascript fork-bomb stuff were riddling the internets, the ones where you had alert with some supposedly funny messages one after another (this was before stop making new dialogs was an option) which was my true introduction to programming. Doing actual real world stuff - making my friends and teachers suffer. Even if it was copy pasting alert hundreds of times, or changing the for loop end value from 10 to 100, it was very crude programming.
As long as you understand the core concepts, you can start learning more. Set a small goal and try to achieve it. Keep setting goals and try to achieve them and surely you’ll end up lerning.
I made one to track volume of keypresses per hour, and draw a graph comparing how much typing I’ve been doing on the current day vs an aggregated average









