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

Apologies and Thanks: In the recent Great Crash around here, we definitely lost some of the material you nifty folk have sent to us recently. If you sent source code, web host recommendations, or ANYTHING, and you can not see it on the site, please sent it again. We have yet to reject a submission, although there were delays of a few weeks recently.


Miscellaneous Source Code
Source File or URL: Submitted By: Description:
spiral.py Steven Burr Based on a remarkable algorithm contributed to the python tutor mailing list by Danny Yoo. Depending on the arguments, spiral.py will print out a block of numbers or characters that spiral outward from the center. It just doesn't get much more useless than that! If for some reason you actually want to run this script, type "python spiral.py -h" (sans quotation marks) at the command line to learn about all of the useless options. For even more fun, open the file and see if you can spot the stupid code tricks.
mailtidy.py John J. Lee Remove duplicate email from unix mailboxes.
Karp.py Tim Peters Ahh... accomplishment!The attached implements the Karmarkar-Karp heuristic for the partitioning problem. It's very, very, very clever, and runs in an eyeblink. I won't try to explain it in full. Suffice it to say that at each step it decides to put the two largest numbers remaining into different sets -- but doesn't decide *which* sets until the very end!
practice.py Steven Burr Ahh... accomplishment!Yet another fascinating approach to the partitioning problem.
genetic.py
partition50.py
Danny Yoo Ahh... accomplishment!Ok, here's my contribution to the partitioning problem. I can only get it to 2 decimal places too, so I'm sure that someone can do much better!

Sample output:
Our best choice (00001010010001100011101001110110000101010110110101)has a value of 119.516797799
Difference between it and our target: 0.00110250314594
Ok, done computing. Our best choice,
sqrt(5) + sqrt(7) + sqrt(10) + sqrt(14) + sqrt(15) + sqrt(19) + sqrt(20) +
sqrt(21) + sqrt(23) + sqrt(26) + sqrt(27) + sqrt(28) + sqrt(30) +
sqrt(31) + sqrt(36) + sqrt(38) + sqrt(40) + sqrt(42) + sqrt(43) +
sqrt(45) + sqrt(46) + sqrt(48) +
sqrt(50)
is THIS close to our target: 0.00110250314594

recmath1dc.py Daniel Coughlin Ahh... accomplishment!The first solution for the Donald Knuth-inspired Useless Python Challenge.
roman2.py Lloyd Hugh Allen I know that the calculator challenge has already been solved, but here's a go with a twist: input and output are displayed in (well-formed) roman numerals.
333gl.py Gregor Lingl Ahh... accomplishment!ACM: Problem 333
HelpDesk.py William Voll Who couldn't use a random excuse generator for programmers?
notesmail.py Brian Dorsey It's basically a short easy way to send email from Lotus Notes.

XHTML! by Rob Andrews