×
all 62 comments

[–]ninhaomah 45 points46 points  (12 children)

Python is a tool , like a hammer.

Why do you learn Python for ? Why do you need the hammer ?

[–]PureWasian 28 points29 points  (1 child)

For hobbies: - Python as a webscraper (using BeautifulSoup4) in the backend of a fullstack web app. I play an arcade game that saves player scores online, so it parses all of a player's scores from that website and uses that to make lots of fun little graphs and progress trackers on the frontend of my own website. - Python with Discord.py for making Discord bots. Made one of these a few years ago (and also a few with DiscordJS) for small servers with little minigames and such, but nothing too heavily fleshed out. Writing misc. Commands and responding with RichEmbeds of data tidbits from a database file. - Python with EasyOCR for image-to-text purposes. For the same arcade game as above, converting a phone picture into the score values and then saving those into a local database. - Python for coding problems on DMOJ since a friend introduced me to it recently. The website has a lot of general "sandbox" problems and algorithmic exercises you can solve in a variety of program languages. Python by itself is simple enough to use OOTB for the smaller scale, isolated problems on there.

Professionally: - Python with Selenium to automate authentication steps through a web brower window. Makes it easier when doing dev testing of an application over and over again rather than doing it manually. - Python with shell scripts for passing data between different devices/machines. Or using it as a way to massage data while passing it from one code to another. - Python with Django for the backend part of an internal web application. Essentially the piece that receives user requests when they fill out and submit forms on the UI, and reads or saves that data to database, starts background automation logic that takes awhile to run, fetches results, etc. - Python for misc. small scripts, like cleaning up CSV files or log files, or filtering for data rows that meet some semi-specific criteria like "contains this word but has a column value less than 500 while also avoiding these words." - Python as part of my thesis in ML involving a genetic algorithm for parameter tuning and model generation of intermediate nodes. Called a C++ library under the hood.

Also several work/school projects awhile back using Pandas in Jupyter or Google Colab notebooks for data anlytics stuff.

TL;DR, a very useful tool for dealing with data. Pick up related libraries and such as you need them for whatever projects and endeavors you end up pursuing. Start small scale and just build up to larger projects as you go. Takes a long time to accumulate a list of projects like this.

[–]Shaftway 14 points15 points  (1 child)

I collect specific poker chips. I often have duplicates in other colors. I have a script I built that captures an image, crops it to include just the chip, checks the edge to determine the colors, OCRs it for text, and looks for other chips in the collection with similar text. Then it uses all of the data to prompt you to confirm and fill in the missing bits.

Data is stored in flat files that work well with git so I can do merges cleanly. Also there are some exports, csv or json to be able to import it in other tools or spreadsheets.

I mean, I use it for other stuff too, like my job. That was just a fun side thing.

More from r/learnpython

  Hide

Comments, continued...

[–]magus_minor 9 points10 points  (2 children)

I used to write python for a living, but you are probably more interested in smaller private projects.

I have written a command line tool to "randomize" files in a directory. You can't actually set the order of files in a directory, so "randomize" means putting a random three digital numeric prefix onto the beginning of all file names in the directory.

I live in a country with infamous paperwork. I have to fill in many forms each year. To make that easier I wrote a tool that annotates a PDF file with pre-configured text at x,y positions on each page. Dynamic data like dates are worked out at execution time. So I run the program telling it which form I want and print the result. Sign the form and it's all done.

I don't use cloud backups. I backup to external USB drives*. To make that easier I wrote a backup program that has multiple different backups configured. All I have to do is plug in a few drives and the backup program figures out what to do. To save space I use a feature of rsync that doesn't backup a file if a copy of that file already exists on the backup drive. That also makes the backup much faster.

Plus lots of small tools.


* Clarification: my code repositories are saved to USB drive, but I also push to a git site like gitlab.com or codeberg.org, of course.

[–]BobMarleyLegacy[S] 1 point2 points  (1 child)

