[PythonCE] RE: shutil import failure

Isr Gish isrgish at fastem.com
Thu May 6 23:05:10 EDT 2004


Hi Richard,

   Richard Deeley <r_deeley at yahoo.com> Wrote:
   >> Also I would still like to know wich Version of Python are you running. What I wrote to you last
   >> time that it only worked in 2.2 it could be that your only running 2.2 therfore the .py file
   >> would work and so would anything that was compiled on your device.
   >
   >I guess I don't know at this time. I downloaded the pythonCE
   >about 3 months ago or so. At the moment, I am using a different
   >machine whilst waiting for this worm issue to die down a little.
   >So not quite as smooth getting things done at the moment and
   >missing the IPAQ at the moment.
   >

Every time you start Python the first line says which version its running.


   >> 
   >> Also can you show me again the Traceback that you got, please post the whole tracebak. That way
   >> I could see more wats cousing it.
   >
   >OK. Will have to wait till I can get the IPAQ running near
   >a working machine (it is not here at the moment). But as
   >I recall it was quite straightforward message of the form
   >
   >unable to import module shutil
   >(filename shutil.dll)
   >

I understand that it was straightforward but the first parts of the traceback tells us "WHERE" the problem happened and that may help.

   >But ONLY if I rely on ANY version in Python/Lib. If I compile
   >it myself in my current directory, it runs fine. So even if
   >I take the version that runs fine in my current directory and
   >copy it to the Python/Lib area, it still fails to work.
   >
   >Have you any idea why the versions would differ ? I compiled
   >it on the IPAQ, so it seems odd to me that the version in
   >Python/Lib is different that its own revision.
   >
I see no reason for it to differe. It may some other problem alltogether.


   >Slightly different issue: Do you know where is the 'time' module ?
   >(I wanted strftime, but couldn't find it anywhere, then I couldn't
   >find time either, even though that works OK). It would be helpful
   >to know this as there seem to be ways other than via Lib by which
   >Python finds its modules.
   >
Actually the time module is a built-in module. There are alot of built-in modules in python, (I think that the specific ones depend in the person who compiled Python).

I do remember having certain problems with the time module that not all the newer functions are there.
To find the functions in a module you can use dir(...).
>>> dir(time)
['__doc__', '__name__', 'altzone', 'asctime', 'clock', 'ctime', 'daylight', 'gmtime', 'localtime', 'mktime', 'sleep', 'time', 'timezone', 'tzname']

or help(...)
>>> help('time')
Help on built-in module time:

NAME
    time

FILE
    (built-in)

FUNCTIONS
    asctime(...)
    
    clock(...)
    
    ctime(...)
    
    gmtime(...)
    
    localtime(...)
    
    mktime(...)
    
    sleep(...)
    
    time(...)

DATA
    __name__ = 'time'
    altzone = 18000
    daylight = 1
    timezone = 18000
    tzname = ('', '')

   >
   >Richard.
   >


All the best

Isr




More information about the PythonCE mailing list