File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed
Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change 1313def process_code (file ):
1414 keys = {
1515
16- "algorithom" :"range" ,
1716 "log" :"print" ,
1817 "ask" : "input" ,
1918 "define" :"def" ,
@@ -22,7 +21,10 @@ def process_code(file):
2221 "else if" :"elif" ,
2322 "//" :"#" ,
2423 "get" :"import" ,
25- "size" :"len"
24+ "size" :"len" ,
25+ "f" :"format" ,
26+ "x=" :"!="
27+
2628
2729
2830 }
@@ -78,11 +80,15 @@ def artColor(color):
7880 def artKey (function , key ):
7981 tur .turtle .onkey (function , key )
8082 return
81- def artSpecial (feature ):
83+ def artStatic (feature ):
8284 if feature == "stamp" :
8385 tur .turtle .stamp ()
8486 elif feature == "dot" :
8587 tur .turtle .dot ()
88+ def runCode ():
89+ while True :
90+ pass
91+
8692
8793
8894
@@ -108,9 +114,15 @@ def artSpecial(feature):
108114 if feature_name in globals ():
109115 feature_func ()
110116
117+
118+ print ("VisualScipt\n Enter a filename or exit to exit" )
111119if __name__ == "__main__" :
112- try :
113- process_code ("C:/Users/isano/OneDrive/Documents/GitHub/VisualScript/src/example.vs" )
114- except Exception as e :
115- print (f"An error occurred: { e } " )
120+ while True :
121+ filename = input (">>> " )
122+ if filename .lower () == 'exit' :
123+ break
124+ try :
125+ process_code (filename )
126+ except Exception as e :
127+ print (f"An error occurred: { e } " )
116128
You can’t perform that action at this time.
0 commit comments