Importing My Own Script

Victor Subervi victorsubervi at gmail.com
Thu Apr 17 10:47:34 EDT 2008


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.<http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080417/1685f34f/attachment-0001.html>


More information about the Python-list mailing list