save as hanoi.py,; then run:
#python hanoi.py 4
#!/bin/env python
import sys
import string
def hanoi(floor, towerA, towerB, towerC):
if (floor == 1):
print('get %s to %s'%(towerA,towerC))
else:
hanoi(floor - 1, towerA, towerC, towerB)
print('get %s to %s'%(towerA,towerC))
hanoi(floor - 1, towerB, towerA, towerC)
a=string.atoi(sys.argv[1])
hanoi(a, 'A', 'B', 'C')