5 Respuestas
+ 2
x = raw_input ('Write here: ')
with open('file.txt', 'a') as f:
f.write (x)
f.close ()
print 'Done !!'
+ 1
I am talking about some database like MySql, postgres etc and not a text file named database.txt
+ 1
you must use python-mysql module to MySQL for example.
you can Download it with pip:
pip install python-mysql
0
x = open("Database.txt", 'r')
x.write("Hello World")
close("Database.txt")
0
writing into files ? or are you talking about sqlite3 ??