发布时间:2019-09-11 07:42:16编辑:auto阅读(2842)
#!/usr/bin/python
# -*- coding:utf-8 -*-
import sys
def readFile(filename):
f = file(filename)
while True:
fileContext = f.readline()
if len(fileContext) ==0:
break;
print fileContext
f.close()
if len(sys.argv) < 2:
print "No function be setted."
sys.exit()
if sys.argv[1].startswith("-"):
option = sys.argv[1][1:]
if option == 'version':
print "Version1.2"
elif option == 'help':
print "enter an filename to see the context of it!"
else:
print "Unknown function!"
sys.exit()
else:
for filename in sys.argv[1:]:
readFile(filename)
上一篇: python + wxPython +
下一篇: vscode安装python插件
54958
41754
36341
31772
26672
26365
24889
20495
16437
15855
2986°
2712°
2812°
2958°
2895°
3157°
3047°
2893°
2883°
2862°