{"description":"struct\u30e2\u30b8\u30e5\u30fc\u30eb\u306fPython\u306e\u5024\u3068Python\u72b6\u3067\u306e\u6587\u5b57\u5217\u30c7\u30fc\u30bf\u3068\u3057\u3066 \u8868\u3055\u308c\u308bC\u306e\u69cb\u9020\u4f53\u30c7\u30fc\u30bf\u3068\u306e\u9593\u306e\u5909\u63db\u3092\u884c\u3046\u3002 \u4e3b\u306b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u7d4c\u7531\u3067\u30d0\u30a4\u30ca\u30ea\u30fc\u30c7\u30fc\u30bf\u3092\u6271\u3046\u3068\u304d\u306b\u4f7f\u7528\u3059\u308b\u3002 >>> from struct import * >>> data = 1 >>> pdata = pack(\"I\",data) >>> pdata '\\x01\\x00\\x00\\x00' >>> len (pdata) 4 >>> pdata[0] '\\x01' >>> upretdata = unpack(\"4B\",pdata) >>> upretdata (1, 0, 0, 0)","title":"pack()\u3000unpack()","blog_title":"\u4f55\u3067\u3082\u5c4b\u3055\u3093\u306e\u5099\u5fd8\u9332","author_url":"https://blog.hatena.ne.jp/Michael_e29/","url":"https://michael-e29.hatenadiary.org/entry/20110127/1296099156","blog_url":"https://michael-e29.hatenadiary.org/","image_url":null,"published":"2011-01-27 12:32:36","width":"100%","provider_name":"Hatena Blog","type":"rich","author_name":"Michael_e29","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmichael-e29.hatenadiary.org%2Fentry%2F20110127%2F1296099156\" title=\"pack()\u3000unpack() - \u4f55\u3067\u3082\u5c4b\u3055\u3093\u306e\u5099\u5fd8\u9332\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","version":"1.0","height":"190","categories":["Python"]}