Hi, I’m trying to import a local module file that has a dependency into a main script in the script editor. Here is my main script:
#! python3
# env: /my/current/folder
# env: /my/python/environment
import rhinoscriptsyntax as rs
from ScriptFile import *
rs.AddPoint((1,2,3)) # works
works() # works
doesnt_work() # error: NameError: name 'rs' is not defined
The ScriptFile is:
def works():
print("This works")
def doesnt_work():
rs.AddPoint( (1,2,3) )
print("This doesn't work")
The two files are stored in the same local folder ( the first #env directiory).
Why doesn’t this work?
3 posts - 2 participants