從我的閱讀的一個問題學習Python困難的方法:的raw_input()在Python
y = raw_input("Name? ")
,並將結果置於變量y。
然後在下面的代碼,的raw_input( 「?」)線9,哪裏,結果去了?
from sys import argv
script, filename = argv
print "We're going to erase %r." % filename
print "If you don't want that, hit CTRL-C (^C)."
print "If you do want that, hit RETURN."
raw_input("?")
print "Opening the file..."
target = open(filename, 'w')
...
需要注意的是「什麼」不一定會導致程序繼續;程序只會在輸入以「Enter」終止時重新獲得控制權。 –