Here's an example where you are trying to import a function in one of
your .py files--when that .py file is not in the current directory:
import sys
sys.path.append("/Users/me/2testing/dir1/")
#directory that contains the file
import test1 #name of file without .py extension
test1.greet()
--
On Apr 18, 10:34 am, [EMAIL PROTECTED] wrote:
> I thought import used relative paths from either the python executable
> or the script being executed. I have a script pulling in code from an
> arbitrary directory. How is this happening?
>
> It's a RHEL 4 environment by the way. I couldn't find a
[EMAIL PROTECTED] wrote:
I thought import used relative paths from either the python executable
or the script being executed. I have a script pulling in code from an
arbitrary directory. How is this happening?
It's a RHEL 4 environment by the way. I couldn't find any relevant
environment vari
[EMAIL PROTECTED] wrote:
> I thought import used relative paths from either the python executable
> or the script being executed. I have a script pulling in code from an
> arbitrary directory. How is this happening?
>
> It's a RHEL 4 environment by the way. I couldn't find any relevant
> enviro