Python 基礎(chǔ)教程
題目:從鍵盤輸入一些字符,逐個把它們寫到磁盤文件上,直到輸入一個 # 為止。
程序分析:無。
程序源代碼:
以上實例輸出結(jié)果為:
輸入文件名: jsonfile.txt 輸入字符串: json json google google#
實例中創(chuàng)建了 jsonfile.txt 文件并向其寫入 json 和 google 兩個字符串,查看 jsonfile.txt 文件內(nèi)容:
$ cat jsonfile.txt jsongoogle其他擴展