Source Code Getting Started Python Challenge Programming Contests Useless Python Images What is Python? Useless Python Supporters Python Tutorials Source Code Links Miscellaneous Links Mississippi Python Interest Group (MS PIGgie) Contact Us

Useless Source Code Pages: Page One Page Two Page Three Page Four Page Five Page Six Page Seven Page Eight Page Nine Page Ten Page Eleven Page Twelve Page Thirteen Page Fourteen Page Fifteen Page Sixteen

Miscellaneous Source Code
Source File or URL: Submitted By: Description:
withls.txt Levente Sandor This is a 'with' method for Python -- the equivalent of the 'with' statement in Pascal or VB
Unzip.txt Christopher P. Smith This code will unzip lists which have been zipped together. If you created a zipped list, l=zip(a,b,c), you can use unzip to extract one or more of the lists: a,b,c=unzip(l) b=unzip(l,1) a,c=unzip(0,2)
332gl.py Gregor Lingl Ahh... accomplishment!ACM: Problem 332
float_vs_int_silly.py Paul Winkler This is indeed useless. It does a bunch of random arithmetic on some numbers, and compares the amount of accumulating error when each stage truncates to integer, rounds to integer, or keeps the result as a float. I was curious how much error integer arithmetic could accumulate. Quite a lot!
pipe-test-r.py
pipe-test-w.py
Paul Winkler A pair of scripts I wrote to see how hard I could push the sched module writing to stdout before its timing got bad. I used them like this on unix: pipe-test-w.py 100 10 | pipe-test-r.py This writes 100 text lines per second for 10 seconds; pipe-test-r.py then reports statistics on the intended and actual delivery times.
Decision_Analysis_Beta28.py Paul Winkler I thought the decision maker was pretty interesting, but when I looked at the source code I was surprised at how much cut-n-paste was going on ... e.g. defining an identical function three or four times. I started refactoring and stopped when I fell asleep. There's more that could be done, but it's already about 25% shorter and IMHO more readable and maintainable.
russianroulette.py Tesla Coil Ahh... accomplishment!I guess this qualifies as "a game of any kind." >:}
bulk-mail.py Paul Winkler sends a message to a bunch of addresses contained in a file in which each line contains an email address. I don't use this for spam; I have an announcement list that people actually sign up for. People who send spam are evil scum.
address-mangler.py Paul Winkler reads from stdin, mangles email addresses into a form that should be human-readable but not friendly to spambots, writes to stdout.
FormSummarize.py Danny Yoo Here's another useless script I cooked up to help me look at HTML forms embedded in large, messy HTML. (I'm using it to help debug some CGIs at the moment.) It's another example of htmllib, so I thought it might be instructive for people.

XHTML! by Rob Andrews