I have the canonical shebang at the top of my python scripts.
#!/usr/bin/env python
However, I still often want to export unbuffered output to a log file when I run my scripts, so I end up calling:
$ python -u myscript.py &> myscript.out &
Can I embed the -u option in the shebang like so...
#!/usr/bin/env python -u
and only call:
$ ./myscript.py &> myscript.out &
...to still get the unbuffering? I suspect that won't work, and want to check before trying. Is there something that would accomplish this?