[TxMt] Re: Executing Python scripts.

Eduardo Francos efrancos at efrancos.com
Sat Jun 21 09:14:13 UTC 2014


On 20 juin 2014, at 20:24, Gabriele Battaglia <iz4apu at libero.it> wrote:

> 
> Il giorno 20/giu/2014, alle ore 19:46, Eduardo Francos <efrancos at 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 at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20140621/c82adc14/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cocoadialog_test.py
Type: text/x-python-script
Size: 1631 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20140621/c82adc14/attachment-0001.py>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20140621/c82adc14/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.macromates.com/textmate/attachments/20140621/c82adc14/attachment-0001.asc>


More information about the textmate mailing list