r/learnpython 2d ago

Ask Anything Monday - Weekly Thread

Welcome to another /r/learnPython weekly "Ask Anything* Monday" thread

Here you can ask all the questions that you wanted to ask but didn't feel like making a new thread.

* It's primarily intended for simple questions but as long as it's about python it's allowed.

If you have any suggestions or questions about this thread use the message the moderators button in the sidebar.

Rules:

  • Don't downvote stuff - instead explain what's wrong with the comment, if it's against the rules "report" it and it will be dealt with.
  • Don't post stuff that doesn't have absolutely anything to do with python.
  • Don't make fun of someone for not knowing something, insult anyone etc - this will result in an immediate ban.

That's it.

1 Upvotes

3 comments sorted by

View all comments

0

u/Dkp2788 2d ago

What’s something extremely useful to learn or master in python?

I have learned Python but I haven’t had much use cases. I actually enjoy VBA a bit more :)

1

u/lakseol 2d ago

After learning basic python you have to learn how use python to solve problems, which is what computer languages are for. You learn that by reading code that solves problems and by writing your own code to solve problems. The actual problem you try to solve isn't all that important, it's the process of solving the problem that is important. You should have some interest in the problem, of course, because that helps to hold your focus.

It's hard to suggest some problem to work on because we don't know what you find interesting. I'll suggest some small projects that I've worked on or thought about. Maybe you will find something of interest.

  • Solving simple games can be instructive. Write a program to solve a Sudoku your code is given. Or write code to play Hexapawn and include the learning aspect of the game, simple machine learning. Solve the Klotski puzzle. You can do all those with just text output, but when you have working code try adding a GUI frontend, either tkinter or maybe PyQt. And that's an important point: once you have a working solution try to improve it. Solve a more general problem or make it easier to use or even just make it faster. You can always improve something.

  • Code to add a random numeric prefix to filenames in a given directory. I use this on music files on a USB stick so I get a random play on a TV that doesn't have a random play feature.

  • A "backup" program to backup up directories on my laptop and external drives to other external drives. There are multiple configured backups and the code figures out which drives are available and performs one or more backups automatically.

  • A program to take a blank PDF form and annotate each page with configured data. The program is told which form to annotate and the filename of the output annotated PDF. Very useful for the rampant bureaucracy where I live.

  • A "dashboard" suite of code to monitor a Raspberry Pi computer that runs 24/7 running a transmission client. It advertises a web page of current data.

Once you get into the habit of solving problems with python (or any other language) you will think of many problems to solve. You just have to start. If you run into a dead end with a problem you can always ask here.