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

help - Module needs access to another module

P: n/a
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

Mar 20 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
abcd wrote:
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
Mar 20 '07 #2

P: n/a
On Mar 20, 9:58 am, "Diez B. Roggisch" <d...@nospam.web.dewrote:
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

got it, thanks.

Mar 20 '07 #3

P: n/a
On Tue, 2007-03-20 at 06:46 -0700, abcd wrote:
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
Mar 20 '07 #4

P: n/a
"abcd" <co*******@gmail.comwrites:
On Mar 20, 9:58 am, "Diez B. Roggisch" <d...@nospam.web.dewrote:
http://docs.python.org/tut/node8.html

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.

--
\ "People always ask me, 'Where were you when Kennedy was shot?' |
`\ Well, I don't have an alibi." -- Emo Philips |
_o__) |
Ben Finney

Mar 20 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.