I wrote a python file on Win7 with idle (Mytopo
. py), but with Putty
uploaded to the Ubuntu system in the VM and executed in./mytopo mode.
Display:
/bin/sh^m:bad Interpreter:no such
file or
Directory
.
but using Python mytopo. Py execution can be performed correctly.
Baffled , and later on the internet to find the reason:
This is a problem caused by different system encoding formats, with characters that are not recognized by the Linux system in the. py file that is edited in the Windows system.
so in Ubuntu system execution will be error: Badinterpreter:no such or file directory .?
Mytopo part of the source code:
#!/usr/bin/python#The mininet Project2#filename:MyTopo.py#Author:lewis fromMininet.topoImportTopo fromMininet.netImportmininet fromMininet.utilImportirange,dumpnodeconnections fromMininet.logImportsetloglevel ...
WINS and Linux systems are caused by different encoding formats. PY execution problem: Bad interpreter:no such or file directory