Reply
Thread Tools
Posts: 482 | Thanked: 550 times | Joined on Oct 2010
#1
I often have an idea for some script, and to prototype it I open Python on my N900 and test it in the interactive console. One problem I have encountered, however, is that the small keyboard makes it easy to make typos. So I have written a python console with basic autocorrect implemented. If you reference a non-existent variable it will try to correct it to a variable you have already assigned (or a system constant like True or None). It also has basic syntax correction: it will try to fix missing/extra parentheses, and add them if you forget them when defining a function with no arguments.

To run, enter in a terminal
Code:
python python_improved.py
You can use it to run existing programs too, but it is rather slow when not used interactively - it is more designed for prototyping than general use.
Attached Files
File Type: zip python_improved.py.zip (2.0 KB, 154 views)
 

The Following 5 Users Say Thank You to skykooler For This Useful Post:
Posts: 1,326 | Thanked: 1,524 times | Joined on Mar 2010
#2
Thanks

I have been going through a few python tut's recently and I can see this becoming handy!

After I get the hang of debugging my scripts so far.
 

The Following User Says Thank You to MINKIN2 For This Useful Post:
Posts: 482 | Thanked: 550 times | Joined on Oct 2010
#3
This should help with that a bit, it will tell you when it needs to correct something so you can see how to do so in the source.
 
Reply


 
Forum Jump


All times are GMT. The time now is 03:36.