Once their robot becomes mobile we need to use webREPL to program the robot. We can upload the script with webREPL then type import script_name and it will run their script. Once the script is run then we need to do a CRTL-D in the REPL to softreset to be re run the script.
I used to have this in my boot.py to reload a script for this purpose. But for reason it now gives an error instead of reloading the script.
Code: Select all
import gc
from sys import modules
def reload(mod):
mod_name = mod.__name__
del sys.modules[mod_name]
gc.collect()
return __import__(mod_name)