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

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

      <legend id='l1G9W'><style id='l1G9W'><dir id='l1G9W'><q id='l1G9W'></q></dir></style></legend>
      <tfoot id='l1G9W'></tfoot>
        <bdo id='l1G9W'></bdo><ul id='l1G9W'></ul>
    1. Python 相当于 php 包

      Python equivalent of php pack(Python 相当于 php 包)
        <bdo id='tVUn8'></bdo><ul id='tVUn8'></ul>

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

          1. <legend id='tVUn8'><style id='tVUn8'><dir id='tVUn8'><q id='tVUn8'></q></dir></style></legend>
            • <tfoot id='tVUn8'></tfoot>

            • <i id='tVUn8'><tr id='tVUn8'><dt id='tVUn8'><q id='tVUn8'><span id='tVUn8'><b id='tVUn8'><form id='tVUn8'><ins id='tVUn8'></ins><ul id='tVUn8'></ul><sub id='tVUn8'></sub></form><legend id='tVUn8'></legend><bdo id='tVUn8'><pre id='tVUn8'><center id='tVUn8'></center></pre></bdo></b><th id='tVUn8'></th></span></q></dt></tr></i><div id='tVUn8'><tfoot id='tVUn8'></tfoot><dl id='tVUn8'><fieldset id='tVUn8'></fieldset></dl></div>
                <tbody id='tVUn8'></tbody>
              1. 本文介绍了Python 相当于 php 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在 php 中有以下语句将 hex 字符串转换为 binary.

                I have this statement below in php to convert hex string to binary.

                $m=pack("H*" , "A88BE9L98990........");
                

                我需要在另一个 python 程序中做同样的事情?

                I need to do the same in another python program ?

                有什么想法吗?

                干杯,

                推荐答案

                binascii 模块有 binascii.unhexlify(hexstr),可以满足你的需求.

                The binascii module has binascii.unhexlify(hexstr), which does what you want.

                >>> import binascii
                >>> binascii.unhexlify("A88BE9L98990")
                Traceback (most recent call last):
                  File "<stdin>", line 1, in <module>
                TypeError: Non-hexadecimal digit found
                # Not sure why there's an L in there... take it out...
                >>> binascii.unhexlify("A88BE9989900")
                'xa8x8bxe9x98x99x00'
                

                这篇关于Python 相当于 php 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                PHP Upload File Validation(PHP 上传文件验证)
                PHP Error - Uploading a file(PHP 错误 - 上传文件)
                How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)
                • <i id='pk0z5'><tr id='pk0z5'><dt id='pk0z5'><q id='pk0z5'><span id='pk0z5'><b id='pk0z5'><form id='pk0z5'><ins id='pk0z5'></ins><ul id='pk0z5'></ul><sub id='pk0z5'></sub></form><legend id='pk0z5'></legend><bdo id='pk0z5'><pre id='pk0z5'><center id='pk0z5'></center></pre></bdo></b><th id='pk0z5'></th></span></q></dt></tr></i><div id='pk0z5'><tfoot id='pk0z5'></tfoot><dl id='pk0z5'><fieldset id='pk0z5'></fieldset></dl></div>
                    <tbody id='pk0z5'></tbody>

                    <tfoot id='pk0z5'></tfoot>

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

                        <bdo id='pk0z5'></bdo><ul id='pk0z5'></ul>

                        <legend id='pk0z5'><style id='pk0z5'><dir id='pk0z5'><q id='pk0z5'></q></dir></style></legend>