[Tutor] Question about importing

David Hutto dwightdhutto at yahoo.com
Tue Feb 2 21:13:14 CET 2010


--- On Tue, 2/2/10, Grigor 
Kolev <grigor.kolev at gmail.com>
 wrote:

From: Grigor Kolev 
<grigor.kolev at gmail.com>
Subject: Re: [Tutor] Question about 
importing
To: "David Hutto" <dwightdhutto at yahoo.com>
Cc: 
"Python Tutor" <tutor at python.org>
Date:
 Tuesday, February 2,
 2010, 2:54 PM

В 11:47 -0800 на 02.02.2010
 (вт), David Hutto написа:
> 
> 
> --- On Tue, 2/2/10,
 Grigor Kolev <grigor.kolev at gmail.com> 
wrote:
>         
>         From: Grigor Kolev <grigor.kolev at gmail.com>
>         Subject: 
Re: [Tutor] Question about importing
>         To: "David Hutto" 
<dwightdhutto at yahoo.com>
>         Cc:
 "Python Tutor" <tutor at python..org>
>   
      Date: Tuesday, February 2, 2010, 2:28 PM
>         
> 
        В 10:33 -0800 на 02.02.2010 (вт), David Hutto написа:
>   
      > 
>         > 
>         >
 --- On Tue, 2/2/10, Григор <grigor.kolev at gmail.com>
 wrote:
>         >         
>         >         From:
 Григор <grigor.kolev at gmail.com>
>     
    >         Subject: [Tutor] Question about importing
>      
   >         To: "Python Tutor" <tutor at python.org>
> 
        >         Date: Tuesday, February 2, 2010, 12:07
 PM
>         >         
>         >         Hi all.
> 
        >         How can I import a module which is located in the
> 
        upper
>         >         directory.
>      
   >         
>         >         
>         >     
    I think the following might be what you're looking
>      
   for:
>         >         
>   
      >
>            http://docs.python.org/tutorial/modules.html#the-module-search-path
> 
        >         
>         > 
>         Can I use 
something like this
>      
   #--------------------------------------------------
>      
   import sys
>         sys.path.append("/home/user/other")
> 
        import module
>      
   #-------------------------------------------------
>         --
 
>         Grigor Kolev
 <grigor.kolev at gmail..com>
>          
> 
        
>         That's exactly what it says to do, but I 
haven't figured out
>         the path to append to mine yet.
> 
        
> 


Thanks for your help

It wasn't that 
much help, and I was about to do something similar anyway.. So if it 
makes you feel better, now we both know that's how it works.
-- 
Grigor
 Kolev <grigor.kolev at gmail.com>





      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100202/291cf99e/attachment.htm>


More information about the Tutor mailing list