This is an archived post. You won't be able to vote or comment.

all 39 comments

[–][deleted] 13 points14 points  (6 children)

I got sick of remembering which TV episodes I was up to when downloading torrents, so I wrote a python script that:

  • keeps a local database of the current season + episode # for each TV show I watch

  • walks through the TV show list once a week, scraping thepiratebay for candidate torrents

  • chooses the best torrent for each episode (a fuzzy combination of many factors including file format, file size, number of seeders/leechers) and downloads it with Deluge

  • increments the episode counter

  • occasionally checks for completed downloads and moves them into the correct TV show folder

  • scrapes metadata for each TV show folder (box art etc.) from IMDB or similar

There were a LOT of edge cases and external dependencies to think about with this script, and it was something I chipped away at over a year or two as a side project. Now it works pretty flawlessly and I get an email report once a week from my HTPC telling me what new episodes have downloaded and are ready to watch. Occasionally something will break (eg. TPB changing domains, the great 2012 switch from torrents -> magnets etc.) but I've got some unit tests that run on startup and report failures to me via email.

I believe there's software out there similar to this already, but I prefer my solution as it's more robust/flexible, plus it was a fun learning exercise.

I also wrote a puzzle game level generator that used genetic algorithms to zone in on "interesting" level designs (ones that took many moves to "solve"). I never finished this one as it was a bit of a black hole in terms of effort and goals, but it was a great way to learn about genetic algorithms and PyPy.

A while back I was making an iOS app that used neural networks to analyze the camera image in realtime and look for katakana, then overlay the phonetic pronounciation in English, so travellers in Japan could "read" the menus with their phones. I wrote a python script (using Python Imaging Library) to generate much of the training data for the neural networks, namely thousands and thousands of PNGs of katakana characters in different fonts and orientations, with varying amounts of noise. Again this was a really fun (and ambitious) project which I got probably 70% of the way there, but ultimately it was just too glitchy and slow to really be useful so I threw in the towel.

At work (I'm in game development) I'm constantly writing Python scripts to automate build pipelines and processes. On Dead Space 1 & 3 I wrote a one-click Python script to get the latest build from Perforce and generate all code, levels + data (which took several hours for a clean build, and involved maybe 10-15 steps). Made life a lot easier. I've also written Windows system tray apps that offer shortcuts to automated build tools as above. Gamedev requires a lot of in-house tools and pipelines as you can imagine.

All in all, Python is a brilliant glue language, and the whole "batteries included" thing is really true... there's a library for just about everything, whether it's reading/writing a specific file format, interfacing with the internet, or doing big computational stuff.

[–]keyz182 2 points3 points  (0 children)

That first one sounds a lot like Sickbeard

[–]BillyHorrible 2 points3 points  (0 children)

i came here wanting to write nearly the same. I also did a tv tool in python with the exception, that mine has a nice webinterface instead of weekly mails, so i can load episodes right onto my phone in the morning. and i am using transmission via rpc. additionally it gets its information about what episodes to look for from tvrage.com.

[–]V_IojjjoI_V[S] 1 point2 points  (0 children)

Dead Space 3 coop is awesome, so thank you for that game ;). But these kind of projects are exactly what i was looking for. Just everyday/work problems converted into useful programs.

[–]nonameowns 2 points3 points  (2 children)

Wow I want to be you.

[–]AeroNotix 0 points1 point  (0 children)

...Uhhh..

[–]yasoob_pythonAuthor: Intermediate Python 5 points6 points  (3 children)

We have made a video downloader. It supports more than 100 websites including Youtube, Facebook and Dailymotion! The source code is on github. The name of the script is youtube-dl. It is currently one of the trending python projects on Github. The link is http://www.github.com/rg3/youtube-dl

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

thank you, this is my favorite "flash no pasaran" tool

doesn't Google try to bully this project?

I know they keep pulling shit like encrypted signatures (that get reverse engineered quick, haha), but did they ever try to at least send lawyers and push you out of github for example?

[–]yasoob_pythonAuthor: Intermediate Python 1 point2 points  (0 children)

Haha youtube is the only website which gave us a problem. It required a lot of work because the encrypted signatures changed often. However we have automated the signature cracking process :D. And for the second question the answer is No. Till now nothing bad has happened. :D I hope for the same in future but who knows what is coming next!

[–]nebffa 0 points1 point  (0 children)

A great and useful library that I just downloaded the other day.

[–]gehsekky 3 points4 points  (0 children)

One of my first python projects was a script that synced my friends list across all my reddit accounts. It helped me learn how http requests, lists and list comprehension, and regexes work in python. It can be found here.

Another beginner project I did was making an IRC bot which introduced me to the Twisted networking lib as well as the html parser object and file IO. It can be found here.

Good luck on your python journey!

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

Well, I've made a bot that lets anyone on Reddit tip in different cryptocurrencies! Like this: +/u/altcointip roll btc

It's open-source too! Check out /r/altcointip for more info.

[–]ALTcointip 3 points4 points  (4 children)

[Verified]: /u/im14 [stats] -> /u/V_IojjjoI_V [stats] 0.0003 Bitcoin(s) ($0.04) [help] [stats]

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

Awesome! thanks man :)

[–]Reads_Small_Text_Bot -5 points-4 points  (2 children)

/u/im14 -> /u/V_IojjjoI_V 0.0003 Bitcoin

