[Pyrex] Importing a python module

Mathijs Romans mathijs at romansland.nl
Sat Mar 29 23:30:10 CET 2008


Hello,

sorry, but I have a bit of a newbie quiestion. I am looking at some code here 
that has this structure:

./sgf/sgf.pyx
./glGo/utils.py
./glGo/utils.pyc

the file ./sgf/sgf.pyx starts with:

import glGo.utils

is this really supposed to work like this? The functions in utils.py can't be 
found during runtime of the binary code. I then inserted in the 
file ./sgf/sgf.pyx the lines 

import sys
sys.path.append("../")

but this doesn't solve the problem. I am surprised  that one supposedly can 
just "include " a .py file in a .pyx file. Sorry that I don't really have a 
clue what is going on here... any help is appreciated.

Mathijs





More information about the Pyrex mailing list