473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

help - Module needs access to another module

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
4 980
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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Inyeol Lee | last post by:
I'm an OOP newbie, and needs help on subclassing from different module. I made a base module a.py which contains two classes C1 and C2; ## start of a.py class C1(object): def m(self):...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
18
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments...
9
by: hope | last post by:
Hi Access 97 I'm lost on this code please can you help ================================= Below is some simple code that will concatenate a single field's value from multiple records into a...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
8
by: MakaMaka | last post by:
Hi, I have a scope related question that I haven't been able to find an answer to anywhere. Is there a way to have a function in an imported module add variables to the scope of the calling...
16
by: Rex | last post by:
Hi All - I have a question that I think MIGHT be of interest to a number of us developers. I am somewhat new to VIsual Studio 2005 but not new to VB. I am looking for ideas about quick and...
8
by: Shals | last post by:
Hi, I have a DTS Package created in SQL Server but the client wants to execute the DTS package from within MS Access by clicking a button. If any one can tell me how to execute that DTS from...
4
by: Simon Pickles | last post by:
Hi, Can someone help me leave the murky c++ world and enter shiny pythonland? I have a problem with importing and global variables, here's my code: ----------------------------------------...
7
by: sara | last post by:
I have a friend doing some pro-bono work for a non-profit that does job training for distressed kids under DCSS care. He asked me for code to do the following (he's using A2003). I can't find...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.