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.
StaSh for Pythonista 2 and 3
-
@ywangd , sorry I am at a total loss.its really mixed up here. About Pythonista 2/3
I do in Pythonista 3
import requests as r; exec r.get('http://bit.ly/get-stash').text
In Python 3,
I getimport requests as r; exec r.get('http://bit.ly/get-stash').text
File "<string>", line 1
import requests as r; exec r.get('http://bit.ly/get-stash').text
^
SyntaxError: invalid syntax -
The line should really be
import requests as r; exec(r.get('http://bit.ly/get-stash').text)
Note the parentheses around the argument to
exec
. In Python 2exec
was a special statement and did not require parentheses like a normal function. In Python 3exec
was changed to a normal function (just likeprint
) so now you need parentheses to call it. In Python 2exec
can also be used like in Python 3 (see the language reference for the details) so the Python 3 style is what you should use in almost all cases. -
@dgelessus , I still get an error
import requests as r; exec(r.get('http://bit.ly/get-stash').text)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<string>", line 18
print 'Downloading %s ...' % URL_ZIPFILE
^
SyntaxError: Missing parentheses in call to 'print'But I can see there is a problem with the print. But it's part of an install, not sure I can do anything about that
-
Uh @ywangd is there a different download link for the
py3
branch? -
-
@dgelessus @ywangd So it's interesting that Stash runs in its own tab, presumably on its own thread, and closing the tab kills the thread?
How do you implement this in pythonsta for other scripts? (this would solve the only being able to run a single script limitation)
ALSO, I appreciate the confirmation before downloading stuff in this version... in that last one simply typing something would try to download it.
ALSO bug report, sometimes the keyboard goes black except the top row with "tab, ~, "etc...
-
For Pythonista 3, there is a separate branch and following oneliner installs it (note it uses a different url for the py3 branch):
import requests as r; exec(r.get('http://j.mp/gsp35').text)
-
@Tizzy
StaSh uses threads to run commands users type in the terminal. The thread is killable and when StaSh UI is closing, it kills all the threads it spawned. With current version, you can already run multiple scripts with StaSh at the same time. Here is an example that a http server and client runs together. Details of the killable threads can be found in the shthreads.py file.in that last one simply typing something would try to download it.
I don't quite understand it. Do you mean that
pip
andgit
download their dependancies?ALSO bug report, sometimes the keyboard goes black except the top row with "tab, ~, "etc...
The extra key row is something I wanted to re-write since 2.0 came out. Just didn't have the time. I'll work on it when time permits.
-
@ywangd , thank you. Successfully downloaded it
-
@ywangd yes in regards to the dependencies. in the previous version it wouldn't even prompt you it just started downloading. This one it asks first. Good call.