Re: Importing a python module

Andreas Kostyrka <[email protected]>
Newsgroups gmane.comp.python.pyrex
Message-ID <1206830292.11011.198.camel@localhost>
Some hints.

Start a python, try out the import. Does it work?

create a glGo/__init__.py

You probably need to have . (whereever that is) on your PYTHONPATH
somehow.

Andreas

Am Samstag, den 29.03.2008, 23:30 +0100 schrieb Mathijs Romans:
> 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
> 
> 
> 
> _______________________________________________
> Pyrex mailing list
> [email protected]
> http://lists.copyleft.no/mailman/listinfo/pyrex

_______________________________________________
Pyrex mailing list
[email protected]
http://lists.copyleft.no/mailman/listinfo/pyrex
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBH7sTUHJdudm4KnO0RAla9AJ9yMDE6M92VaH8NeWDvbLIFO4P5IwCg2Dys
+RlR2C8h55Bq3t2hIdm0fBw=
=qy2y
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.