Hi all and a very great / happy new year to all of you.
My name is Gabriel and I’m a very beginner both as a programmer and with TextMate.
TM is one of the few editor I have found which is accessible to the VoiceOver technologies I have to use as I’m totally blind.
My problem has to do with using TM to write and test Python scripts.
I have this simple one:
# begin a =input(“name? ") print a # end
I press Bundle… python… run script and getting this error message: ***
Running “untitled”… Python 2.7.6 Theme: nome EOFError: 'EOF when reading a line'
module body in untitled at line 1 a =input("nome") copy output Program exited with code #1 after 0.41 seconds. ***
That’s sounds strange as the script has no mistakes.
Could you please help me to found how to solve this issue? Thanks. Gabriel.
On 3 Jan 2014, at 10:56, Gabriele Battaglia wrote:
That’s sounds strange as the script has no mistakes.
Could you please help me to found how to solve this issue?
I don’t have all the details, but as a general rule, interactive scripts that stop and ask for user input don’t work when run within TextMate.
It sort of worked at one point, and I think there are plans to get it working again, but for now, it doesn’t.
You can run the script in a Terminal window using Shift-Command-R or Bundle, Python, Run Script (Terminal). Note that this will open a new Terminal window every time you do it, so you’ll probably want to close them as soon as you’re done with each run to avoid them piling up.
You could also just keep a Terminal window open and run the script manually from there. Once you’ve run it once, you should be able to run it again by switching to the Terminal and hitting up arrow, then return.
Hi Rob and thanks for your very useful answer, I appreciated it very much.
Yes, it is a big shame that TM has this trouble executing scripts that requests interaction with user throw the keyboard. I strongly wish it could be fixed as soon as possible, even because, I guess, lots of scripts have those kind of raw_input and input commands.
I would like to ask you something more: is there the possibility to switch the format of the output windows? I would like rather a simple plain text output, than the HTML one.
How can I suggest to the DEVs team, to add this feature? It seems also quit easy to implement and it will be very helpful for other blind users too.
Again thanks.
Gabriel.
On 3 Jan 2014, at 11:44, Gabriele Battaglia wrote:
I would like to ask you something more: is there the possibility to switch the format of the output windows? I would like rather a simple plain text output, than the HTML one.
If you go to Bundles, Edit Bundles, then select Python, Menu Commands, Run Script, you can change the output format to “Text”. That basically opens a new document, which also requires some clean-up after, but it’s something.
There might be a better option I’m not aware of.
How can I suggest to the DEVs team, to add this feature? It seems also quit easy to implement and it will be very helpful for other blind users too.
This list is probably as good a place as any. They should see this sooner or later.
On 3 Jan 2014, at 23:44, Gabriele Battaglia wrote:
Yes, it is a big shame that TM has this trouble executing scripts that requests interaction with user throw the keyboard. I strongly wish it could be fixed as soon as possible, even because, I guess, lots of scripts have those kind of raw_input and input commands.
It’s unfortunately not simply “fixing” something as it requires emulating an interactive terminal device. The initial solution we provided overloaded a dozen low-level system calls for reading from the standard input file descriptor, but it had some unfortunate side-effects.
I think the proper way to support it is to provide some sort of pseudo-terminal environment for the programs being launched. But it’s something I know very little about (terminal emulation).
I would like to ask you something more: is there the possibility to switch the format of the output windows? I would like rather a simple plain text output, than the HTML one.
How can I suggest to the DEVs team, to add this feature? It seems also quit easy to implement and it will be very helpful for other blind users too.
I assume this request comes from suboptimal VoiceOver support for the HTML output (compared to plain text).
The styling of the output window is customizable and is used by many commands, so I wonder if improvements can be done to the styling in order to improve accessibility support?