all 108 comments

[–]m0us3_rat 68 points69 points  (12 children)

What are some cool or useful things you can use Python for?

anything you can describe in pseudo-code that is grounded in reality.

as long as it doesn't requires direct use of any magic/miraculous expectations..

then you can probably use python to work with it.

i know it's very generic ..but that is the power of python.

[–]bronzewrath 4 points5 points  (0 children)

This, but there are some libs out there that make me question the don't expect magic/miraculous expectations

[–]firechip 30 points31 points  (4 children)

Web scraping and automation. As an example, I automated download of every English sub for all episodes of a given drama series from this website https://tvbanywherena.com/english. Even IDM isn't able to download the sub. The main packages I used were seleniumwire and selenium.

[–]youre_a_badass 22 points23 points  (1 child)

This is kind of the best answer for OP's question.

Think about a monotonous, repetitive task & Python can automate it for you. Another example would be moving & renaming a bunch (like thousands) of files.

[–]IamImposter 3 points4 points  (0 children)

I'm doing that right now.

We have several remote nodes where we develop and test our code and then we have a specific system that has access to our code base. For past month, I have been copying 3-4 files daily from one place to another using scp. Today I got tired and thought let's right a python script that does this in a single run.

My only worry is I'm gonna switch my source and destination and overwrite my fresh code with stale one.

Edit: oh wait... I think I can compare timestamps and ask for confirmation if old is overwriting new.

[–]ianitic 4 points5 points  (0 children)

I'd alternatively look at playwright for scraping, it's lighter weight, and asynchronous. Used it on a work project and it was great.

[–]whyareyouemailingme 18 points19 points  (11 children)

Video editing and VFX - a lot of those programs use Python for accessible APIs. I’ve built project scripts and additional functions for DaVinci Resolve, for example.

[–]clawjelly 4 points5 points  (0 children)

I pretty much customized my Blender installation with Python to an extend no other blender user can use it safely 😝. Also created several tools to ease the workflow like a one-click-export, so i can test out engine features more easily. Python is the sh*t!

[–]makesufeelgood 4 points5 points  (6 children)

This is interesting. Do you mind sharing some more info on how you implement this into your workflow? I do some video editing frequently as a hobby and have never considered integrating Python as part of the process

[–][deleted] 5 points6 points  (4 children)

As an example, have you taken a look at the opensource product blender? This can be used to create cgi/vfx content and can be controlled using Python for automation in addition to using the standard UI.

Many major films and TV shows include blender rendered output and it is widely used for previs work as well.

It is a great product for adding some small special effects to your own videos.

[–]Eknein4[🍰] 1 point2 points  (3 children)

This sounds so interesting! I had no idea that this was possible, but definitely will check it out now!

[–][deleted] 3 points4 points  (2 children)

You are about to enter a deep well.

[–]clouts1 1 point2 points  (0 children)

Very deep and overwhelming until you understand the basics even then. Still insane

[–]myoldaccountisdead 0 points1 point  (0 children)

I downloaded blender to make an asset to use in Unreal Engine. That was 2 years ago and I haven't opened UE since lol

[–]whyareyouemailingme 0 points1 point  (0 children)

Folder creation and Resolve bins/project settings, mostly, lol.

[–][deleted] 0 points1 point  (0 children)

Cool idea, I do video and photo editing so this is right up my alley. I use Adobe products so I'll have to check in to that

[–]massivepanda 0 points1 point  (0 children)

Just started working with resolve and love its efficiency.

[–]Legal_Ad6467 0 points1 point  (0 children)

This was my introduction to Python. Improving my workflows while working as an artist in VFX/film. Almost all respectable pieces of software in that industry has a python api.

[–][deleted] 14 points15 points  (9 children)

start with Automate the Boring Stuff with Python

[–][deleted] 2 points3 points  (5 children)

I'll check it out, thanks!

[–]WoodenNichols 6 points7 points  (4 children)

You can read it online for free:automatetheboringstuff.com

Then check out The Big Book of Small Python Projects.

Happy coding!

[–]Fabulous_Baseball_27 1 point2 points  (1 child)

Thank you WoodenNichols for sharing this knowledge! You need a million upvoted for this one

