我從過去幾周學習Python的艱辛的道路的argv和文件
from sys import argv
script,filename = argv
print "We're delete the file %r" %filename
print "If you want to stop ctrl+c (^c)"
print "Please hit enter to continue"
raw_input(">_")
print "Opening file..."
filen = open(filename,'w')
print "Truncating your file...."
filen.truncate()
print "now in your file %r" %filen
print "Writing time write something to your file"
line = raw_input("?")
print "write in progress..."
filen.write(line)
filen.write("\n end of document\n")
filen.close()
我要查看該文件的內容,但是當我使用print filename
或print filen
顯示它的名稱和可變打開文件學習蟒蛇filen
與美元符號有什麼出1行? –