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.
how to change the file extension
-
I have saved a file named file.txt but it appears actually to be file.txt.py.
How can I avoid the .py extension ?
Thanks.
-
Well, Pythonista's purpose is to be a working editor and environment for Python, so afaik it is not intended to be a fully functional file manager and editor.
But as it is more than just a file manager or editor, Pythonista does allow for a file manager being written in Python and run in the console. Here's a nice one:
http://omz-software.com/pythonista/forums/discussion/74/advanced-shell-shellista
As for creating and writing a file, use Python's built-in open(), like this:
<code>with open('test.txt', 'wb') as file:
file.write('This is a test.')
file.close()</code> -
Thank you very much . Good link.
I have managed to change the file name using:
os.rename('file.txt.py','file.txt')