• I did some webdriver stuff for reasons I don’t remember anymore.

    I also made a simple Django app to track job applications.

    Unsolicited advice:

    • use type annotations. You’ll thank yourself later when your IDE tells you “hey this can be None are you sure you want to call .some_func() on it?”
    • use an ide. Don’t just raw dog it in notepad. You should have syntax highlighting, red squiggles for errors, the ability to go to definition.
    • learn to use a debugger. Pdb is built in and fine.
    • don’t write mega functions that do a thousand things. Split things up into smaller steps.
    • avoid side effects. You don’t want your “say_hello” function to also turn on the lights
  • try this: make a python script which traverse given directory recursively and produce a graph which you can see using a svg viewer.

    try to make it and experiment with it

    !it will contain a horrendous bug if you are not careful!<

  • I taught beginner Python by working through this book: Coding Games in Python. I thought it did a decent job of teaching the fundamentals through increasingly complex games. The trickiest part is usually setting up an IDE, libraries, etc.

    Otherwise you gotta start looking around for ideas. Maybe outline some interests to keep an eye on…

  • My smallest python program was for filtering wifi names according to patterns. I hab collected some wifi names atomatically via sone other programs, and had them sitting in a text file with one name per line (a very simple data format). I wanted to find interesting names out of it, but didn’t want to spend much time scrolling through hundreds of names following the same pattern, like ISP-12C5, ISP-3F4B, … So i invented my own pattern syntax for very simple patterns, (ISP-%4Ax for ISP- followed by 4 hexadecimal digits with only capital letters), and wrote up a python script that read patterns from a file, and then filtered the standard input against those patters. any line not matching any pattern was then printed.

    In short it was a small project that i wanted to do, with simple data formats that i could easily parse and relatively simpel logic that i had ideas how to implement while designing the patterns. And i had some data to test it on.

    So my advice is similar to the other people here: look for things you are interested in or you need that sound simple to program, and then go on and program one of them. No problem is too small to make a program for.

  • made a tiny script that scrapes setlists from a site and builds a chord practice queue for me. basically: input artist → get top songs → look up chords → generate a practice list sorted by difficulty.

    it is maybe 80 lines including the argparse stuff. never bothered to clean it up but it still runs fine a year later.

    for breaking out of tutorial hell: pick something you actually want. if you’re just solving a generic practice problem you won’t finish it. a dumb personal itch is worth 10 todo app clones.

  • 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.

  • 23 hours

    Python is excellent at repetitive, scripty task.

    Open file, do something with input like extract, measures, rearrange and save work in other file.

    Another stuff is display or analyse statistical data. Find “raw” data of any of your hobbie(cooking, video games,Sport) and transform them into nice looking charts.

  • I’ve been a professional developer for over a decade.

    Find something simple to solve a problem you actually have.

    Who cares if its been done better a thousand times. Thats not the point.

    The point is that the only way you get better is by doing it shittly first, and then learn from mistakes. After a while you make less.

    Black jack inna terminal is a good one, a to do app, or time tracker, or automated stop watch. Whatever.

    Even better if you find one that’s been done before. Do it yourself, then compare with what someone else did. What you like and dislike about how they did it, and keep learning.

  • 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!

  • 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.

  • 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

  • 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.

  • 1 day

    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 use psutil.

    import psutil as ps

    You 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 os module 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.

  • console blackjack is a good start. take bets, hit or stand, count cards correctly, pay out winnings. makes you think about data structures and sequences and so on.

    alternatively, think of something you find annoying to do on the computer and try to automate it.

  • 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.