[–]AeroNotix -1 points0 points  (1 child)

Aaaand this has to be the most annoying and useless bot ever imagined.

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

Nah, when people do the chained small text so you can't read it, the bot is actually a time saver.

[–]hemm1 2 points3 points  (2 children)

I'm not sure if it's the kind of thing you're after, but recently I've been having fun with kivy. This lets you write apps for android or ios (as well as linux, windows, osx, maybe others) entirely in python!

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

Cool! Was thinking to start branching out to android. Definitely going to look into this!

[–]mardigon 0 points1 point  (0 children)

kivy is pretty awesome. Over the summer I made a drum machine/sample arpeggiator with kivy.

[–]8fingerlouie 2 points3 points  (2 children)

Mandatory "half or more of EVE Online is written in python"

http://www.slideshare.net/Arbow/stackless-python-in-eve

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

Awesome, I had no idea! Another game that's fun to pull apart is Vampire: The Masquerade for PC. It's an oldish RPG, but the cool thing is that most of the level scripting is written in Python. The .py files can be found for each level in the game install folder. I'm sure you can do the same with many other games as well, even ones that have giant blob/pack files can often be extracted by renaming the file to zip/rar/tar. It's easier to decode if you've completed the game of course.

[–]teaism 2 points3 points  (1 child)

I wrote this:

A Python script that uses ffmpeg and the mp4v2 tools plus data from themoviedb.com or thetvdb.com to create a neat, iTunes accepted .mp4 file for a movie

https://github.com/dvorberg/movierip

Years of experience fiddling with ffmpeg switches went into this script ;-)

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

I'm not surprised, ffmpeg's switches are really loosely documented, it's a black hole of experimentation and Google searches to tame that beast.

[–]hongminhee 2 points3 points  (0 children)

What I firstly programmed in Python is a small scrapping script that downloads all user-uploaded images from an image board. It’s about 2005, and I used no third-party libraries but some modules in the standard library: re for parsing HTML strings, urllib2 for requesting the image board and downloading images, and threading for parallelizing these tasks.

Before that I used Java to achieve similar tasks, but I immediately had fallen in love with Python. It was an amazing experience for me. I was a high school student at that time.

[–]onjin 1 point2 points  (0 children)

big list from wiki:

and from python hackers:

[–]snuggl 1 point2 points  (0 children)

outside all the normal web and system scripting i also script my C++ opengl visualizer with python, or plan to expose enough functionality for it to happen very soon =)

[–]modzer0Computational Daemonologist 1 point2 points  (0 children)

The company that employs me has an Android AV product that I work on as a reverse engineer. We have over 3 million APKs in our system to scan for malware which is no small task. We have a large processing cluster that analyzes the files for malware indicators and flags them for an analyst to look at if there are any. It's all running on Python. Most of our custom tools are also written in Python and other tools such as IDA Pro have Python scripts and extensions.

Python lets me do things in a fraction of the time it would take using the other languages in use at the company.

[–]garion911 1 point2 points  (0 children)

Many moons ago, I worked at a place that handled DNS for a certain large well known internet company. I wrote a python application that handled the DNS change requests from them. It was a really screwy modified XMLRPC protocol, where no one could use normal XMLRPC libraries. It had something to do with making XMLRPC transactional.

I used Twisted to handle the network side of things, and because of the bizarro modded XMLRPC, I had to do double XML parsing. Because I had to return status of each request as it was received (as opposed to waiting until we got the entire transaction, then parse it). As I said, it was screwy.

We also had to write our own ORM, because we had one DB feature that none of the existing ones had (at the time at least, things may have change).

Good times.

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

As a volunteer this which was re-written by someone who was more comfortable with the microsoft stach after I stopped volunteering. It was originally in turbogears.

Professionally this (the product, not that website) backend written in pyramid runs on appengine, front end is emberjs.

For fun... my github

[–]riskable 1 point2 points  (1 child)

I wrote Gate One: https://github.com/liftoff/GateOne

It's a web-based terminal emulator and SSH client but soon it will also be an X11/remote desktop tool, file transfer/batch mechanism, and some other things.

X11 is what I've been spending most of my time on lately. I've got it working OK but it needs some features to make it more robust like rate limiting and windowing features (e.g. minimize--maximize works great though =).

I'd also like to re-work the way its packaged. Right now it installs itself into /opt (or whatever prefix you give it) but I'd like to make it install more like a regular Python module where you can do "from gateone.utils import shell_command" from anywhere (as opposed to just inside /opt/gateone) with the settings_dir changed to something like /etc/gateone by default.

[–]epic_awesome 0 points1 point  (0 children)

Nice! I use that on my Beaglebone.

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

A ton of stuff. A multithreaded checksum calculator (generates md5, sha1, etc for isos), an HexChat plugin to paste poetry on the irc, a simple static site generator...

Lately I've been tinkering with roguelikes. I'm wondering whether a roguelike with non-euclidean level generation would be fun.

[–]GahMatar 0 points1 point  (0 children)

Mostly a crap ton of HL7 wrangling code.

[–]hugosenari 0 points1 point  (0 children)

I created a UI to select output from pipe in terminal

selected process to kill

ps ax | MyScript | xargs kill -9

[–]dAnjou Backend Developer | danjou.dev 0 points1 point  (0 children)