When trying to run a windows python file on wsl with shebang for python
Meeting the error:
/usr/bin/python^M: bad interpreter
Cause:It seems like the original file was created in MSDOS/Windows without UNIX/Linux end of line support. So when you tried to run this file on UNIX/Linux, you got an error. The easiest way is to recreate the file on UNIX/Linux.
My solution
Use dos2unix command to format the the file in unix way
e.g.