OSX IDE usability issues

Alex Holcombe holcombea at cardiff.ac.uk
Mon Jun 7 01:35:45 CEST 2004


 One thing that attracted me to Python was the prospect of
significantly shorter debugging times and debug-execution cycles
thanks to Python being an interpreted rather than compiled language. 
In the case of MATLAB, the interpreted language I use currently,
programming is quite speedy because one can test small sets of lines
of code by copying them directly from the program file to the command
line and debugging them in isolation- e.g. allowing one to easily set
individual variables manually and checking the result.  

I was disappointed to find that I was not able to do this with Python
programs using OSX's PythonIDE (also I didn't find any alternative
IDEs on the web that might take care of this).  I am a newbie, so I
may be wrong, but there appear to be three reasons for this.  

1. when I copy text from a Python script (using command-C or the menu)
 and paste it in on the command line, only the first line of the text
is actually executed, even though manually entering the same lines one
by one with carriage returns between them does execute the code
perfectly.  Why the problem with pasting occurs I don't know- does
anyone know?  

2.Even if the above did work, trying to execute a few lines of code
out of a Python script should typically not work, if I understand
Python syntax correctly.  Because to Python indentation whitespace is
meaningful, one cannot e.g. copy the contents out of a nested if-then
statement and expect it to execute, because when you paste the text it
will have that level of indentation still rather than having no
indentation as it should.  Am I right about this and is there a way
around it?

3. One nice thing about MATLAB is I can execute a script and then
query the values of all the script's variables from the command line. 
By just typing the variable name, I can see its value.  In contrast,
it appears that in Python variables have more restricted scope such
that the command line can't "see" the variables executed in a Python
script.  Is there some way to make the variables in a Python script
global so that I can play with them on the command line?

Without solutions or workarounds to the above three issues, much of
the everyday efficiency advantage of using an interpreted language
seems to me to be lost.  So despite the beauty of Python, for my new
laboratory I might end up using MATLAB and Psychophysics toolbox
instead (presuming they someday get that to work with OSX!).  

Thanks in advance for any corrections comments etc.,
Alex Holcombe



More information about the Python-list mailing list