📅  最后修改于: 2022-03-11 14:46:15.038000             🧑  作者: Mango
#Print User Input to A File
x = input("Enter blah : ")
y = open('C:\Users\USERNAME\Documents\Doc1.txt', 'w')
y.write(x)
#Convert text to binary and then write to file
x = input("Enter blah : ")
y = open('C:\Users\USERNAME\Documents\Doc1.txt', 'wb')
y.write(x)