stdin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#!/usr/bin/python
import sys
speed = 38
if len(sys.argv) < 3:
print 'Too few args.'
sys.exit()
if sys.argv[1] == '-m':
print int(sys.argv[2]) * 3600 * speed / 1024, 'MBs'
elif sys.argv[1] == '-h':
secs = int(sys.argv[2]) * 1024 / speed
hours = secs / 3660
print hours, 'hours', (secs - hours*3660)/60, 'mins'