[PythonCE] Running scripts by double clicking

Isr Gish isrgish at fastem.com
Mon Jul 12 02:05:27 CEST 2004


Hi Ryan,

-----Original Message-----
   >From: "Ryan Northey"<ryan at ape-x.net>
   >Sent: 7/8/04 3:54:58 AM
   >To: "Isr Gish"<isrgish at fastem.com>
   >Subject: Re: [PythonCE] Running scripts by double clicking
   >
   >Hi,
   >
   >> I'm having problems running a script by double clicking I get a message, ImportError: No module named \My Documents\Python\<filename>
   >> This problem started with Version 2.3.4
   >> 
   >> Pwease help
   >> Isr
   >
   >I got around this problem by having a file in pythonpath called
   >xFile.py, containing:
   >
   >import sys
   >execfile(sys.argv[1])
   >
   >and then editing the registry entry \HKCR\PySource\Shell\Open\Command:
   >
   >Default  : "\Program Files\Python\python.exe" xFile "%1" %*
   >
The problem with this idea is that you can't use the trick of.
If __name__ == '__main__':

[snip]

   >cheers,
   >
   >ryan.
   >-- 
   >Ryan Northey <ryan at ape-x.net>
   >

All the best,
Isr



More information about the PythonCE mailing list