Friday 15 May 2015

Cannot get suggestions when importing Python file from another folder (Wing IDE) -



Cannot get suggestions when importing Python file from another folder (Wing IDE) -

i have python file called caller.py located @ c:\temp. have 2 other python files: local_testlib.py located in c:\temp , testlib.py located in c:\temp\mylibs.

i trying import both of files in wing ide pro.

import sys sys.path.append(r'c:\temp\mylibs') import testlib #located in c:\temp\mylibs import local_testlib #located in c:\temp #check suggestions wing local_testlib. #get suggestions list of variables etc. file testlib. #don't suggestions print testlib.myvar #get variable value printed ok

i suggestions local_testlib, nil testlib (see image below). access variables in testlib.py (so imported correctly) though. adjustments should have done create work?

to solve can add together c:\temp\mylibs python path in wing's project properties (or configure python dialog in wing 101). or in wing personal or pro can set file main debug file, although noticed you'll need restart wing before approach works due apparent failure rescan file.

this changed take local path modifications business relationship in our source analysis, although in general modifying sys.path not great way things since added path may screw other modules import later if trying import module called testlib location. that's why modifications in main debug file.

you may want instead create mylibs bundle adding file called init.py within , can this:

from mylibs import testlib

that solves w/o configuration in wing ide.

python python-2.7 wing-ide

No comments:

Post a Comment