Damn. Speaking as someone just starting out, this is kind of where I'm hoping to reach. Being able to make stuff easier using Python.

That's pretty freaking awesome.

[–]magus_minor 5 points6 points  (0 children)

There is no "advanced" python in any of that. It's just basic python plus knowing filesystems, what tools are available to be used, etc, and experience. That's why we always say "start a project" to beginners. You probably won't know everything you need to know to finish the project, but that's the point. A project forces you to think about the problem, identify the bits you don't know how to do, search for clues on how to do those hard parts, experiment, succeed, and then move on to the next hard part. That's exactly how professional programmers work, except their problems are bigger.

The best answer I have heard to the question "How to improve?" is "Little by little, day by day". So keep practicing, it will come.

[–]JustSimplyWicked 6 points7 points  (0 children)

I use python for alot of random things.

I have a script that changes my wall paper but it's based on a number of rules. Time of day, time of year and holiday season with a few others. Python parses my pictures name to get all the information then applies an appropriate wallpaper. I also made a image download tool to make naming them super simple.

I have a lot more but I honestly don't know what might be useful for you. But one thing you can do is reinvent the wheel. Simple programs you use all the time are great to rewrite. Or even just certain functions of a program.

[–]FangedFreak 3 points4 points  (0 children)

I’m literally brand new to Python but I want it to help me with my pantry management and recipe planning.

I’m going to get a receipt scraper so I can upload my shopping receipt, it’ll add items to my pantry with relevant ‘freshness’ level and then use my recipe manager to make meals in the right order to use items that will expire first.

Bonus addition will be that any items or leftover ingredients I have will go into AI to help me make another meal

[–]GoblinToHobgoblin 4 points5 points  (0 children)

Data analysis mainly

[–]tigerbloodz13 3 points4 points  (0 children)

To replace 15 excel macros and go from 2 hours of work to 2 seconds.

[–]Honest-Ease5098 2 points3 points  (0 children)

I use python professionallyand personally and have for about 20 years.

At home, I use Home Assistant for my home automation projects which is written in Python. I use a number of scripts to do things like read IO off of the raspberry pi pins, parse data from API and pass messages etc.

I've written data analysis scripts, machine learning models, optimization code, and job orchestration.

I have a number of web apps written using streamlit, flask and dask python libraries to do things ranging from options trading analysis to OCR scanning of documents and storing in a database.

In cloud based environments python is used within little serverless functions to do things like read active directory and manage user provisioning, or file triggers and object lifecycles.

[–]ImprovementLoose9423 2 points3 points  (0 children)

I use python for web development and machine learning

[–]Mister_Bad_Example 2 points3 points  (0 children)

I use it a lot in my day job, but if you're just starting out learning, you'll want something smaller scale, so here's an example:

A while back, I found a site that posted PDFs of the complete run of a magazine I used to read way back in the 80s. Clicking on each file to download it would have been amazingly tedious, so I wrote a script to automate the process.

[–]Initial_Birthday5614 2 points3 points  (1 child)

I started learning python 6 months ago. I decided to learn by building a video game. Well 6 months later here I am with a 15,000 line of code roguelike. I’ve refactored and re built my engine multiple times as I’ve learned. I survived a 4000 line spell conversion from classes to dictionaries. My game engine has matured so much adding a legendary item takes like 10 minutes and adding a spell or status effect takes under a minute. I am working on balancing and graphics now. 55 enemies, bosses that change depending on how many times you’ve fought them, 200 ish spells, 30 status effects, merchants, crafting, dynamic stat rolls on my 100 plus items and much much more.

[–]ectomancer 1 point2 points  (0 children)

Scientific computing.

[–]KCRowan 1 point2 points  (0 children)

Data cleaning and transforming. 

I decided to make a desktop app (just as a portfolio project) which generates a weekly meal plan, including calorie estimates and nutritional content, based on a user's preferences. It's going to use Ollama in the back end to generate the meals and I'm building the actual app in java. But the nutritional info I've got was downloaded in a xlsx file with crappy formatting and includes a bunch of stuff that I don't need, so I wrote a script in python to extract the columns I need into a csv and clean up the data, then another script to create a sqlite database and import the data from the CSV.

