Python 如何使用Windows内置命令对二进制文件进行编码/解码?

Python 如何使用Windows内置命令对二进制文件进行编码/解码?,python,windows,decode,encode,Python,Windows,Decode,Encode,在python中,有base64/base85/base65536…等等。将文件编码为纯“文本”格式。 并且可以通过解码将其传输到“正常”文件。 import base64 f = open(filename,'rb') r = base64.b64encode(f.read()) print(str(r)) 然后,通过使用str(r),可以将文件传输为纯文本。 使用Windows命令可以做到这一点吗? 我在这个链接中找到了“certutil”命令。 对文件进行编码 certutil-enco

在python中,有base64/base85/base65536…等等。将文件编码为纯“文本”格式。
并且可以通过解码将其传输到“正常”文件。

import base64
f = open(filename,'rb')
r = base64.b64encode(f.read())
print(str(r))
然后,通过使用str(r),可以将文件传输为纯文本。
使用Windows命令可以做到这一点吗?


我在这个链接中找到了“certutil”命令。

对文件进行编码
certutil-encode inputFileName encodedOutputFileName

解码文件
certutil-decode-encodedInputFileName-decodedOutFileName