Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Python: Create a list inside a tuple

T = (1, [2, 3], 4)
print type(T)
print len(T)
T[1][0] = 'python.tubedir.com'
print T
print T[1]

Python: Using the sys Module to Get Script Arguments

import sys
print "current script name is", sys.argv[0]
if len(sys.argv) > 1:
    print "there are", len(sys.argv)-1, "arguments:"
    for arg in sy