I haven't written any. I was tasked last year to teach an intern to do some inhouse programs using Python. That time, I was just learning Python before I mentored the intern.
I found Python likable as it is really easy to do tasks.
Tell me any interesting programs you have written so far.
Re: Any interesting Python programs you have written?
Years ago I wrote a program in AMOS basic on the Amiga for jazz guitarists which, among many other things, thoroughly analyzed chord shapes that you gave it. Without going into it too much, the code for that took me nearly a week in AMOS. I didn't program anything else for nearly 10 years and recently picked up Python. Toying with the idea of writing the program again, I started playing with some code to analyze chord notes in the same way. It was finished in 3 hours. I was almost disappointed at how easy it was in comparison.
Re: Any interesting Python programs you have written?
Here is my simple python program, ummm ...., interesting!
Code:
# aa.py
import sys
fontMap = "111001001110111010101110111011101110111|101011000010001010101000100000101010101|101001001110011011101110111000101110111|101001001000001000100010101000101010001|111011101110111000101110111000101110111".split('|')
W=4
if len(sys.argv) != 2:
print "Usage\n\taa.py <number>"
sys.exit(1)
else:
number = sys.argv[1]
for row in fontMap:
line = ''
for d in number:
if d not in '0123456789':
print 'Error: Only digits allowed!'
sys.exit(1)
i1 = int(d) * W
i2 = i1 + W
line += row[i1:i2]
if d == '9': line += ' '
line = line.replace('0', ' ')
line = line.replace('1', '@')
print line
sys.exit(0)
Re: Any interesting Python programs you have written?
I've worked on a lot of automata related programs with Python: bottom-up parsers, top-down parsers, cellular automata demonstrations, DFA and NFA abstractions--oh yeah, and regular expressions, which Python is very well-suited for. I've also worked on 3d armature exporters and 2d games as well, which is a testament to how versatile the language can be.
Bookmarks