I have some python file in windows, and I transfer them to my gentoo by samba.
I check their mode is executable, and I use ./xxx.py to run it, but get an error:

: No such file or directory

I am troubled that it does not prompt what file is not here.
but when I use python xxx.py, it can run in the right way.
and then I check the CR character by use set ff in vim, and found it is dos, then I use set ff=unix to set it, now it can run by using ./xxx.py
but I don't know why it can be use python xxx.py when ff=dos?
Windows line endings are CRLF, or \r\n.
Unix uses simply \n.
When the OS reads your shebang line, it sees #!/usr/bin/python\r. It can't run this command.
A simple way to see this behavior from a unix shell would be $(echo -e 'python\r') (which tries to run python\r as a command). This output will also be similar to : command not found.
Many advanced code editors under Windows support natively saving with unix line endings.
python file in dos and unix