Posts Tagged ‘python’

Basic TKinter GUI format in python

Wednesday, July 23rd, 2008 by webstersprodigy

Though there are many ways to format your gui code, the following seems to work well for me. It is not pretty, but the important thing is just how I laid it out. Basically, I like making a subclass of frame for almost everything.

TKinter radio buttons in python

Friday, July 18th, 2008 by webstersprodigy

This is pretty straightforward. I tend to structure all my gui programs so far in almost the same way, with the inherited frame class doing all the packing.

md5check directories

Saturday, July 12th, 2008 by webstersprodigy

This is a python script that recursively md5sums all the files in your directory and compares it with another directory. It is similar, and probably less good than “find /dirone -type f -print0 | md5sum”

recursive remove in python

Monday, July 7th, 2008 by webstersprodigy

In the book Programming Python’, an entire chapter is dedicated to recursive copyting of directories, recursive deletion, etc. He uses the os tools to accomplish this. The reason something like this is necessary is the fact that the os tools do not have a built-in recusive delete. For example, if in my current directory I had a folder named ‘test2′, I would get the following error when trying to remove it.

python script similar to cat

Thursday, July 3rd, 2008 by webstersprodigy

This is a stupid script similar to cat. Again, I am using it for windows.

Recursive Search and Replace

Wednesday, June 25th, 2008 by webstersprodigy

This is something I do again and again… traverse down a directory tree searching and replacing for a certain amount of text. Especially since dynamic content is not allowed on ISU’s main webserver (how lame!)

python script similar to join

Tuesday, June 3rd, 2008 by webstersprodigy

python script similar to join. I used this to script on windows, since I could not find a join there. def join(fromdir, tofile):   output = open(tofile, ‘wb’)   parts = os.listdir(fromdir)   parts.sort()   for filename in parts:     filepath = os.path.join(fromdir, filename)     fileobj = open(filepath, ‘rb’)     while 1:       filebytes = [...]

Encrypt a message with RSA in python

Monday, May 5th, 2008 by webstersprodigy

For some people in my class this was easy, and others it was difficult. Some people have spent a good 40 hours on this, so I thought I’d post some code to help out. There isn’t much documentation on the crypto modules.

Get Weather from the commandline

Monday, April 28th, 2008 by webstersprodigy

This is a program written in python that gets the weather from the command line. The usage is like: $ weather.py 83204 5-day Forcast for 83206 ——————— Monday Tuesday Wednesday Thursday Friday High: 74 68 47 49 58 Low: 43 34 29 27 32 It breaks occasionally, most likely because wunderground’s output isn’t consistant.  but [...]


No computers were harmed in the 0.286 seconds it took to produce this page.