Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ascii85.encode(file('/work/file1'), sys.write('/work/file2')
我正在尝试使用 sys.stdout 使用此代码写入文件,但它没有写入。
如何修复代码以写入文件?
尝试
ascii85.encode(file('/work/file1'), open('/work/file2', 'w'))
我不知道您到底要做什么,但这就是您打开文件以用 Python 编写的方式。
如果这不是您想要的,请澄清您的问题。