I have the canonical shebang at the top of my python scripts.
$ python -u myscript.py &> myscript.out &
#!/usr/bin/env python -u
$ ./myscript.py &> myscript.out &
You can have arguments on the shebang line, but most operating systems have a very small limit on the number of arguments. POSIX only requires that one argument be supported, and this is common, including Linux.
Since you're using the
/usr/bin/env command, you're already using up that one argument with
python, so you can't add another argument
-u. If you want to use
python -u, you'll need to hard-code the absolute path to
python instead of using
See this related question: how to use multiple arguments with a shebang (i.e. #!)?