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.
Python 3.x Progress Update
-
My one comment is that there needs to be a way to copy files between the apps, not just move. The first thing I tried to do was copy my
site-packages
to Pythonista 3, but then I found that they had all been removed from the Pythonista 2 app -
Edit: Ignore this -- user error!
First bug report:
import sympy
-
@omz can you add support for multiple documentation tabs (like in Editorial)
-
@ccc That works for me.
-
@ccc No problems here either:
>>> import sympy >>> sympy.Matrix([[1, 0], [0, 1]]).det() 1
Perhaps you have a file called
sympy.py
in your Documents folder?;)
At least the most important feature works - proper Unicode support:
>>> len("🐍") 1
-
Nice to see so many of the PyPI modules upgraded. Scroll down to the Python3 listing at https://github.com/cclauss/pythonista-module-versions
wsgiref and yaml are missing in addition to mechanize, midiutil, screenplain, and xhtml2pdf.
-
@Webmaster4o said:
IMHO we should keep the Python 2 app as Python-2-esque as possible. It's for a different audience than the Python 3 app, and the people who continue to use it probably will use it because they prefer Python 2, and if they want Python 3 features they can buy the app. It's fine that future exists, I don't think an option for automatically using it will be in the spirit of Python 2
Totally agreed! Especially since now we have 2 separate products, I don't see why you have to bend Python 2 to fake it like Python 3. If you prefer Python 3, just buy the new Pythonista 3. In the spirit of Unix (from which iOS draws its root), it's better to "Do one thing and do it well".
-
How the heck does async/await work in Python 3.5? Is the iOS going to limit us on asyncio and the like?
-
Got the beta! This is exciting.
-
@ccc Why should it?
asyncio
already existed in earlier versions of Python based on decorators and generators, theasync
andawait
keywords only integrate it into the language better. There's no kind of threading or process spawning involved as I understand it. -
This post is deleted! -
Random observations so far:
- Startup time (the delay between the editor appearing and
pythonista_startup
being run) is much shorter on Pythonista 3 than on Pythonista 2. Not sure if that might be because my Pythonista 2 contains a ton of files and my Pythonista 3 is almost empty. exit
,sys.exit
andSystemExit
exceptions actually kill Pythonista, which onlyos._exit
used to do.async
andawait
are not treated as keywords by Pythonista. It is true that they can still be used as normal identifiers (until Python 3.7) for backwards compatibility, but that doesn't mean that you should do that.- The behavior of
editor.open_file
was changed - previously it took a path relative to~/Documents
, now it expects an absolute path. (This probably changed in an earlier beta, but I only noticed it now.) - The "welcome" file seems to be missing in Pythonista 3.
- Startup time (the delay between the editor appearing and
-
You can crash P3 if you try to create a new file in the editor while you are in the P2 folder.
-
@omz What's going to happen with the template? Bake everything into one with some sort of switch/delete operation? Is it already secretly baked in? Will there be a separate one?
-
@Tizzy There will probably be a second one.
-
Hey, @omz, In some recent beta (maybe not this one) you changed the console text input to be something other than
PA2PromptTextField
. How can I find this view now, inobjc_util
? It doesn't have a distinct class name anymore. -
Startup time (the delay between the editor appearing and pythonista_startup being run) is much shorter on Pythonista 3 than on Pythonista 2. Not sure if that might be because my Pythonista 2 contains a ton of files and my Pythonista 3 is almost empty.
I've optimised the
importcompletion
module a bit in Pythonista 3 by using a cache for modules that can't change (pylib). It has to load all available modules on startup for the console's autocompletion to work. For some reason (that I don't really understand), this was much slower using Python 3, so the optimisation was really necessary, but Pythonista 2 could probably also benefit from it. The fact that you don't have as much stuff in site-packages probably also helps quite a bit though.exit, sys.exit and SystemExit exceptions actually kill Pythonista, which only os._exit used to do.
Thanks, I'll have to look into that.
async and await are not treated as keywords by Pythonista.
I have that on my todo list.
The behavior of editor.open_file was changed - previously it took a path relative to ~/Documents, now it expects an absolute path. (This probably changed in an earlier beta, but I only noticed it now.)
I actually re-implemented the entire module for Pythonista 3 using
objc_util
, and apparently forgot thatopen_file
should be able to deal with relative paths...The "welcome" file seems to be missing in Pythonista 3.
I'll write that when the app is finished.
You can crash P3 if you try to create a new file in the editor while you are in the P2 folder.
Oops! Good to know.
What's going to happen with the template?
I'll make a separate template when the app is done, but I don't really want to maintain that alongside the beta.
Hey, @omz, In some recent beta (maybe not this one) you changed the console text input to be something other than PA2PromptTextField.
No, I haven't changed that, it should still be a
PA2PromptTextField
. -
@omz importcompletion is not relevant for the template? if so is it removed?
-
@Tizzy No, it's not relevant there, and I've essentially removed it to speed up launching standalone apps.
-
UPDATE: figured out there is a built in tool in sublime text to convert spaces to tabs in indentation.
View > Indentation > Convert Indentation to SpacesPS - anyway to scale the size of images posted here?
Also, the traceback popover doesn't seem to let me jump to the actual spot of the error as it seems to usually do in Pytonista 2, but it does show the file and line number. The last spot it lets me jump to is the import statement of the module where the error is actually at, not the module itself...
Also noticed there is a "convert tabs" action built into Pythonista 3 not yet implemented....I'm guessing this will do the same thing.
Ok, so I just tried running my app in Pythonista 3 beta. The tool to 2to3 seems to work.
But I've bumped into something right away. Seems to be much less forgiving in terms of tabs/spaces? Can anyone recommend a tool for sublime text to fix this kind of stuff? I've looked at it and it looks alright. I might have copy pasted it from another part of the code...?
"TabError: inconsistent use of tabs and spaces in indentation"