Heim  >  Fragen und Antworten  >  Hauptteil

python - ValueError: source code string cannot contain null bytes

天蓬老师天蓬老师2740 Tage vor6707

Antworte allen(2)Ich werde antworten

  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:05:37

    使用下面的命令,去除stations.py文件中的null字符。这可能是你的文本编辑器错误引入的。

    sed -i 's/\x0//g' <目标文件>
    

    在这里则为:

    sed -i 's/\x0//g' stations.py
    

    补充,考虑到你是win系统,没有sed命令;建议你将文件中内容复制在其他地方,再重新复制回去。

    Antwort
    0
  • 天蓬老师

    天蓬老师2017-04-18 10:05:37

    可以参考一下这里,有类似的问题

    http://stackoverflow.com/ques...

    Antwort
    0
  • StornierenAntwort