OP, I think you're using RobotPy [you had posted on the python forum earlier]?
RobotPy's wpilib utilities has some really useful autonomous tooling to allow you to select multiple modes via SmartDashboard (each .py file in the autonomous directory is automatically detected and added to the options), and also a really easy to use state machine helper for quick and easy autonomous mode creation.
Code:
from robotpy_ext.autonomous import StatefulAutonomous
class DriveForward(StatefulAutonomous):
MODE_NAME = 'Drive Forward'
def initialize(self):
pass
@timed_state(duration=0.5, next_state='drive_forward', first=True)
def drive_wait(self):
pass
@timed_state(duration=5)
def drive_forward(self):
self.drive.move(0, 1, 0)
Check it out at
http://robotpy-wpilib-utilities.read...utonomous.html
We also have a
sample program that uses both the stateful autonomous helper and the automatic autonomous chooser.