[Edu-sig] Starting Python

Winston Wolff winstonw at stratolab.com
Fri Jan 20 17:37:40 CET 2006


Hello André-

90% of the program is the user interface.  The actually running of  
the program is just spawning a Python process.  I do a little bit of  
magic to allow multi-file programs that I discuss below, but  
basically it's just popen().  Regarding the "stop" button, that is  
just killing the process.  And the ">>>" button, is just adding the  
command line option to Python:
	-i     : inspect interactively after running script

Regarding the magic I do before running a script, if there exits a  
file named main.py in the current or parent folder, then that is run  
instead of the current script.  And the first argument on the command  
line is the current script's file name.  This allows me to write  
multi-file programs, but it also allows me to do funny things like  
pre-load certain libraries and add them to __built_in__ or to execute  
the user's script in a testing framework which I do for a tutorial.   
I haven't made these things ready for release due to time, but having  
the main.py file that can "override" the execution of these scripts  
turned out to be very handy.

-winston

On Jan 20, 2006, at 10:48 AM, Andre Roberge wrote:

>
> This looks like a very interesting idea.  I have looked at the
> screenshot on your website and have a few questions:
> 1. How specific to the Mac is it?  From your website, it seems to be
> an absolute requirement. Is the source code available?  [I am a
> Windows user.]
> 2. I noticed a "stop" button.  I'm curious as to how you have
> implemented this functionality - as well as the possibility to "drop
> down" to the interpreter level at the end of a script.  After seeing
> it, I would like to add this capability in my own programming learning
> environment.
>
> André




______________________________________________________
winston wolff - (646) 827-2242 - http://www.stratolab.com
learning by creating - video game courses for kids in new york


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/edu-sig/attachments/20060120/5b007d07/attachment.htm 


More information about the Edu-sig mailing list