如何将PowerShell中的这些代码行转换为Python?
$CODEPAGE = "iso-8859-1"
$myFile = "example.exe"
$fileBin = [System.IO.File]::ReadAllBytes($myFile)
$enc = [System.Text.Encoding]::GetEncoding($CODEPAGE)
$fileEnc = $enc.GetString($fileBin)
这些是我到目前为止所能获得的,有人可以告诉我如何将[System.Text.Encoding]::GetEncoding
和.GetString(bytes)
(最后两行)从PowerShell转换为Python吗?非常感谢!
CODEPAGE = "iso-8859-1"
myFile = "example.exe"
fileBin = open(myFile, 'rb').read()