[wingide-users] Python path & path problems
support at wingware.com
Mon Jan 29 15:22:33 MST 2007
On Mon, 2007-01-29 at 15:12 -0700, SirJSR wrote:
> At the Wing console I issued the following, as instructed:
> import os
> print os.getcwd()
> It showed that I was in the correct directory, inddicating no problem.
> Then I issued the following:
> import sys
> sys.path.append('path/to/my script directory/')
> And that seemed to work---I could then run the script with the "import"
> However, according to the first instruction, I was in the correct directory
> already. Any answer to this inconsistency.
If sys.path does not have '.' or '' in it, then Python won't look in the
current directory. It seems if you set Python Path in Wing's Project
Properties, it will omit '.' by default. Hmm, I'm not quite sure why
but this info should let you work around this problem.
> And does the second command "stick"? What does it append my new path to?
The new path is added to the default Python Path as determined by
querying the version of Python you are using.
More information about the wingide-users