+ 2
how to add content to already existed file in runtime.i mean input
3 odpowiedzi
+ 6
if you want to add something at the end of the file, you have to open it with "a" not "w".
f.open("file.txt","a")
0
from tkinter import simpledialog as in
another option
file=open("/home/user/Desktop/file.txt","a")
___this is if you want to add more information into txt file___"a"__
now
text=in.askstring("name","input text")
file.write(text)
file.close()
this is te way to ask in a message box
- 2
Here's a simple program to write into a file
import sys
fopen=open("file.txt","w") #full path of your file if it is not in the folder where your program is.
string1=input("Enter input")
fopen.write(string)
fopen.close()