Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #51568 > unrolled thread
| Started by | Dave Angel <davea@davea.name> |
|---|---|
| First post | 2013-07-30 11:37 -0400 |
| Last post | 2013-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.
Re: importing modules Dave Angel <davea@davea.name> - 2013-07-30 11:37 -0400
| From | Dave Angel <davea@davea.name> |
|---|---|
| Date | 2013-07-30 11:37 -0400 |
| Subject | Re: 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
Back to top | Article view | comp.lang.python
csiph-web