[Tutor] How do we make a program to be executed...

alan.gauld@bt.com alan.gauld@bt.com
Thu, 21 Feb 2002 11:56:47 -0000

> make it an executable program. 
> I mean how do I make it a complete program that we only 
> need to exe its icon and not getting into the code and run 
> script. 

If the file associations are set correctly on Windows
(and they should be by the installer) then you only need 
to double click the icon in explorere and it will run.
[ If on Unix then set the shebang line to point at python 
for the same effect]

There are tools around for converting a python program into 
an exe file by bundling the interpreter and libraries with 
your script etc but personally I'd rather just install 
Python along with my script...

> Furthermore, could you please tell me how do we clear the 
> screen (cls)?

Again this depends on the OS in use.
Assuming Windows then the simplest way is

import os

However I have occasionally had strange error messages when 
doing this - but it seems to work most times...

Alan g.