Funktion für neue Schaufel und Doku

This commit is contained in:
(MakerLab) Laptop 2 2024-01-03 16:58:32 +01:00
parent 38972ef784
commit a6ea00afb1
2 changed files with 105 additions and 45 deletions

20
main.py
View file

@ -27,11 +27,11 @@ def importFile(slotid=0, precompiled=False, module_name='importFile'):
with open("/projects/.slots","rt") as f:
slots = eval(str(f.read()))
print(slots)
print(os.listdir("/projects/"+str(slots[slotid]["id"])))
#print(os.listdir("/projects/"+str(slots[slotid]["id"])))
with open("/projects/"+str(slots[slotid]["id"])+"/__init__"+suffix,"rb") as f:
print("trying to read import program")
program = f.read()
print(program)
#print(program)
try:
os.remove("/"+module_name+suffix)
except:
@ -52,14 +52,6 @@ def importFile(slotid=0, precompiled=False, module_name='importFile'):
# Dateiname und Modulname sollten gleich sein, dann kann man Code Completion nutzen
importFile(slotid=6, precompiled=True, module_name="iqrobot")
import iqrobot as iq
print(iq.HELLO)
# Importiere Go Robot Code
#importFile(slotid=3, precompiled=True, module_name="gorobot")
#import gorobot as gr
#gr.exampleFour()
#gr.db.gyroRotation(90, 25, 35, 25)
################### Hauptcode ####################################
'''
@ -121,6 +113,8 @@ def augmented_reality():
iqRobot.fahre_gerade_aus(5,20)
druckmaschine()
hologram()
augmented_reality()
#iqRobot.fahre_gerade_aus(16, 20)
#iqRobot.drehe(38)
#iqRobot.fahre_gerade_aus(33,25)
iqRobot.schaufel(1600, speed=100 )
iqRobot.schaufel(-1600, speed=100 )