how exactly does import work

Harald Kirsch kirschh at lionbioscience.com
Fri Sep 22 09:33:37 CEST 2000


The manual says:

  Details of the module searching and loading process
  are implementation and platform specific. 

Well, I am working on Linux and wonder where the platform specific
docs are. According to strace a search for 

  import flaxubl

is performed in sys.path for 

  flaxubl.so
  flaxublmodule.so
  flaxubl.py
  flaxubl.pyc

but not for just `flaxubl'.

This is particularly annoying because htmldoc.py uses `import' to read
a module. Consequently it is not possible to run it on a file named
`flaxubl', which does _not_ have a suffix because it is a program to
be run from the command line ... and those tend to not have suffixes.

Is there a way to force import of a suffixless file? What would be the
best way to simulate `import' with `execfile'?

  Harald Kirsch
-- 
----------------+------------------------------------------------------
Harald Kirsch   | kirschh at lionbioscience.com | We make the tools to
LION Bioscience | +49 6221 4038 172          | reverse engineer nature.



More information about the Python-list mailing list