Python 3 operator >> to print to file

后端 未结 3 1071
遇见更好的自我
遇见更好的自我 2020-12-29 20:38

I have the following Python code to write dependency files of a project. It works fine with Python 2.x, but while testing it with Python 3 it reports an error.



        
3条回答
  •  执念已碎
    2020-12-29 21:13

    print() is a function in Python 3.

    Change your code to print(s, end="", file=depend), or let the 2to3 tool do it for you.

提交回复
热议问题