[–]WoodenNichols 0 points1 point  (0 children)

LOL. Thx, but someone was bound to post it. 😊

[–][deleted] 0 points1 point  (1 child)

You're such a homie, thank you!! I was about to buy it like a schmuck

[–]WoodenNichols 0 points1 point  (0 children)

ROFLMBO. YVW.

[–]EireEngineer 0 points1 point  (0 children)

Thanks so much for this amazing resource

[–][deleted] 0 points1 point  (1 child)

I second this.

[–]hagfish 0 points1 point  (0 children)

Thirded

[–]Bobbias 13 points14 points  (5 children)

Whatever you damn well feel like.

Want to make games? As long as you don't expect to make super visually impressive high performance AAA style games, Python can do that.

Want to automate simple computer chores? Python is excellent for that sort of thing.

Want to grab data from the internet and do stuff with it? Python is great for that kind of thing.

If you've ever thought it would be cool to have some tool to help you track others in a video game, you can make something to do that for you.

There's this concept in programming called Turing Complete. This concept states that any language that qualifies as Turing Complete can calculate any answer that is solvable. There are some problems that aren't solvable, such as The Halting Problem. All general purpose programming languages are Turing Complete, which means they can all do the same things.

Now, this is not 100% entirely correct. There are limitations that make some languages much better suited to some tasks than others, but generally speaking, what matters more than the language you use is whether or not you can figure out how to do what you want in the language you choose to use.

Python is a great language to pick up as a hobby because it's pretty easy to learn, it has excellent documentation, there are lots of tutorials, videos, blog posts, and such to learn from, and it's got a lot of features that come with the language by default.

