I’m just starting to learn python… so bear with me please
Why is it giving me a Invalid Syntax error with this block of code
def InvalidArgsSpecified:
print ("*** Simtho Usage ***\n")
print ("-i Installs Local App,, include full path")
print ("-u Uninstalls Installed App,include ID or Name")
print ("-li Lists all installed Apps and their ID")
print ("-all Lists All Apps in Repository")
print ("-di Downloads and Installs App from repository, enter the title or id number")
print ("-dw Downloads and Installs Single App from a full link")
print ("-rmall Removes All Packages installed and removes Simtho itself\n")
print ("*** End of Simtho Usage ***")
sys.exit()
edit: Now its saying that it’s undefined at line 9
Line 9 is
InvalidArgsSpecified()
The syntax error is in the very first line, where you have:
change it to:
Those parentheses are mandatory in a
def, even when there’s nothing between them (just as parentheses are always used to call a function — empty parentheses, in that case, if you’re calling without arguments).Edit: now the OP’s getting an error for trying to call this function in line 9: since this function definition is more than 9 lines, it’s probably getting called (from module top-level, rather than from within another function) before it’s defined, in which case the simple fix is to call it only after it’s defined. If it’s anything subtler than that, we’ll need to see the code to debug it for you!-)