擅长:python、mysql、java
<p>好吧,我找到了答案。。。在</p>
<pre><code> ...
output = bytearray(self.process.readAllStandardOutput())
output = output.decode(self.GetCMD_Encoding())
print (output)
def GetCMD_Encoding(self):
CMD = QProcess(self)
CMD.setProcessChannelMode(QProcess.MergedChannels)
CMD.start("C:\Windows\System32\chcp.com")
CMD.waitForReadyRead()
output = bytearray(CMD.readAllStandardOutput())
output = output.decode("ascii")
output = output[18:]
return "cp" + output
</code></pre>
<p>输出:</p>
<blockquote>
<p>Systém nemůže nalézt uvedenou cestu.</p>
</blockquote>