On 11/05/2010 21:50, Dino Viehland wrote:
Matt Funke:
In IronPython Tools for Visual Studio 2010, how do you make it clear
where the location of a file to be included is?  I have this line that
trips up the execution:

from avalon import *

... even though avalon.py is in the same directory, and that directory
is pointed to by the Search Path.  It throws an ImportError, insisting
that there is "No module named avalon".  Is there some other thing I
need to point at this that I'm missing?
How are you launching the app?  Is it via the interactive window or are you
doing a start w/ or w/o debugger?  It looks like we don't set the path in
the interactive window but we do otherwise.

Of course being in the same directory (as the start file) should mean
that it's available for import anyway.  If you could do:

import System
import sys
print System.Environment.CurrentDirectory, sys.path

and see if those values are the correct dir for your project and include
the directories you've setup in the search path.

I'm also not sure how I feel about setting the search path via the UI
in general.  I'm a little concerned that it'll make it too easy to create
scripts that work when launched in VS but not outside of VS.  So if anyone
has any feedback on how this should be handled I'd love to hear it.


Hmm... Wing lets you set the search paths for the IDE so that it can correctly find modules / packages for intellisense (etc). It *doesn't* automatically add these path entries to sys.path when you run under debugging though.

Michael


_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog

READ CAREFULLY. By accepting and reading this email you agree, on behalf of 
your employer, to release me from all obligations and waivers arising from any 
and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, 
clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and 
acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your 
employer, its partners, licensors, agents and assigns, in perpetuity, without 
prejudice to my ongoing rights and privileges. You further represent that you 
have the authority to release me from any BOGUS AGREEMENTS on behalf of your 
employer.


_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to