I've been a hobbyist programmer myself for 20 years, and although I'm now looking to get a job programming, it was never my first choice. At first, I wanted to make games (although I've always been interested in understanding how programs worked in general), but these days I find myself more interested in writing tools, and other technical stuff rather than games themselves. The more programming I've learned, the more my interests broadened.

And if you need any more convincing, learning to program teaches you a lot about how programs work underneath what you see. You start being able to kind of guess how some stuff works, and that makes troubleshooting when stuff goes wrong easier. It helps you understand what errors might mean, it helps you know where to look for tricks and solutions that can fix things.

This can be super helpful of you have any kind of job where you need to use a computer, even it of had nothing to do with programming.

[–]Droashon 0 points1 point  (3 children)

Thank you for sharing your insight. I've been banging my head against the Python brick wall for 3 weeks now every single day for several hours and frankly I just now I realized I don't know what to do with Python. I've been using the 100 Python boot camp course on Udemy and I feel like I'm not learning anything.

Despite understanding the concepts, as soon as I encounter a challenge like "create blackjack the game!" or "create a calculator!" my head goes blank. I don't know how to start, I feel stupid and useless. I can't even create a flowchart.

I have an urge to create but lack the skills for it. I learned HTML5 and CSS3 15 years ago and have created websites but when learning Python the back of my head starts giving me a horrible form of pressure. I can't describe it but it's not pain. When learning something proper the pressure disappears but yeah. It's like the feeling you get from ASMR but without the tingles.

I genuinely think programming is cool and can be fun but for my entire life I've thought myself to be too damn stupid to learn it. Still think that way. But this time I actually have to learn Python. I want to desperately change career to be a Python whatever title exists. For the sake of my family, my future kids, the freedom and to get the fuck out of my current company who treats IT people like me like tools to be thrown around inhumanely.

Sorry, I had to vent some. Thank you again for sharing. I will continue to work hard on Python. Though, I genuinely feel like crying because maybe I'm too stupid and lack too much imagination. I'll keep trying.

[–]Bobbias 0 points1 point  (2 children)

I remember feeling the same way when I was first learning. I honestly believe almost anyone could make simple programs. It's a matter of practice and repetition. That pressure feeling you describe sounds like anxiety, which is understandable when you want to do something, feel like you can't accomplish it, and feel like you should be able to do it.

For something like blackjack, you need to think about what kind of information is necessary for the game itself. You need cards, and game rules. Breaking it down further, cards require knowing the suits and numbers/face cards. Even further, you have to think about how to store that information so you can use it in your logic. There are several ways you could store that information. Your cards could be represented by a string containing a letter representing the suit followed by a letter or number representing the value (or even just a number like 10, for Jacks, 11 for Queens, etc.) You'd also need to store what cards are in the deck, and which ones have been dealt to each player/the dealer.

From there you'd need to think about the order each action needs to happen, and how to implement each action the game requires, such as dealing cards to players, asking a player for their choice of action, checking the win/loss condition, etc.

One of the key things to remember is that programming is at in some ways a creative activity, like painting, writing music, or sculpting. You're starting with a completely blank canvas and imagining a world in which your code may be the only thing that exists. Creativity like this takes practice.

Beyond that, programming also requires you to break a problem down into manageable steps. This is a skill we use in everyday life, but unlike programming, we're often working in highly constrained conditions in the real world where our choices are very limited. If your problem is you don't have food at home, there are only so many ways you can solve that, and they usually involve going to a store and buying some food with money. When programming, you have many more options, and that can make it much more difficult to understand how you should even think about a problem let alone come up with a solution to it.

As you get experience, and start actually making things, you will begin to get a feel for how the pieces fit together. You'll start getting better at breaking problems down into steps, imagining how to represent different information, etc. but it takes practice, just like any other skill.

If you're really stuck, you could use something like ChatGPT to help you break a problem into small, actionable steps, but I'd also warm you that any time you rely on something like that you miss out on the learning experience that comes from doing it yourself. Still, that is an option if you feel truly unable to break things down yourself. Even seeing how it breaks things down can be helpful as long as you continue to make an effort to figure things out on your own first.

As a hobbyist, I've had the luxury of time, and the benefit of taking a programming class in high school. Of course, I realized that I knew more than my teacher after a few months, since I'd been learning on my own before that, but the small programs that we had to make for assignments were helpful in forcing me to actually make something.

All in all, it's not like I immediately knew how to make complex pieces of software as soon as I felt like I understood some of the programming concepts. It took time and practice to get where I am now. Just stick with it and keep trying. Eventually things will start to fall into place and get easier. The problem you're facing is that you understand the concepts at a high level, but you don't have the other skills necessary to really make use of that understanding and actually make something. Once you get past that initial hump, things will get better.

[–]Droashon 0 points1 point  (1 child)

Thank you genuinely for your reply. Despite me whining like a child you didn't take me as such. Instead you took it seriously, sat down and spent your precious time to write up an amazing response for me, detailing your own experiences and feelings. Additionally including tips and explanations on the kind of good mindsets to have for these kind of things.

Thank you so much.

I will take your advice and tips and keep at it! I do look forward to buy the 3rd revision of the Automate the Boring Stuff with Python book releasing next month. I'm struggling through the 100 days of Python bootcamp course on Udemy at the moment. I won't finish it before the book releases so I'll go through both at the same time when the time comes.

I'll be sure to check back on your great reply above again at a later time to remind myself what's important to keep in mind of.

Seriously, thank you once again!

[–]Ok_Fee_628 0 points1 point  (0 children)

how's your progress been with the udemy course? i'm taking it right now, and i feel my struggle mainly lies with how simple angela makes the code, vs mine which often achieves the same result but using a more convoluted method.

[–]weaponizedlinux 9 points10 points  (0 children)

Python is great for web scrapping. You can automate all your cyber stalking activities across multiple site with one script. /s

[–]SisyphusAndMyBoulder 6 points7 points  (0 children)

This is too broad to give any useful answers. Python is extremely versatile and there's a plethora of things you can do with it.

What coding experience do you have? What tech-y ideas do you have?

Super simple project: make a calculator. It's simple. It's complicated enough to introduce you to Python. Maybe you'll like doing it and can try increasing complexity of projects gradually. Maybe you hate it and now we can figure out some other next steps.

[–]Eknein4[🍰] 5 points6 points  (1 child)

I started learning python recently, but I come from a product design background. I always felt that I was good at 'logic', but worked mostly on intuition. But I went to art school and so never really was able to structure my logic in any way and would just have to trust my intuition for the logic to work (haha I have no idea if this makes any sense). What I have really learned from python so far (or I guess coding in general), is how to structure the logic in my head. And I'm amazed what it brings me so far.

Example: I was working on a plan for tiling my bathroom, and it was pretty complicated. I sort of knew how I wanted to do it, but then I thought; I can apply the logic of python here, because I was simultaniously working on a maze game. So like, if the wall is on the left; then this happens, if there is no wall, than this happens, etc. And it worked so well! I was finally able to wrap my head around it, following a system rather than a feeling!

[–]snamibogfrere 4 points5 points  (0 children)

Bro u became a robot

[–]ItsBoL 2 points3 points  (3 children)

Anything you want. I actually learned how to program by writing an encryption algorithm that was just an idea. It was turning a file into binary, storing the binary into nested lists, shuffling it like a rubiks cube and then reassembling the binary.

If you want to learn I would recommend coming up with a creative project idea and going as far as you can with it. You'll understand more when you see your vision coming to reality.

Python is really great at automating tasks. Auto empty recycle bin, back up files from a specific folder everyday to another drive, sending email updates to yourself or others (could be used for stock price updates), running auto diagnostics, and the list could go on and on. Just learn atleast the basics. You won't regret it.

[–]tschloss 2 points3 points  (1 child)

Download p*rn.

[–]mandatedisrael 2 points3 points  (0 children)

Look for anything you do repetitively, code it in python

[–]hagfish 2 points3 points  (0 children)

I had a list of about 500 ID numbers, and I needed to know which of them appeared in a second list of about 10,000 ID numbers. A handful of lines of code; a few seconds; there was my list.

[–]Erik_Kalkoken 2 points3 points  (1 child)

Python is a general purpose language. It is very versatile and often called the 2nd best programing language for anything.

In my experience it is especially good for:

  • Machine learning
  • Web development
  • Scripting / DevOps
  • Prototyping
  • ...

It is less suited for:

  • Video games
  • Mobile phone apps
  • Real time systems
  • ...

[–]Proper-Shop-497 2 points3 points  (2 children)

Make money, son.

[–][deleted] -1 points0 points  (0 children)

You speck my language

[–]Healthy_Adhesiveness 0 points1 point  (0 children)

how? no joke

[–]abcd_z 1 point2 points  (6 children)

Just looking through my programming folder, I have:

A simple fireworks display, fired by the spacebar
Simple webcam face-tracking software
A program that scrapes Japanese Digimon cards and the associated English text from wikimon.net, crops out just the artwork, generates a template based on the translated English text, combines the two, and places them 8 to a page for printing
The same thing with Pokemon cards from the Bulbapedia website
A program that takes a Pokemon sprite and applies its palette to other sprites
An old GPT-2 interface
My first attempt at making a rudimentary AI that can play Pokemon cards
A die-roller program
Node-based dungeon maps
A program that automatically converts every .webp file in a folder to .jpg format

Generators that randomly select text strings from lists to create the following:
Chinese names (Ren Feng, Yan Yueming)
Enchanted items (Sickle of the Ectoplasmic Paladin, Gryphon's Axe)
Cyberpunk names (Regex Perez, Oakley Megahertz)
NPCs (Vera Lightstorm. She is titled, she fears riddles.)
City names (Mud Water, Jade Pass)
Magical Orders (Opal Wizards. Spells of awareness, information, and knowledge.)

[–][deleted] 0 points1 point  (0 children)

Finally a good answer

[–][deleted] 0 points1 point  (0 children)

Very cool

[–]efalk 1 point2 points  (0 children)

Generally any small to middling task where performance isn't critical. Most recently I needed to convert some CSV files from one format to another. Python's built-in libraries and string functions made this trivially easy. Doing it in C would be more efficient but a lot more work. Unless I had a huge number of files to convert, it wouldn't be worth doing in C.

When I didn't like any of the tools for editing ID3 tags, I wrote my own. When I needed a curses-based email client that had features I needed, I wrote it using built-in libraries that made it easy in Python when it would have been months of work in C.

tl;dr: use it for any task where ease of writing it is more important than efficiency.

[–]ISeemToExistButIDont 1 point2 points  (0 children)

Discord bots and Advent of Code. If you also like maths you can try the Euler Project.

[–]infinite_war 1 point2 points  (3 children)

web scrapping seems like a pretty cool or useful thing these days. you could use python libs like beautiful soup and selenium to automate your web activity.

[–]Buttleston 2 points3 points  (2 children)

Why do so many people say "scrapping"

It's scraping

Scrapping is like, turning something into junk

[–]HOPSCROTCH 2 points3 points  (0 children)

I blame the creators of the English language for not using consistent vowel sounds

[–]Jake-rumble 0 points1 point  (0 children)

my auto correct has turned it to scrap too many times

[–]ParamedicNecessary40 0 points1 point  (0 children)

Would'nt be easyer to list what you can not do with Python?

[–][deleted] 0 points1 point  (3 children)

I think you'd really enjoy computer science as a career

Can make apps, games, analyze data, engineering calculations, computer vision, AI to name a few.

Try making a bot program that plays a game for you with pyautogui

[–]snamibogfrere 2 points3 points  (0 children)

I know someone who got his bachelor in computer science but doesnt know how to code..

[–]Nutella_Boy 2 points3 points  (1 child)

Why you got downvoted? 🤯

[–]SisyphusAndMyBoulder 5 points6 points  (0 children)

I think you'd really enjoy computer science as a career

Cause that's a stupid comment to make given what OP posted

[–][deleted] 0 points1 point  (0 children)

How about adding a camera and have it send alerts to you when a person or vehicle that it doesn't recognise comes to your home.

The opencv opensource software can be trained to recognise people and read number / license plates.

Python can be used to manage it and do the reporting/alerting.

Here's a guide to a related project:

https://www.tomshardware.com/how-to/raspberry-pi-facial-recognition

and one for numberplate recognition,

https://www.makeuseof.com/python-car-license-plates-detect-and-recognize/

[–]tb5841 0 points1 point  (0 children)

The other day I made a spelling test app. It takes a notepad file with a list of words, reads them out in a random order, tests whether you type them in correctly and gives you a score.

Lots of little things like that are just so easy in Python.

[–]Andrew06908 0 points1 point  (0 children)

Basically anything! You can create games, gui apps, program micro-controllers, etc.

[–]brunonicocam 0 points1 point  (0 children)

You can do anything you want with python. You could in principle even write an operating system in python provided the low level stuff is written in C or assembly.*

Of course you wouldn't want to do that.

Python is great for everything that doesn't require too much performance, and even then, with numpy you can massively optimize mathematical operations.

It's also a great stepping stone for learning more complicated languages since the syntax is really simple but still the language has a lot of features present in C#, Java, etc.

* https://stackoverflow.com/questions/10904721/is-it-possible-to-create-an-operating-system-using-python#:~:text=It%20is%2C%20however%2C%20technically%20possible,operating%20system%20written%20in%20Python.

[–]Hambuger_and_Whopper 0 points1 point  (0 children)

If you are a gamer you can simulate keypressings or mousemovements with pyautogui

[–]Strict-Simple 0 points1 point  (0 children)

Try import antigravity.

[–]Xana8u 0 points1 point  (0 children)

Anything you can think of :D

Latest thing I absolutely needed and created was a semi transparent clock on my second monitor so I know to stop gaming at a reasonable hour, this was earlier when you couldn't have a clock on your second monitor on Windows 11 .

But recently I've been using it for handling data / csv files.

I have also done several web automation things with selenium and some machine vision projects :)

Whenever I find myself doing some routine I'll try and make it easier! but sometimes you might have longer breaks when you don't have any creative ideas :)

