Answers for "how to write user input to a file in python"

0

how to write user input to a file in python

#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)
Posted by: Guest on June-24-2020

Code answers related to "how to write user input to a file in python"

Python Answers by Framework

Browse Popular Code Answers by Language