Grasshopper

algorithmic modeling for Rhino

Hi everybody,

 

I'm struggling a bit with the module search path because I didn't find a way to add a path without go through the old windows interface.

 

I know that my issue comes from an internal server problems but it should be nice anyway to have the possibility to add path directly as text without using the interface.

I maybe ask something stupid; I begin on python stuff so...  sorry if the answer exists already.

Have nice day,

Tristan Gobin

Views: 1664

Replies to This Discussion

You should be able to add a path like so:

import sys
sys.path.append("C:\YourModuleFolder")

Hope that helps.

As Anders says, but please do not run in cycles or in Grasshopper like this, or same paths will add up. A fix is just to check that the path is not already there, like so:

import sys
new_path = "C:\\YourModuleFolder"
if new_path not in sys.path: sys.path.append(new_path)

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Ok thank's a lot.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service