Python 3.x Progress Update
Python 3.x support has been a topic of discussion here for years, and I finally have some news on that front. :)
As I've teased a bit earlier on Twitter, I'm working on a version of Pythonista that is based on Python 3.5.1 instead of the current 2.7.5. I've made pretty good progress recently, and the app is already in a completely usable state with most custom and third-party modules working. The app's UI is essentially identical to Pythonista 2.0.
Things that are working so far:
- Python 3.5.1 with all new syntax features and most standard library modules (exceptions are basically the same as in 2.x, i.e. mostly Tkinter)
- Numpy, matplotlib, Pillow, PyCrypto, and most other third-party modules that are currently included in Pythonista 2.0 (in some cases more recent versions than in 2.0)
- Most custom modules (
Not working yet:
- A few custom modules (currently only
- The app extension (invoking Pythonista from the share sheet)
- The URL scheme
- The documentation browser
- The example scripts aren't completely ported yet
- A couple of third-party modules that are included in Pythonista 2.0, but aren't (yet?) compatible with Python 3 (screenplain, midiutil, mechanize, xhtml2pdf)
There are probably still a few bugs in the ported versions of my custom modules. Getting the string/unicode handling to work right has been tricky in some cases, and I haven't tested all modules very thoroughly yet.
I expect that I'll have the first beta ready within the next week or so, hopefully without some of the limitations I've listed above. I'll post a new beta signup form here when I'm ready.
Lastly, this will be a separate app, or "paid upgrade" if you will. This is, by the way, one of the reasons I did not charge for the 2.0 update. It'll co-exist with Pythonista 2.x for a while because there are still valid reasons to prefer Python 2.7, and I don't want to force people to upgrade to a version that is not backwards-compatible.
As I've mentioned before, creating an app that supports both Python 2 and 3 would be very difficult, if not impossible. The only way this could theoretically work would require relaunching the app in order to switch versions, and I honestly think that having Python 3 in a separate app will result in a better user experience and less confusion. It will be possible to access files in Pythonista 2.x from 3.x though (and vice-versa).
@omz "Dyld Error Message: Symbol not found: NSArray0" seems to be error I'm getting. I tried googling the error and it seems if you remove and add CoreFoundation it fixes it. Or if you make the build target 8.4 that seems to fix it for some. Hope that error helps somewhat. Also makes sense to not support 8 anymore especially since anyone who experienced the horrors of 8 upgraded to 9. I might upgrade soon too and it might be because of your awesome app
@dgelessus I have waited hours. It does not complete. I tried deleting the old copy and it still stops just before completing the install. I have not deleted the copy of Pythonista 2.7, is that necessary?
@omz Thanks a lot, now the beta invite came to me too. Sorry for me being impatient.
I asked for this in the beta request, here is the duplicate. It would be great if there were more shortcuts for external keyboards in P3. For example, ctrl+tab for the tab switching would be a useful feature.
@ihf Beta works fine with the P2 installed. I think that the P2 existence doesn't matter for the P3 installation. Moreover, there's a P2 folder support in the P3, which means that P2+P3 should be ok.
@RedDrago Thanks, the problem seems to be that I accidentally built one of the shared frameworks with a deployment target of iOS 9 (the default setting). Should be easy to fix, but you'll have to wait for the next build (but that shouldn't take as long as the last one).
@omz Oh awesome yea thats not a problem atleast you found the problem
@Webmaster4o If you really really want line numbers on the small screen, here you go:
from objc_util import ObjCClass ObjCClass('NSUserDefaults').standardUserDefaults().setBool_forKey_(True, 'EditorShowLineNumbersOnPhone')
(takes effect for editor tabs that are opened afterwards)
@ihf I had the same problem that you had in installing the new Pythonista3 beta on two of our four iPads here. No problems at all with the other two iPads.
After several failed attempts, I tried the pythonista3:// trick but that failed to work.
I went into Pythonista 2 and opened the Pythonista3 folder can copied over a few files and folders that I really wanted to preserve.
I then deleted all files in the Pythonista3 and then tried to reinstall. That failed.
Finally, I deleted the Pythonista3 app and reinstalling the app. That succeeded.
@ccc I deleted Pythonista 3 and reinstalled from testflight. The install completed this time. Now when I start the app it dies immediately (goes straight to the IOS homescreen). Perhaps this is due to my iPad 3 running 8.1.2 and is JB? Pythonista (2.7) runs fine. Pythonista3 runs on my iPad mini.
@ihf Due to an oversight on my part, the current beta doesn't work on iOS 8, I'll try to make a new build available soon.
In Pythonista3 beta
NameError: name 'long' is not defined.
@ccc Not here. Are you sure you don't have a different version of SymPy in site-packages or something like that?
I have a problem with appex module. In actual Pythonista 3 Beta appex.get_url() does not get back with the actual URL from Safari. Anyone else got this?
Edit: This happens only while Python 3.5 is selected as default interpreter. Python 2.7 is working fine.
appexmodule seems to have some issues under Python 3:
>>> import appex >>> appex.get_attachments()  >>> appex.is_running_extension() False
Yes, this was run in the app extension.
@omz Another console-related issue - AFAICT since Pythonista 2.0,
console.set_color()with no arguments does not reset the text color to default, like it did in Pythonista 1.5. This is especially an issue because there are light and dark themes - there is no text color that is easy to read on both light and dark backgrounds, so it's impossible to write a script that changes text color in a way that works with all themes.
Thank you for the update to 300007.
I do not know, it was the same in 300006, but now I have a problem with the additional keyboard on my iPad Pro.
If I Press "+" I get an "%" and "+" and a rectangle witout content on the top of the screen. Pressing "/" I get an rectancle without content. Pressing "=" nothing else happens.
@wnMark For me the extended keyboard has some issues too. The top row's keys work fine when long-pressed, but for the bottom ones the popup is hidden behind the second keyboard row (in portrait mode) or completely out of place (in landscape mode).
@dgelessus for me the top line (1,2,3..=) worked like decribed in landscape mode. In portrait it works fine. The bottom line works fine in landscape and portrait mode.