help - Module needs access to another module

A

abcd

I have the following directory/file structure...

c:\foo\utils.py
c:\foo\bar\ok.py

In ok.py I want to do something like...

import utils
utils.helpMeDoSomething(....)

However, it seems that ok.py doesn't "know" about utils. Other than
manually configuring sys.path what can I do?

thanks
 
D

Diez B. Roggisch

abcd said:
I have the following directory/file structure...

c:\foo\utils.py
c:\foo\bar\ok.py

In ok.py I want to do something like...

import utils
utils.helpMeDoSomething(....)

However, it seems that ok.py doesn't "know" about utils. Other than
manually configuring sys.path what can I do?

After a bunch of questions of that kind, I suggest you take a step back, and
read this:

http://docs.python.org/tut/node8.html

Diez
 
C

Carsten Haese

I have the following directory/file structure...

c:\foo\utils.py
c:\foo\bar\ok.py

In ok.py I want to do something like...

import utils
utils.helpMeDoSomething(....)

However, it seems that ok.py doesn't "know" about utils. Other than
manually configuring sys.path what can I do?

Why would you want to do something other than changing sys.path? Except
for physically moving utils to somewhere that's already on the path,
changing the path is cleanest way to handle this situation.

-Carsten
 
B

Ben Finney

abcd said:
got it, thanks.

Now that you've got that one part of the tutorial, please do *the
whole thing*. Start from the beginning, run each example and watch
what it does. Experiment with it until you understand what's going on,
then move on. Repeat until done.

You'll possibly see a bunch of things you have already learned, but
you *will* cover a lot of gaps in your knowledge that you don't even
know exist.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top