开发者

Writing to file with sys.stdout in python

开发者 https://www.devze.com 2023-03-25 15:53 出处:网络
ascii85.encode开发者_高级运维(file(\'/work/file1\'), sys.write(\'/work/file2\') I am trying to write to a file with this code using sys.stdout, but it is not writing.
ascii85.encode开发者_高级运维(file('/work/file1'), sys.write('/work/file2')  

I am trying to write to a file with this code using sys.stdout, but it is not writing.

How do I fix the code to write to a file?


Try

ascii85.encode(file('/work/file1'), open('/work/file2', 'w'))

I don't know what exactly you're trying to do but that's how you open a file for writing in Python.

If this isn't what you want please clarify your question.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号