search

Home  >  Q&A  >  body text

python - ValueError: source code string cannot contain null bytes

天蓬老师天蓬老师2850 days ago6814

reply all(2)I'll reply

  • 伊谢尔伦

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

    Use the following command to remove stations.pynull characters from the file. This may be introduced by an error in your text editor.

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

    Here it is:

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

    Additionally, considering that you are on a win system and there is no sed command; it is recommended that you copy the contents of the file to another place and then copy it back again.

    reply
    0
  • 天蓬老师

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

    You can refer to here if you have similar questions

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

    reply
    0
  • Cancelreply