<i id='7eSda'><tr id='7eSda'><dt id='7eSda'><q id='7eSda'><span id='7eSda'><b id='7eSda'><form id='7eSda'><ins id='7eSda'></ins><ul id='7eSda'></ul><sub id='7eSda'></sub></form><legend id='7eSda'></legend><bdo id='7eSda'><pre id='7eSda'><center id='7eSda'></center></pre></bdo></b><th id='7eSda'></th></span></q></dt></tr></i><div id='7eSda'><tfoot id='7eSda'></tfoot><dl id='7eSda'><fieldset id='7eSda'></fieldset></dl></div>
    1. <tfoot id='7eSda'></tfoot>

        • <bdo id='7eSda'></bdo><ul id='7eSda'></ul>
      1. <small id='7eSda'></small><noframes id='7eSda'>

      2. <legend id='7eSda'><style id='7eSda'><dir id='7eSda'><q id='7eSda'></q></dir></style></legend>

        TypeError:需要一个类似字节的对象,而不是 subprocess.check_output 中的“str&quo

        时间:2023-09-03
        1. <legend id='l6pfT'><style id='l6pfT'><dir id='l6pfT'><q id='l6pfT'></q></dir></style></legend>
            <tbody id='l6pfT'></tbody>
              <bdo id='l6pfT'></bdo><ul id='l6pfT'></ul>

                  <small id='l6pfT'></small><noframes id='l6pfT'>

                  <tfoot id='l6pfT'></tfoot>
                  <i id='l6pfT'><tr id='l6pfT'><dt id='l6pfT'><q id='l6pfT'><span id='l6pfT'><b id='l6pfT'><form id='l6pfT'><ins id='l6pfT'></ins><ul id='l6pfT'></ul><sub id='l6pfT'></sub></form><legend id='l6pfT'></legend><bdo id='l6pfT'><pre id='l6pfT'><center id='l6pfT'></center></pre></bdo></b><th id='l6pfT'></th></span></q></dt></tr></i><div id='l6pfT'><tfoot id='l6pfT'></tfoot><dl id='l6pfT'><fieldset id='l6pfT'></fieldset></dl></div>
                1. 本文介绍了TypeError:需要一个类似字节的对象,而不是 subprocess.check_output 中的“str"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我得到 TypeError: a bytes-like object is required, not 'str' in the following line code in python3.5.

                  I am getting TypeError: a bytes-like object is required, not 'str' in the following line of code in python3.5.

                  path = os.getcwd().strip('/n')
                  Null,userprof = subprocess.check_output('set USERPROFILE', shell=True).split('=')
                  

                  推荐答案

                  使用split功能前解码

                  Null,userprof = subprocess.check_output('set USERPROFILE', shell=True).decode('utf-8').split('=')
                  

                  这篇关于TypeError:需要一个类似字节的对象,而不是 subprocess.check_output 中的“str"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Ping 的 Python 控制台和文本输出,包括 下一篇:Python中无限期的守护进程生成

                  相关文章

                  • <bdo id='AzDRE'></bdo><ul id='AzDRE'></ul>
                  <i id='AzDRE'><tr id='AzDRE'><dt id='AzDRE'><q id='AzDRE'><span id='AzDRE'><b id='AzDRE'><form id='AzDRE'><ins id='AzDRE'></ins><ul id='AzDRE'></ul><sub id='AzDRE'></sub></form><legend id='AzDRE'></legend><bdo id='AzDRE'><pre id='AzDRE'><center id='AzDRE'></center></pre></bdo></b><th id='AzDRE'></th></span></q></dt></tr></i><div id='AzDRE'><tfoot id='AzDRE'></tfoot><dl id='AzDRE'><fieldset id='AzDRE'></fieldset></dl></div>

                  <small id='AzDRE'></small><noframes id='AzDRE'>

                      <legend id='AzDRE'><style id='AzDRE'><dir id='AzDRE'><q id='AzDRE'></q></dir></style></legend><tfoot id='AzDRE'></tfoot>