On 09/20/2016 01:40 AM, Clemens Heuberger wrote:
> I have two .py files (not in the library) in the same directory where one
> imports the other. I'd like to run doctests, but the local directory does not
> seem to be in the search path. Is there any way of doing this apart from
> fiddling around with sys.path in the .py files themselves?
> 
> ...
> 
> When I add
> 
> import sys
> sys.path.append(".")
> 
> to a.py, it works; but I'd prefer not to have to modify a.py.
> 

To avoid messing with my PATH (which can have unintended consequences),
I append to my sitedir instead; e.g.

  from site import addsitedir
  addsitedir('./lib')

That's only like 0.1% better though, so if you ever figure out a real
solution please find this thread and let me know.


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to