You are having the following print
statement in your elif
block
print("File", ui "is now open.")
which is syntactically wrong, since it doesn't have a comma after ui
, and you can't concatenate or perform any other operation thus.
Either of the following should correct that
print("File", ui, "is now open.")
print("File %s is now open." % ui)