列表list List是python的一个内置动态数组对象,它的基本使用方式如下: shoplist = ['apple', 'mango', 'carrot', 'banana'] print 'I have', len(shoplist),'items to purchase.' print 'These items are:', # Notice the comma at end of the line for item in shoplist: print item,…
#!/usr/bin/python import sys import os try: fn = sys.argv[1] except IndexError: print "please follow a argument at %s" % __file__ sys.exit() if not os.path.exists(fn): print "%s is not exists" % fn sys.exit() fd…