File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -363,17 +363,31 @@ def demo_driving_stepper_motor() -> None:
363363 time .sleep (2 )
364364
365365
366+ def get_all_functions () -> list [str ]:
367+ function_type = type (lambda : None )
368+
369+ return list (
370+ sorted (
371+ n
372+ for n , o in globals ().items ()
373+ if isinstance (o , function_type ) and not n .startswith ("_" )
374+ )
375+ )
376+
377+
366378def print_available_commands () -> None :
367379 print ("""
368380Available commands:
369381 - help()
370- - init(), reset()
371-
372382
373383 - <just a single period>
374384 -> Repeat the last command.
375385 """ )
376386
387+ print ("All functions:" )
388+ for func in get_all_functions ():
389+ print (f" - { func } (...)" )
390+
377391
378392def help () -> None :
379393 print_available_commands ()
You can’t perform that action at this time.
0 commit comments