[Tutor] Python Question

Alan Gauld alan.gauld at blueyonder.co.uk
Thu Sep 11 22:40:45 EDT 2003


> I have a question...

Lots of questions surely! ... but thats OK :-)

> to read the 'Python for non-programers' tutorial, reached about
chapter 8
> and stopped. It began to be very hard and confusing, and went on too
fast.

OK, So try one of the others - like mine :-)
Sreriously if you don't understand one tutor take a look at another,
they may explain the same cconcept more clearly for you.

> was wondering how I can upload my Python Programs online, and how
will
> people see them. Also if I can make it a file evryone can see... I
mean, can
> computers who dont have Python installed can view me programs?

OK, It gets a wee bit complicated here.
To get your Python programs online just put them on a web site
(See Useless Python for many examples). But the visitors will
need to download them and run them on their PC with Python installed.

If they don't have Python and for some reason are not prepared to
install it then there is a program called py2exe that you can use
to create an EXE file that contains Python and your program
bundled together. It will be pretty big though... and py2exe
isn't the easiest thing to use, not something I'd tackle for
a wee while yet.

> When I run the finished program, it quits and closes window if it
> has nothing to do. For example if my program is just

THis is a common one. The simplest way is probably to just add the
line:

raw_input("Hit RETURN to quit")

This will display the message then wait for the user to hit
return before closing the window.

Another option is to edit the file association in EXplorer to
use python -i in stead of plain python to run the program,.
That leaves you in the >>> python prompt.

HTH,

Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld




More information about the Tutor mailing list