from sys import argv
script, filename = argv
#line 2 and 5 correspound with the name "Filename"
txt = open(filename)
print "Here's your file %r" % filename
print txt.read() #line 5 corresponds with this line... ".read" is a python function
print "Type the file name again:"
file_again = raw_input("> ")
txt_again = open(file_again)
print txt_again.read()
file_again = raw_input("> ")
如何與下面的線相對應,file_again
代表什麼?這條線與任何事情有什麼關係? Python
'file_again'是一個字符串,可能是文件的名稱,然後將其內容打印到屏幕上。你的意思是「對應」的具體內容嗎? – 2014-10-27 03:13:39
這可以通過googling「open」方法來解決 – 2014-10-27 03:14:45