[wingide-users] Auto-completion for file in dir above

Stephan Deibel sdeibel at wingware.com
Sat Nov 27 18:40:47 MST 2010


On 11/26/10 3:43 PM, brian downing wrote:
>
> How do I get Auto-completion to work for a file that is in the above dir?
>
>
> My dirs look like
>
> ---------------------
>
> src
>
>    topFile.py
>
>
>    subDir
>
>       __init__.py -> empty file
>
>        subFile.py
>
> ---------------------
>
>
> in subFile.py I want to import topFile.py. The code I have looks like:
>
> ----------------------------
>
> sys.path.append('..')
>
> from topFile import *
>
> ----------------------------
>
>
> With this, the auto-completion doesn't not work.
>
>
> When I did a web search I found relative import but I can't seem to 
> get it to work.
>

Probably the best way to do this is to add subDir to your Python Path in 
Project Properties in Wing (accessed from the Project menu).  Also, if 
you put the sys.path.append() in your main debug file (if you have one 
set in your project) then Wing will attempt to read and understand your 
sys.path changes there.

-- 

Stephan



More information about the wingide-users mailing list