Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Creating a textfile from within the program
-
In pythonista is it possible to create an output textfile from within the code itself. Meaning say i want to create a text file called hi.txt and it doesnt already exist. Is there a functions that will allow me to create from within the program without creating it myself?
-
@karthikmaiya, not sure what you are asking about, but try:
with open("hi.txt", "w"): pass
-
Basically i want to dynamically generate an output .txt file using python
-
my_text = 'Basically I want to dynamically generate an output .txt file using python.' with open('hi.txt', 'w') as out_file: out_file.write(my_text)