[PythonCE] Import errors When Running Files

Voidspace mike at pcblokes.com
Fri Jul 16 09:20:10 CEST 2004



David L. Kashtan wrote:

>I understand why the console goes away (that is expected).  Here is
>what I don't get:
>
>	If you specify a file to run on the command line (which is
>	what the double-click does) then it attempts to open the file
>	and (if that fails) you get the message:
>		Can not open file 'xxxx'
>
>	You don't get import errors because the file is not imported,
>	it is run.
>
>I thinking you have an old Python.exe
>
>David
>
>  
>

I *only* have the new distribution - python2.3.4 for arm ppc2002 
downloaded from the validus site. I've scoured it for old versions and 
none are to be found !!

The new distribution is unpacked into a flat directory  :  "\\Storage 
Card\\Program Files\\python"
I've manually made the entries in the registry. :
What I actually have is an entry for .py, .pyc and .pyw in 
HKEY_CLASSES_ROOT - showing content type pyfile I then have a definition 
for pyfile, also in HKEY_CLASSES_ROOT, 
pyfile/Shell/Open/Command/(default) is set to "\Program 
Files\Python\python.exe" "%1"

This import failure is the same error that the other folk  [Isr, 
Christian Baumgärtel, Andreas, Ryan] were reporting. They have been 
using the 'xfile hack' :

> 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" %* 

(Plus a modification to get __name__ == '__main__' working)

Has this been sorted in an update, or is this hack still the official 
workaround ?
I could just download it again I suppose... but it would be nice to know 
what the position is :-)

Regards,

Fuzzy

>
>
>  
>

-- 

http://www.Voidspace.org.uk 
The Place where headspace meets cyberspace. Online resource site - covering science, technology, computing, cyberpunk, psychology, spirituality, fiction and more. 

---
http://www.Voidspace.org.uk/atlantibots/pythonutils.html
Python utilities, modules and apps.
Including Nanagram, Dirwatcher and more.
---
http://www.fuchsiashockz.co.uk   
http://groups.yahoo.com/group/void-shockz
---

Everyone has talent. What is rare is the courage to follow talent
 to the dark place where it leads. -Erica Jong
Ambition is a poor excuse for not having sense enough to be lazy.
         -Milan Kundera





More information about the PythonCE mailing list