from sys import argv
script, filename = argv
txt = open(filename)
print ("Here's your file %r:" % filename)
print (txt.read())
print ("Type the filename again:")
file_again = input("> ")
txt_again = open(file_again)
print (txt_again.read())
open(filename)就是打開文件命令 filename填寫文件路徑(路徑中不要出現(xiàn)中文)
print (txt.read()) 打印讀取的內(nèi)容