Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51568 > unrolled thread

Re: importing modules

Started byDave Angel <davea@davea.name>
First post2013-07-30 11:37 -0400
Last post2013-07-30 11:37 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: importing modules Dave Angel <davea@davea.name> - 2013-07-30 11:37 -0400

#51568 — Re: importing modules

FromDave Angel <davea@davea.name>
Date2013-07-30 11:37 -0400
SubjectRe: importing modules
Message-ID<mailman.5314.1375198689.3114.python-list@python.org>
On 07/29/2013 05:57 PM, syed khalid wrote:
> I am attempting to import modules from Shogun to python from a non-standard
> python directory ie from my /home/xxx directory. is there a way on ubuntu
> to selectively some modules, scripts, data  from one directory and others
> modules, scripts from another directory. In other words, is there a file(s)
> that provide pointers to where these modules are located.
>

Your question is confusing, but the short answer is that import will 
search the sys.path list for you.  So in your main script, you can add a 
directory to that list,  before doing the imports.

It can also be done with an environment variable, or with the site file, 
but I don't bother.


-- 
DaveA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web