Hi all.
I’m back on a topic we discussed several months ago, here in the list.
The problem was about how to run a Python Script which involves some user interaction:
*** print “Hello world.” age = input (“How are old, dear world?”) print “Ohh,”, age, “ so aged?” ***
The script ends with an ErrorCode 1, EOF.
Is there something to do to fix, or, is this issue somehow within the todo list?
Thanks.
Gabriel. — Namasté! Sent from my iMac27. (Libero)
On 18 Jun 2014, at 21:57, Gabriele Battaglia wrote:
[…] The problem was about how to run a Python Script which involves some user interaction:
You need to run the script in a terminal environment when you want to read answers from stdin.
[…] Is there something to do to fix, or, is this issue somehow within the todo list?
Not exactly sure what you’re asking here, but it’s not an uncommon request to have TextMate offer a terminal environment, but it’s also not really something I am eager to write due to the presumed complexity of such code.
On 18 juin 2014, at 21:57, Gabriele Battaglia iz4apu@libero.it wrote:
... The problem was about how to run a Python Script which involves some user interaction:
print “Hello world.” age = input (“How are old, dear world?”) print “Ohh,”, age, “ so aged?”
When I need this type of user interaction within a command I use CocoaDialog. It offers many options that should cover most, albeit simple needs.
Il giorno 20/giu/2014, alle ore 19:46, Eduardo Francos efrancos@efrancos.com ha scritto:
When I need this type of user interaction within a command I use CocoaDialog. It offers many options that should cover most, albeit simple needs.
GB: Hi and thanks for answer.
Could you please post an example? Even privately, if you think so.
Ghanks. Gabriel.
PS: anyway, there is no editor (or IDE) I’ve tried, which are able to manage an input or raw_input in Python. Every software I’ve tried got this EOF Error.
— Namasté! Sent from my iMac27. (Libero)
On 20 juin 2014, at 20:24, Gabriele Battaglia iz4apu@libero.it wrote:
Il giorno 20/giu/2014, alle ore 19:46, Eduardo Francos efrancos@efrancos.com ha scritto:
When I need this type of user interaction within a command I use CocoaDialog. It offers many options that should cover most, albeit simple needs.
GB: Hi and thanks for answer.
Could you please post an example? Even privately, if you think so.
I'm attaching a sample script that uses CocoaDialog to prompt for the user's age, then it uses again CocoaDialog to display a message-box with the result. You may try it directly from an editor window (⌘R) or paste it into a new bundle command.
PS: anyway, there is no editor (or IDE) I’ve tried, which are able to manage an input or raw_input in Python. Every software I’ve tried got this EOF Error.
It could be possible if TM integrated some kiond of "terminal" type of command output, but I guess that's too much for too little. In TM version 1.5 I was using HTML output to the command's windows for as sophisticated an interface as you can make using HTML + JS + CSS. The problem is that to give feedback to TM that required using TMTOOLS, which unfortunately is incompatible with the current TM version.
— Namasté! Sent from my iMac27. (Libero)
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate