By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,818 Members | 1,262 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,818 IT Pros & Developers. It's quick & easy.

Creating a sub folder in the pythons LIB Directory

P: n/a
Hi,

I am creating a library of functions. I would like to have them saved
in a sub folder of pythons LIB folder, but I cannot get it to work.

I have a script called test.py
I stored it in LIB folder and typed
Import test, work fine.
I store the script in lib/ted
Then type
Import lib\ted
I get a error that says invalid token, how do I do this????

May 19 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
<te*******@gmail.comwrote in message
news:11*********************@p77g2000hsh.googlegro ups.com...
Hi,

I am creating a library of functions. I would like to have them saved
in a sub folder of pythons LIB folder, but I cannot get it to work.

I have a script called test.py
I stored it in LIB folder and typed
Import test, work fine.
I store the script in lib/ted
Then type
Import lib\ted
Try "import ted.test" or "from ted import test". I also recommend reading
http://www.python.org/doc/essays/packages.html as it explains how to use
__init__.py files.
May 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.