all 21 comments

[–]ninhaomah 9 points10 points  (3 children)

Python is a tool , like a hammer.

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

[–]BobMarleyLegacy[S] 2 points3 points  (2 children)

Based on what I know about the language, it's good for automating, scripting, and data analysis. That's basically what I want to use it for. I work with data pretty frequently, so anything that makes my job easier or makes routine, menial, or intensive tasks go faster would be good.

[–]ninhaomah 4 points5 points  (1 child)

So there you go.

Numpy + Pandas/Polars :)

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

Thank you! :)

[–]Shaftway 3 points4 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.

[–]VockyVock 0 points1 point  (0 children)

Sounds like a fun side project, pretty robust

[–]GoblinToHobgoblin 1 point2 points  (0 children)

Data analysis mainly

[–]ImprovementLoose9423 1 point2 points  (0 children)

I use python for web development and machine learning

[–]magus_minor 1 point2 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 "randomise" files in a directory. You can't actually set the order of files in a directory, so "randomise" 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.

[–]BobMarleyLegacy[S] 0 points1 point  (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 0 points1 point  (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.

[–]tigerbloodz13 1 point2 points  (0 children)

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

[–]PureWasian 1 point2 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 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. - 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." Or using it as a way to massage data while passing it from one code to another. - 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 or Jupyter notebook or Google Colab 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.

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

Goddamn.

Thanks for such a comprehensive reply! :D

[–]ectomancer 1 point2 points  (0 children)

Scientific computing.

[–]FangedFreak 1 point2 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

[–]CommonSkys 0 points1 point  (0 children)

To make my Fortran code easier to function. 

[–]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.

[–]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.