Importing My Own Script

Ben Kaplan bskaplan14 at yahoo.com
Thu Apr 17 19:04:11 CEST 2008


It might be something in mod python. Try asking on their mailing list.

----- Original Message ----
From: Victor Subervi <victorsubervi at gmail.com>
To: Ben Kaplan <bskaplan14 at yahoo.com>
Cc: python-list at python.org
Sent: Thursday, April 17, 2008 10:47:34 AM
Subject: Re: Importing My Own Script

On Thu, Apr 17, 2008 at 8:52 AM, Ben Kaplan <bskaplan14 at yahoo.com> wrote:
If x and y are in the same directory, just do "import x". If not, add the directory containing x to sys.path. Then, "import x" should work. 


 
Well, now that´s what I thought! But no, it doesn´t work! Both scripts are in the same folder. Here´s the error:
 
[Thu Apr 17 07:45:50 2008] [error] [client 190.166.0.245] PythonHandler mod_python.cgihandler: File "/var/www/vhosts/livestocksling.com/httpdocs/bre/test.py", line 3, in ?\n import test2 
[Thu Apr 17 07:45:50 2008] [error] [client 190.166.0.245] PythonHandler mod_python.cgihandler: ImportError: No module named test2 

I´m running through Plesk, if that makes a difference.
TIA,
Victor
 


----- Original Message ----
From: Victor Subervi <victorsubervi at gmail.com>
To: python-list at python.org
Sent: Thursday, April 17, 2008 9:45:10 AM
Subject: Importing My Own Script

Hi:
How do I import my own script from a second script? That is, I have script x and I want to import script y. How?
TIA,
Victor







Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.









      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080417/a4804c9c/attachment.html>


More information about the Python-list mailing list