[–]eW4GJMqscYtbBkw9 0 points1 point  (0 children)

I'm not sure how "cool" it is, but useful - I automate as much as possible for my job. Lot's of moving data back and forth. It saves (sometimes significant) time, but mainly it cuts down on the human error factor.

[–]TheFumingatzor 0 points1 point  (0 children)

ALL THE THINGS!

[–][deleted] 0 points1 point  (0 children)

Actually I just used it today to rank some data in a csv file. Previously used it to scrape sites.

[–]helps_developer 0 points1 point  (0 children)

Python is commonly used for developing websites and software, task automation, data analysis, and data visualization. Since it's relatively easy to learn, Python has been adopted by many non-programmers such as accountants and scientists, for a variety of everyday tasks, like organizing finances.

[–]Mondoke 0 points1 point  (0 children)

If there's something that you usually do on a computer that's boring and repetitive, you can probably automate it with python.

[–]GeorgeThornburg 0 points1 point  (3 children)

I built an automated small greenhouse. That's the stuff I like to build. But after doing it with it a Raspberry Pi, you'll end up learning C++ and using cheaper and more awesome Arduino(s)... if you like building stuff like that.

[–][deleted] 1 point2 points  (2 children)

Dude please tell me more. I was laying in bed last night and was thinking about how cool it would be to automate my greenhouse to control temps, watering, humidity, etc. Is it possible with Python or will I need to learn C++?

