-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Commond "python HelloWorld.py" has a bug? #222
Comments
I don't think we ever implemented a clean way to run a python3 command from the python2 interpreter, which stash is running in. |
@jsbain you are right. There is no good way to communicate back and
forth... It is possible to execute a statement in py3 from py2 using C API.
But the two interpreters have different environment and nothing is really
shared. For an example, the `print` statement would just print to system
console instead of stash screen. As far as I see, there is no point trying
to support cross interpreter calls (though initially I really wanted and
tried).
…On Fri, Dec 2, 2016 at 3:02 PM, jsbain ***@***.***> wrote:
I don't think we ever implemented a clean way to run a python3 command
from the python2 interpreter, which stash is running in.
(though i vaguely recall ywangd or dgelessus coming up with a C approach,
but it was perhaps not too stable, or there was no good way of
communicating back and forth)
So right now the python command only supports py2
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#222 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACPFdMd2EPnjhfORgFeaVIUYykd_5UGeks5rD5g8gaJpZM4LB9TB>
.
--
----------------------------------------------------------------------
Life is elsewhere
|
Thanks a lot. And I found this http://omz-software.com/pythonista/docs/ios/urlscheme.html. Maybe we can use URL scheme to get it. But it seems that we can only run a script in the same library and there are too many other limitations. |
You can actually remove the #!python2 from the start of launch_stash, and run stash with the py3 interpreter. IIRC stash basic core works, just some of the external scripts don't (such as git). I am not sure about the python command....
…Sent from my iPad
On Dec 2, 2016, at 3:06 AM, yjqiang ***@***.***> wrote:
Thanks a lot. And I found this http://omz-software.com/pythonista/docs/ios/urlscheme.html. Maybe we can use URL scheme to get it. But it seems that we can only run a script in the same library and there are too many other limitations.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Got it. I just think a lot, trying to make the stash look like bash in linux, like "python3", "python2". But we need the author of Pythonista to help us, like setting more url schemes. But I'm not sure whether it's a good idea. |
#About this commit/PR This is a commit/PR to close a large number of old/fixed issues at once using the github `fix #<issuenumber>` syntax. Below is a list of all issues which will automatically be closed by merging this commit/PR into `ywangd/master`. Behind each issue number is a short summary about the issue or why it can be closed. #Issues which can be closed **Py3 related:** - fix ywangd#281 (py3 had not yet been supported) - fix ywangd#261 (python3 pip installation) - fix ywangd#246 (python3 code in python2) - fix ywangd#222 (python3 command in stash) - fix ywangd#200 (pip now works (at least partially) with python3) - close ywangd#197 (general pythonista3 compatibility thread) **Questions which have been answered / unfixable bugs:** - close ywangd#310 (pip installation with c code) - close ywangd#292 (StaSh is not dead; also a question regarding py3) - close ywangd#290 (pip installation, problem solved) - close ywangd#289 (answer provided, no further activity by reporter) - close ywangd#279 (pip install protects standard distribution) - close ywangd#245 (answered) - close ywangd#244 (not possible (unless someone finds a workaround) - close ywangd#243 (c-code in pip installation) - close ywangd#208 (question answered) **implemented suggestions/changes:** - fix ywangd#273 (partially implemented as part of py2and3) - fix ywangd#193 (implemented by now) - fix ywangd#63 (subcommand completion; implemented long ago) - fix ywangd#39 (pip; implemented long ago) **fixed bugs:** - fix ywangd#308 (https error in pip; fixed) - fix ywangd#223 (old beta-related bug) - fix ywangd#211 (old beta-related bug) - fix ywangd#209 (seems to be fixed, can not reproduce) - fix ywangd#206 (git did not clone into subdirectory; fixed) - fix ywangd#98 (telnet did not send \r\n; fixed) **other stuff:** - close ywangd#260 (no useful bug description) - close ywangd#258 (no useful bug description) - close ywangd#251 (not a bug but an announcement, no longer relevant) - close ywangd#241 (works now) - close ywangd#219 (no further acivity by reporter, likely user error) #Issues which can be closed, but where the underlying issue has not been fixed - close ywangd#285 (pip command too complex) - close ywangd#291 (pip installation question, but not c-code related. But seems package-related) - close ywangd#274 (pip install problem, at least partial related to c-code, no further activity by reporter)
HelloWorld.py:
#!python3
#coding: utf-8
print 'Hello World'
I use the commond "python HelloWorld.py", trying to run HelloWorld.py in python3. But it looks Pythonista still runs it in python2, because in python3 "print 'Hello World'" is error while in fact it just prints "Hello World" without warning or other messages. I'm not sure whether it's a bug or I misunderstand the commond.
Pythonista 3.0 (300018) iOS 10.1.1 (64-bit iPad6,3)
The text was updated successfully, but these errors were encountered: