When I put this python code into the REPL for python (the interactive shell), it works as expected:
>>> def get_header():
... return (None,None,None)
...
>>> get_header()
(None, None, None)
Note that the return statement is indented by four spaces, and I have checked to ensure there are no extraneous spaces.
when I put the exact same code into a python script file and execute it, I get the following error:
./test.py: line 1: syntax error near unexpected token `('
./test.py: line 1: `def get_header():'
WHY?
EDIT: this is the exact contents of test.py, white spaces and all:
def get_header():
return (None,None,None)
get_header()
I have verified that the above script (test.py) does yield the above error as it above stands.
python test.py. As one of the answers suggests, you are missing the shebang line