On 14/03/16 17:19, David Aldrich wrote:
> myproj ----- gui
>
> |
>
> |-- python
>
> My gui/main.py contains this sort of import code:
>
> import os, sys
> sys.path.append('../python')
> import MyClass
>
>
> The thing is that I am using Microsoft's Visual Studio...
> My question is: is there a better way that I can specify
> the import statements so that a tool such as Intellisense
> will have an absolute path to find the modules?
I know nothing about VS but have you tried setting the
PYTHONPATH environment variable to myproj/python?
Then just use
import MyClass
If VS sees anything its probably the environment vars.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor