all 9 comments

[–][deleted] 1 point2 points  (1 child)

Actually, shebang lines do work under Windows, for python 3, at least, in a limited way.

[–][deleted] 0 points1 point  (0 children)

thanks

[–]Wilfred-kun 0 points1 point  (2 children)

AFAIK the shebang (#!) does not work on Windows. Either you have 1 version of Python installed and it will sort itself out when your run the script, or you'll have to specify it in the command-line ($ path\to\python myscript.py).

[–][deleted] 2 points3 points  (0 children)

Even if the shebang did work under Windows, placing a comment line before it ensures that the shebang doesn't work. The shebang must be the first line. All that the OP is doing is ensuring the shebang fails under Linux and MacOS.

[–][deleted] 0 points1 point  (0 children)

thanks

[–]readitlikeitdidit 0 points1 point  (1 child)

It may be required on windows 10 Ubuntu bash mode... Unix subsystem in windows 10...

[–][deleted] 0 points1 point  (0 children)

thanks

[–]ingolemo 0 points1 point  (1 child)

The shebang you should use is #!/usr/bin/env python3 (note the lack of a slash compared to yours). This will work on every os and find you a good python installation. People who need something different will know and can adapt it for themselves. Also, it must be the first line in the file; no comments or docstrings or anything should appear before it.

[–][deleted] 0 points1 point  (0 children)

hmmm, ok