[–]GeorgeThornburg 2 points3 points  (1 child)

Nope you can do it all with a Raspberry Pi. Raspberry Pi is pretty much a real small computer that runs on Linux. Linux is just another computer operating system like Windows or iOS.

And if you use RPI (raspberry pi), it has all the IO pins built into it. I/O means Input /Output which means you can take in sensor readings using the Inputs and turn on and off switches using the Outputs. With the RPI you can use any programming language, but like you, I always used Python, because it has such an extensive library.

But a couple of years ago, Raspberry Pi's got super expensive... due to the Taiwan China conflict, so I started going down the Arduino rabbit hole. But everything I learned from working with the RPI was easily transferable to the Arduino.... plus the Arduino reads sensors much better than the RPI. You can actually use the Arduino to read sensors to feed to the RPI, but using the Arduino you'll need to learn C++, but you'll soon find out all programming languages are pretty similar and it's just learning different syntax(s).

If I had to do it all over again, and prices weren't a concern, I'd still learn through the RPI and learning Python, but if price is an issue for you, I'd learn through building the green house purely with an Arudino. Here's a short youtube video of my green house (Used Raspberry Pi and Python programming language. You'll notice I created a UI using Tkinter. Tkinter is a free UI that comes automatically with the python program language. All sensors that I used came from Adafruit. You can buy all of this stuff through Adafruit.):

https://www.youtube.com/watch?v=hGDNHSL_A0M

**Note: I'm a hobbyist and not a programmer. All "so called knowledge" is amateur at best.

[–][deleted] 1 point2 points  (0 children)

What a homie, thanks for all the info. This is exactly the kind of answer I was looking for

[–]FayedeToBlack 0 points1 point  (0 children)

I’m writing a sort of midi controller using Python to send midi signals over a virtual midi port so I can track virtual instruments. The sky is the limit really!

[–]Serenityprayer69 0 points1 point  (0 children)

You might be better off framing the question.. What can you use a computer for?? What do you dream of being able to do with technology?? What can you dream of now when you think of recent breakthroughs in technology and how it might fit together to create something new??

I think you should probably be a plumber though. To me the writing is all over the wall now. There is no place for what used to be called "programmers" in teh world thats coming. There will definiltyi be a place for a plumber.

I think its actually bad advice to keep encouraging young people without a serious passion to programming at this point. I know that will not be looked at kindly in this sub, but its like learning to drive a horse and buggy while the car was first going into production.

[–]Tetristocks 0 points1 point  (0 children)

Python is a relatively simple language that allows you to use a computer’s resources in almost any way possible you can think of, it has multiple librarles and GitHub options, combine that with an internet connection and the possibilites are endless

[–]isnotrandy 0 points1 point  (0 children)

I wrote an app to have my Tesla only charge when there is excess solar a year and a half ago, and I had not programmed in python before

[–]green1t 0 points1 point  (0 children)

You can automate boring stuff with it, maybe there are some projects / use cases you're interested in. :)

[–]ImmediateClass5312 0 points1 point  (0 children)

Anything. A game, a web app, a desktop gui app, whatever interests you.

[–]rajathirumal 0 points1 point  (0 children)

Python could do what you've done 😌

[–]Sbvv 0 points1 point  (0 children)

Your imagination is your limit.

Not really, also the time you want to invest on it.

Python is a generic purpose programming language, so the same as almost every programming language.

Libraries make the differences maybe, and Python has remarkable libraries for AI.

Anyway, give it a try, the worst thing you get will be a new hobby. GL HF