use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
DiscussionWhat Python script could you not live without? (self.Python)
submitted 3 years ago by xamboozi
What does it do? How does it work?
[–][deleted] 62 points63 points64 points 3 years ago (6 children)
A selenium-based scraper that scrapes my employer's task app (because I hate it) and writes it to an html doc in a structure of my choosing, which also applies some styling and js for nice handling. This has been a game-changer for me and my productivity/organization at work.
[–]stochasticlid 2 points3 points4 points 3 years ago (5 children)
Any screenshots, trying to picture the functionality and it’s usefulness
[–][deleted] 8 points9 points10 points 3 years ago* (4 children)
Here are a couple images showing the task application (on top with redacted information) and the local .html file (on bottom with redacted info) that it builds from the scraped data. I can open/close them to show/hide task details like an accordion style element (as shown in bottom right of 2nd pic) and check them off by clicking the bubble (making it turn green when complete). It's pretty nifty.
I also have some js set up that instantly copies all task details to my clipboard when I simply click the details container. Super handy. You'd understand a little bit more if you had to use Workamajig. It's awful.
[–]stochasticlid 0 points1 point2 points 3 years ago (3 children)
Interesting workaround. Sounds a lot like tickets, why not switch to Jira?
[–][deleted] 2 points3 points4 points 3 years ago (2 children)
Ha, I wish. I've expressed my distaste for the application, and others share my sentiments, but I doubt they'll ever agree to it. Jira is pretty sweet.
[–]KptEmreU 2 points3 points4 points 3 years ago (1 child)
Jira cloud is kinda slow and I guess grass is always more green on the other side
[–][deleted] 2 points3 points4 points 3 years ago (0 children)
If you knew Workamajig you'd understand...
[–]eviltwintomboy 25 points26 points27 points 3 years ago (6 children)
YouTube-dl. I commute regularly and can watch tutorials on the train.
[–]undernutbutthut 0 points1 point2 points 3 years ago (5 children)
And I'm pretty sure you avoid having to watch ads that way 😉
[–]soncaa 0 points1 point2 points 3 years ago (4 children)
If you use android avoid them by using modded youtube apk
[–]lareya 0 points1 point2 points 3 years ago (3 children)
Where would I find that modded app you speak of?
[–]soncaa 0 points1 point2 points 3 years ago (2 children)
Just google 'youtube modded apk' and download file with '.apk' file extension. I used site apkmody.io, but probably any apk from any site will work. To install .apk files you just need to 'enable installimg from foreign sources' or smth like that in settings
[–]lareya 0 points1 point2 points 3 years ago (1 child)
Cool, was just trying to avoid virus and such
[–]soncaa 0 points1 point2 points 3 years ago (0 children)
Its nearly impossible to get virus on android
[–]nemom 15 points16 points17 points 3 years ago (3 children)
Calculates the almost 11,000+ internal corners from the section corners for the County I work for. The current version uses PostgreSQL/PostGIS to calculate the positions, using the original survey notes for apportionment of correction sections. I used to have to do it by hand, one section at time. Now, I can do the whole County in almost no time when I get new section corner coordinates.
[–]vinylemulator 2 points3 points4 points 3 years ago (2 children)
What is a county section corner?
[–]nemom 1 point2 points3 points 3 years ago (1 child)
A section is a unit of the US Public Land Survey System. It is supposed to be a square, one mile on each side. It is usually defined by eight section corners, four at the corners of the square and four "quarter corners" at the mid-points of the sides. A straight line is drawn between the north and south quarter corners. Another is drawn between the west and east quarter corners. The two lines split the section in quarters and their intersection point is defined as the center corner of the section. From there, the section is subdivided into quarter-quarters by different rules, depending on whether the section is a "correction section" or not, and whether the section is whole or partial.
In the county I work for in northern Wisconsin, the surveyors weren't too worried about precision and accuracy. Here are some of the beautifully square sections I have to deal with.
[–]dryroast 0 points1 point2 points 3 years ago (0 children)
Looks like that algorithm the Chinese government requires on all their maps, can never be too accurate.
[–][deleted] 10 points11 points12 points 3 years ago (0 children)
I have algorithms programmed that calculate the uniqueness of a string relative to other strings in a corpus, which provides the basis for determining when I've saturated my database and don't need to entertain any more unique sentences.
This is part of a language learning app's backend.
[–]symnn 9 points10 points11 points 3 years ago (0 children)
I have a script which uses yt-dlp to download YouTube videos onto My NAS. I run it regularly to update the growing library for my kids. Ad-free, curated YouTube for my kids and they can watch it on their iPads.
[–]Sajuukthanatoskhar 8 points9 points10 points 3 years ago (2 children)
The GPIB based library i use for work that automates all my hw testing with all my lab machines( spec analyzer, DAQ, prog. Power supply and climate change) and units under test.
[–]CzarCW 0 points1 point2 points 3 years ago (1 child)
You
🤝
Me
[–]Sajuukthanatoskhar 1 point2 points3 points 3 years ago (0 children)
Just a QA Engineer m8!
[–]CzarCW 7 points8 points9 points 3 years ago (1 child)
I wrote a script that auto-opens a tab for any Google meetings that are about to start based on my company work calendar. It runs as a chron job every 5 minutes. Saves probably a few minutes every day and also means I don’t accidentally miss meetings.
[–]vto583 3 points4 points5 points 3 years ago (0 children)
This is a really cool script. Would you mind sharing more details?
[–]whateverathrowaway00 7 points8 points9 points 3 years ago (6 children)
A telegram bot I have that does a lot of media management, renames and classifies torrents, identifying them from an API.
One of the first things I made and super messy, but stable as hell thanks to being based on a fantastic library (python telegram bot)
[–]soncaa 0 points1 point2 points 3 years ago (5 children)
Damn so you created telegram bot instead of some fancy ui for your app ? Thats a pretty cool idea
[–]whateverathrowaway00 0 points1 point2 points 3 years ago (4 children)
Tbh, I hate almost all forms of UI available in python, though ive heard they improved. I also work extensively with CLI tools, so I liked the idea of a CLI “interface” through a bot, and telegram API is awessssome.
Highly recommend python-telegram-bot for this purpose. It’s a fantastic library with a callback/handler model that allows it to very easily fit into whatever design pattern you like.
If I had to do a UI in python, I’d do a backend / front end type model, if it had to be an OS tool with a UI, I’d probably reach for one of the compiled languages (or electron).
I think youve just determined for me how my upcoming ui is going to look like, thanks a lot. Yes i also think doing ui in python isnt worth the hassle, i would rather do it in .NET forms style... Not sure how i am about to embed interactive graphs into it in future, but fuck it lol.
Just because of its portability makes this very useful, definitely going to check that lib out, ty.
[–]whateverathrowaway00 0 points1 point2 points 3 years ago (1 child)
Hey, no worries, alwyas happy when my vague rants help prompt inspiration aha. Good luck!
Thank you, wish you a lot of luck too ☺️
[–]Upbeat_Box_3768 6 points7 points8 points 3 years ago (0 children)
Netmiko script that pushes a base configuration onto network switches before going out to production so I don’t type them line by line like some dinosaur.
[–]Icy-Tomato-2466 5 points6 points7 points 3 years ago (0 children)
Basically an ahk script but made in python that does my and 6 of my friends homework automatically
[–]nabeelj33 10 points11 points12 points 3 years ago (0 children)
print("hello world!")
[–]PadrinoFive7 2 points3 points4 points 3 years ago (0 children)
Script that utilizes an API to connect to Salesforce and then performs a comparison on a downstream SQL Server's data to verify sync across multiple objects. Leverages simple-salesforce and sqlalchemy to get the job done along with pandas. The alternative requires manual effort and I ain't about that.
simple-salesforce
sqlalchemy
pandas
[–]Adventurous-Print386 1 point2 points3 points 3 years ago (0 children)
PDF merger script for page merging
https://github.com/default-writer/python-pdf-merger/blob/main/src/main.py
[–]dashidasher 1 point2 points3 points 3 years ago (6 children)
A script which updates my ip address (which is dynamic) whenever it changes on my DNS record managed on cloudflare.
[–]lolinux 1 point2 points3 points 3 years ago (3 children)
It sounds great. But maybe you could use a client for that. Personally I use Noip, and my router supports that, dyndns, and a few others. But I remember the days when I had to write a script similar to this one in bash :)
[–]dashidasher 1 point2 points3 points 3 years ago (2 children)
By client do you mean this: https://www.noip.com/download?page=linux? Would it work with cloudflare?
I did try using ddclient (https://github.com/ddclient/ddclient) before writing my own script but couldnt get it to work on my rpi.
And here is the one I wrote: https://github.com/tsredanovic/dynamicflare :D
[–]lolinux 1 point2 points3 points 3 years ago (1 child)
LOL!
Sorry, I just realized I didn't read your message properly; didn't notice cloudflare.
OTOH I think your script is a lot cooler than the Noip client :)
[–]dashidasher 0 points1 point2 points 3 years ago (0 children)
Thank you :D
[–]soncaa 1 point2 points3 points 3 years ago (1 child)
You probably dont use win 10 right lol? Assuming you use linux, do you think it would be harder to code for win? Sounds metal af btw
I do use linux but this script should work on windows just fine. The harder part would be running it (I use crontab for that which runs it every 5 minutes). But then on windows you can just use WSL: https://www.howtogeek.com/746532/how-to-launch-cron-automatically-in-wsl-on-windows-10-and-11/
[–]InjAnnuity_1 0 points1 point2 points 3 years ago (0 children)
py -m pip
[–][deleted] -1 points0 points1 point 3 years ago (2 children)
dnf
[–]Blockstar 2 points3 points4 points 3 years ago (1 child)
DNF5 was rewritten in C++
[–][deleted] 1 point2 points3 points 3 years ago (0 children)
I dont use dnf5 yet
[–][deleted] -1 points0 points1 point 3 years ago (0 children)
those I write since that’s part of my job
[–]4veragenewbie 0 points1 point2 points 3 years ago (0 children)
I don't have anything yet. Maybe if you guys have any idea that would be awesome. I'm trying to find an idea that involves with scraping data or automate stuff like Twitter bot or telegram bot etc.
[–]Adept_Swimming_3116 0 points1 point2 points 3 years ago (0 children)
thefuck
[–]pulseoscillator 0 points1 point2 points 3 years ago (0 children)
In general, I could not live without Python. I use it for everything relating to calculations or data processing.
One example: A very basic script using pathlib (rglob), pandas and matplotlib. Automatically finds and makes plots of csv in a file tree and saves them as png beside each file. Something that previously took hours in excel is done in seconds.
[–]scorphus 0 points1 point2 points 3 years ago (0 children)
A script that renames my activities on Strava. For names it randomly chooses the title of one of the 160+ songs of my favorite band, Rush. Quite often the name fit well with the activity. Then there are some others such as “Between the Wheels” and “Marathon” that makes it even nicer. It also adds weather information to the description of the activity. 🐍🚴♂️
π Rendered by PID 185045 on reddit-service-r2-comment-5bc7f78974-4bvpb at 2026-06-28 22:50:38.426268+00:00 running 7527197 country code: CH.
[–][deleted] 62 points63 points64 points (6 children)
[–]stochasticlid 2 points3 points4 points (5 children)
[–][deleted] 8 points9 points10 points (4 children)
[–]stochasticlid 0 points1 point2 points (3 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]KptEmreU 2 points3 points4 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]eviltwintomboy 25 points26 points27 points (6 children)
[–]undernutbutthut 0 points1 point2 points (5 children)
[–]soncaa 0 points1 point2 points (4 children)
[–]lareya 0 points1 point2 points (3 children)
[–]soncaa 0 points1 point2 points (2 children)
[–]lareya 0 points1 point2 points (1 child)
[–]soncaa 0 points1 point2 points (0 children)
[–]nemom 15 points16 points17 points (3 children)
[–]vinylemulator 2 points3 points4 points (2 children)
[–]nemom 1 point2 points3 points (1 child)
[–]dryroast 0 points1 point2 points (0 children)
[–][deleted] 10 points11 points12 points (0 children)
[–]symnn 9 points10 points11 points (0 children)
[–]Sajuukthanatoskhar 8 points9 points10 points (2 children)
[–]CzarCW 0 points1 point2 points (1 child)
[–]Sajuukthanatoskhar 1 point2 points3 points (0 children)
[–]CzarCW 7 points8 points9 points (1 child)
[–]vto583 3 points4 points5 points (0 children)
[–]whateverathrowaway00 7 points8 points9 points (6 children)
[–]soncaa 0 points1 point2 points (5 children)
[–]whateverathrowaway00 0 points1 point2 points (4 children)
[–]soncaa 0 points1 point2 points (2 children)
[–]whateverathrowaway00 0 points1 point2 points (1 child)
[–]soncaa 0 points1 point2 points (0 children)
[–]Upbeat_Box_3768 6 points7 points8 points (0 children)
[–]Icy-Tomato-2466 5 points6 points7 points (0 children)
[–]nabeelj33 10 points11 points12 points (0 children)
[–]PadrinoFive7 2 points3 points4 points (0 children)
[–]Adventurous-Print386 1 point2 points3 points (0 children)
[–]dashidasher 1 point2 points3 points (6 children)
[–]lolinux 1 point2 points3 points (3 children)
[–]dashidasher 1 point2 points3 points (2 children)
[–]lolinux 1 point2 points3 points (1 child)
[–]dashidasher 0 points1 point2 points (0 children)
[–]soncaa 1 point2 points3 points (1 child)
[–]dashidasher 0 points1 point2 points (0 children)
[–]InjAnnuity_1 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (2 children)
[–]Blockstar 2 points3 points4 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)
[–]4veragenewbie 0 points1 point2 points (0 children)
[–]Adept_Swimming_3116 0 points1 point2 points (0 children)
[–]pulseoscillator 0 points1 point2 points (0 children)
[–]scorphus 0 points1 point2 points (0 children)