I'm coding in Python and have an input as a string that I want to use to decide which method to call. The way I'm implementing it now could get really lengthy, and I was wondering if there was a "case" type of command that could make this more streamlined. I thought of perhaps putting a dictionary together of string commands and methods but wasn't sure how to execute that either.
def configTrigger(self, q):
command = q.text()
if command == "Comm Ports":
self.commWindow()
return
if command == "Symbol Table":
self.updateStatus("Select USI File")
self.getUSI()
return
etc.