Last active
January 16, 2020 03:33
-
-
Save bricklife/7f57a278a517a429418162463f694f76 to your computer and use it in GitHub Desktop.
Overwriting main.py in LEGO Education SPIKE Prime Hub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
f = io.open('main.py', 'w') | |
f.write(''' | |
import hub | |
import time | |
while True: | |
hub.display.show(hub.Image('00000:00000:00900:00000:00000:')) | |
time.sleep_ms(500) | |
hub.display.show(hub.Image('00000:09990:09090:09990:00000:')) | |
time.sleep_ms(500) | |
hub.display.show(hub.Image('99999:90009:90009:90009:99999:')) | |
time.sleep_ms(500) | |
''') | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DISCLAIMER
Please use this script at your own risk. I'm not responsible for any damage on your hub.
How to overwrite main.py
Ctrl-C
to enter REPL modeCtrl-E
to enter Paste modeCtrl-D
to exit Paste modemain.py
should be as followsOriginal main.py
https://gist.github.com/bricklife/8cf5e6f71849c834d749d598cddfe712