2017-03-16 58 views
0

我想這個小腳本的.txt文件的輸出,例如,Python的輸出文本

a = input ('what is your first name') 
b = input ('what is your last name') 
print ('Hello ' a + b) 

結果你好等等等等,問題是,如何保存答案一個.txt或htm文件...非常感謝

回答

0

使用shell重定向。例如python your_script > output.txt

+0

我試了一下,沒有工作,我也只想打印結果而不是問題(你好先上次)。有沒有像print('a + b')>> new.txt? –

+0

爲什麼你不使用文件處理 –

+0

我是初學者,仍在學習, –