def main() Invalid Syntax, Dev Server & Terminal
python, syntax
Solution
This error is probably being caused by a syntax error higher up in the code, like a missing close paren.
For example the following code will give a SyntaxError in the same place as your code:
(
def main():
pass
If you are having a hard time tracking it down, post some of the code that comes earlier.
Problem
From terminal: ``` File "index.py", line 41 def main(): ^ SyntaxError: invalid syntax ``` From App Engine dev server. I'm running 2.7.3rc2 on Debian: ``` msg = 'invalid syntax' offset = 3 print_file_and_line = None text = 'def main():\n' ``` Script: ``` def main(): # << here run_wsgi_app(application) if __name__=="__main__": main() ```