this post was submitted on 18 Apr 2026
48 points (92.9% liked)

Programming

26563 readers
382 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

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!

you are viewing a single comment's thread
view the rest of the comments
[–] Maiq@piefed.social 6 points 1 day ago* (last edited 19 hours ago)

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.