Now I'm learning javafx so I can start working on the actual app :)

Also my last project was a workout tracking web app, made using fastAPI for the backend and HTML/HTMX with jinja templates for the front end. So I used python for basically everything.

At work (I'm in IT Support) I write scripts to solve  problems that would be faster to fix with a script than manually. E.g. if a client wants 200 files transferred to their server but the files are stored on our server with a uuid for the filename and the client needs them renamed with something like clientname_title_createddate.xml ...well I ain't renaming 200 files by hand. Python.

[–]living-on-water 1 point2 points  (0 children)

I automate my reverse engineering with it, once I can manually reverse engineer and see the data inside a binary file. I then automate the proccess to extract all data into readable formats and files. Also have made my own tool to mass proccess assets, convert them all to webp, webm or ogg and then update all calls for those assets to the new extensions. Makes programs and games way smaller and easier to manage.

Bassicly anything that can save you time, most the times it's things you can do yourself but wish to automate for speed and ease so you can spend the manual time where it matters most.

[–]dutchWine 1 point2 points  (0 children)

for work, building simple tools that use our APIs in fancy ways
for home, making stupid pygame projects

[–]SimpleUser207 1 point2 points  (0 children)

I have built a simple python program to look into my Downloads folder and segregate the files into different folders into my E drive as per the file extension on a daily basis.

[–]PrincipleExciting457 1 point2 points  (0 children)

Mmm, I made a twitch tv not for friends to use. Many exist, but it’s nice to have a fully customizable one that’s complex but not too complex.

Connects to Spotifys API so people can pick music. Has a better ban list than most bots out there. Aggressive enough to catch bots that follow the rules but not too aggressive that it hinders 18+ convos.

It’s a WIP but it works.

Discord bots. I have one to keep me up to date on anime. It just webscrapes anime count down sites.

Honestly, the sky is the limit.

[–]dlnmtchll 1 point2 points  (0 children)

I use it to automate testing for hardware development, also data analytics / ML stuff

[–]nervousbolderer 1 point2 points  (0 children)

I'm a geospatial analyst so I use it do a lot of data administration and analysis

[–]Slylil17 1 point2 points  (0 children)

I'm learning data analytics but I sometimes vibecode stuff in python to automate stuff.

Like I wanted an app to download user music for GTA V using yt_dlp and rename it to Artist - Song format. I made a CLI app first and then turned it to GUI for my friends. I pushed it to my GitHub for them to download.

[–]MightySleep 1 point2 points  (0 children)

Professionally we use it to gather telemetry in industrial environments (generators). This includes reading many unique data sources, to include Modbus, and all sorts of serial connections with their own data formats. This application is capable of live streaming data, doing data aggregation over periods of time, sending special “alarms/alerts” based on various criteria, sending location data out, etc. Basically, in summary it makes our industrial equipment “visible” to us as an org. Python is great!

[–]mr_frpdo 1 point2 points  (0 children)

Network automation, config generation, xlsx, docx vision template usage, wgsi website.

[–]Prestigious_Bit2951 1 point2 points  (1 child)

What are your other hobbies? The most fun projects are the ones where you bring together multiple interests, not just program computer for the computer’s sake. Ie. If you like to fish, make a tool for logging catch-and-releases. If you like music, make a little synthesizer or tracker. If you like art, make a tool for cataloging works, a generative art piece, or even a digital art program (this is my lane).

I will say there’s not much you can do with the things you have down yet, but you’re on the right track. Add inputs and if statements and you can probably make like a little interest calculator or something. Once you get functions and while/for loop logic under your belt you can really go crazy, that’s when I built my first real program (a fractal renderer)

[–]BobMarleyLegacy[S] 0 points1 point  (0 children)

I like reading. I recently picked it up again after a long break. I've been trying to find a way to organize all the books I've read this year so far and note how overall enjoyable I found them and what I specifically liked. Is there anything for that? Because right now, I'm just inputting data into a spreadsheet for that.

I also like Dungeons and Dragons. Could I build something for character sheets or something?

[–]tollija 1 point2 points  (0 children)

For program trading bots data collection and analysis. Only for income generation, so far.

[–]CrAIzy_engineer 1 point2 points  (0 children)

Everything I don’t want to do twice

[–]Candid_Complaint_925 1 point2 points  (0 children)

Been building a paper trading strategy lab — backtests RSI, MACD, Bollinger, VWAP, and a few others against historical data, then runs an overnight tournament to rank which strategies performed best that week. Wired up to Alpaca paper trading API so you can test in real market conditions without risking real money. Heavy use of pandas and yfinance for the data pipeline. Good way to learn time series data processing and API integrations. Open source: github.com/rmbell09-lang/tradesight

[–]CommonSkys 0 points1 point  (2 children)

To make my Fortran code easier to function. 

[–]the01crow 0 points1 point  (1 child)

How?

[–]CommonSkys 0 points1 point  (0 children)

I use it extensively to wrap my Fortran code so it can be used within other projects without needing to update the entirety of my legacy code. F2Py for numpy if you're curious.

Edit: not my code per se, I inherited the code base after someone updated it from F77 to F90/95.

[–]LookAtTheHat 0 points1 point  (0 children)

Had to learn it for a AI POC 2 years ago, now I use it for running ETL jobs in Spark.

[–]Quixote1492 0 points1 point  (0 children)

Data Science

[–]bunah 0 points1 point  (0 children)

I started to learn python because I was starting to use Blender and some of the repetitive animation stuff could be much quicker if scripted in their built in python window. More accurate too.

[–]omgu8mynewt 0 points1 point  (0 children)

Data analysis: I'm a professional scientist, and a lot of our older equipment spits out results in CSV files that you then import into Excel, re-arrage so it makes sense for whatever graph you need to quickly look at your results, then do some QC steps to compare samples, experiments etc.

Python lets me automate this and change a 1 hour repetitive job into a two second automated click, that I then do a little bit more bespoke analysis on depending on the experiment.

[–]SoloJoseKing 0 points1 point  (0 children)

Not a programmer but use python at work to bridge gaps in systems we use. Take photos from a google form and generate a photo deck of received items [pptx-python, PIL, gspread] and output the link to Slides to a google sheet (receiving ledger of assets receiving state).

Libraries for text & photo processing, connecting to MS Office, Dropbox, GoogleWorkSpace is very robust. Complex sorting in excel [Pandas], QR code generation.

I have a small team in a satellite office of a larger corporation. It helps streamline my work & automate the most annoying parts of my day.

[–]existential_american 0 points1 point  (0 children)

Basic calculations and data. I use it as if it is Matlab but on Google colab for convenience

[–]RedSucks2 0 points1 point  (0 children)

Use python for digital signal processing of oscilloscope data, converting data from one format to another and lots of numberchrushing tasks

[–]NigmanBubble 0 points1 point  (0 children)

This has nothing to do with snakes

[–]WhiteWereWolfie 0 points1 point  (0 children)

Looking for projects to use python is the wrong way round imho. Whenever I need to automate something on my computer, I reach for the right tool which is sometimes python, sometimes power shell, sometimes just a simple batch script.

[–]BigFootCrossingGaurd 0 points1 point  (0 children)

I just started using python two weeks ago. I use it to do various things related to running my localLLM models. The first script i 'wrote' was to check my folders for a new mp3 or mp4, run whisper to transcribe it, pull a prompt from a text file and pass that over yo LM Studio. I say 'wrote', but I havent coded since I learned C in college 20 years ago. I used Claude. No need to learn python, I think its a waste of time at this point. In two weeks of building up my tool set (I now have interactive menus written in python for my AI stuff) Claude has been able to fix every single thing that didn't work, almost instantly.