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
-
Also, how hard would it be to check for a
@property
decorator in the autocomplete and then not put in parentheses? -
Any decorator really should not have parentheses added automatically. Some decorators allow arguments using closures, but there are many that do not take arguments and do not even allow empty parens. This includes most built-in decorators, like
property
,classmethod
andstaticmethod
.Speaking of parens - when editing an already typed line, the autocompletion often inserts extra parens before an existing function call. For example, say I have this line of code:
mylist.append("foo")
Then I decide I want to use
insert
instead. I double-tapappend
, typeins
, and hit Enter to accept the suggestion. The output I get ismylist.insert()("foo")
In this case I would expect it to detect the existing parens and not add extra ones.
-
I will admit I didn't like the insensitive matching originally, but zi do find it useful in objc... though I agree the typed case should be given priority to other matches.
Also, i think attributes starting with underscores should have lower priority (unless user starts typing an underscore). Pretty much every object has a dozen magic double underscore attributes which are rarely needed -- put _ and __ at the end of the non-matching list. -
Idea: add "show docstring", or else when using help on a non builtin, show the docstring. It might also be neat to show a "ghost" of the signature when typing a method to remind one of the arguments and ordering.
-
@JonB Both awesome ideas.
-
@omz
objc_util.on_main_thread
still doesn't usefunctools.wraps
to copy docstrings and such:>>> help(notification.schedule) Help on function new_func in module objc_util: new_func(*args, **kwargs) Out[0] = None >>> help(notification.schedule.__closure__[0].cell_contents) Help on function schedule in module notification: schedule(message, delay=0, sound_name=None, action_url=None) Note: Sounds from the 'digital' and 'game' collections ate supported Out[1] = None
Also, "ate supported".
;)
-
@omz is there a way to kill rogue scripts that call ui.Delay for example. In py2 you could keep hitting the close button until,it finally stopped. This seems not to work now. I have to force quit and restart py3. Maybe there is a new way I don't know about
-
If you are still,able to type in the console, ui.cancel_all_delays might work. Alternatively, deleting a module that the function depends on is a sure way to induce an Exception that stops it. e.g
del sys.modules ['ui']
-
@JonB l well I got around it by just making sure it didn't go rogue 😜
But honestly, I can force quit Pythonista and restart it quicker than I can type cmds into the console. My iPad Pro is lighting fast, also helps with the animations turned off globally -
you could always create an editor action script that cancels all delays!
-
@ywangd Is the Stash branch py3 still recommended, or is the master release now working well in pythonista 3 using #!python2?
-
@pvanallen i have not gotten around to porting git to handle py3. Also, I don't think there are any py3 only commands -- So #!python2 is currently the best option, unless you want you use the
python
command to run py3 scripts. -
Hi. Is it possible to get onto the beta list ? I have just bought 2.0 and am loving it. I would love to have the Python 3.x version as my 10 year old son is learning Python ATM and the book he is using needs Python 3.x. Please help :)
-
@farscapeone You can use this form to sign up (it might take a couple of days until you actually get an invite, I'm not checking the responses all the time): https://docs.google.com/forms/d/10qRhNIvk7WzcR5_DsQSRNIqLkIqeTYYafbPi9bjj_cw/viewform
-
I'd rather like an ETA, to be honest.
Any idea?
::z::
-
@JonB Thanks for the recommendation - got the standard py2 version installed (which has the #!python2 already in launch_stash.py).
For others, if they want to install the py2 StaSh for py3 in the beta, be sure to switch the Console Interpreter Version to Python 2.7 before you install StaSh. After installing, restart Pythonista and switch back to 3.5 as the interpreter.
Overall, StaSh seems to be working well in the beta. I have seen some cases where Pythonista crashes when using StaSh. It seems to happen when an error message from StaSh is shown in the Pythonista console tab.
Anyway, I used StaSh's pip command to install NLTK and then used nltk.download() in the standard console to install the book corpora (using the default directory worked without needing to explicitly set the NLTK_DATA environment variable). So far, so good!
-
-
@omz not sure if the latest beta broke this, or if it is by design: when running the 2.7 interpreter, after running a script in Documents, site-packages is modified and no longer points to the pythonista3 site-packages.
This got me when installing pyimgur then was unable to import using 2.7 but was able to import with 3.5, or after restarting.
after running script:
private/var/mobile/Containers/Shared/AppGroup/C534C622-2FDA-41F7-AE91-E3AAFE5FFC6B/Pythonista3/Documents', '/private/var/mobile/Containers/Shared/AppGroup/C534C622-2FDA-41F7-AE91-E3AAFE5FFC6B/Documents/site-packages', '/var/mobile/Containers/Bundle/Application/94901C8E-7046-48FC-9BBC-5018FEB83CBF/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib', '/var/mobile/Containers/Bundle/Application/94901C8E-7046-48FC-9BBC-5018FEB83CBF/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib/site-packages', '/var/mobile/Containers/Bundle/Application/94901C8E-7046-48FC-9BBC-5018FEB83CBF/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib/site-packages/PIL_compat']
before
['/private/var/mobile/Containers/Shared/AppGroup/C534C622-2FDA-41F7-AE91-E3AAFE5FFC6B/Documents/site-packages', '/var/mobile/Containers/Bundle/Application/94901C8E-7046-48FC-9BBC-5018FEB83CBF/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib', '/var/mobile/Containers/Bundle/Application/94901C8E-7046-48FC-9BBC-5018FEB83CBF/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib/site-packages', '/var/mobile/Containers/Bundle/Application/94901C8E-7046-48FC-9BBC-5018FEB83CBF/Pythonista3.app/Frameworks/PythonistaKit.framework/pylib/site-packages/PIL_compat', '/private/var/mobile/Containers/Shared/AppGroup/C534C622-2FDA-41F7-AE91-E3AAFE5FFC6B/Pythonista3/Documents/site-packages']
-
@omz Thanks - I have just done that
-