Hi, I was looking at the suggestions to use multiple .py files from this post:
VEXcode V5 2.0.7 Python VM updates - Programming Support / VEXcode V5 Tech Support - VEX Forum
most publicly available modules will probably not import without modification.
It does seem like a lot of VEX objects do work, such as Inertial, Rotation etc. However SmartDrive (and DriveTrain) do not . E.g.: when called from main.py
File: main.py ...
# Library imports
from vex import *
print(Inertial.__name__)
print(DriveTrain.__name__)
Output:
>>> inertial
DriveTrain
Whereas this does not:
File: main.py ...
# Library imports
from vex import *
from helper import *
File: helper.py ... (on SDCard)
# Library imports
from vex import *
print(Inertial.__name__)
print(DriveTrain.__name__)
Output:
>>> inertial
Traceback (most recent call last):
File "userpy", line 3, in <module>
File "helper.py", line 5, in <module>
NameError: name not defined
Curious if there was a workaround since the original post.
Thanks,
Nick.