{"id":751,"date":"2020-02-06T00:00:05","date_gmt":"2020-02-06T09:00:05","guid":{"rendered":"https:\/\/www.ishikawasekkei.com\/?p=751"},"modified":"2020-03-10T03:55:46","modified_gmt":"2020-03-10T12:55:46","slug":"python-hex-dump-part2","status":"publish","type":"post","link":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/","title":{"rendered":"Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b\u3000\u305d\u306e\uff12"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u4eca\u65e5\u3082\u898b\u306b\u6765\u3066\u304f\u3060\u3055\u3063\u3066\u3001\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002\u306a\u305c\u304b\u7740\u3005\u3068\u8aad\u8005\u6570\u304c\u5897\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5148\u65e5\u3001Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u8a18\u4e8b\u3092\u30a2\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002\u3067\u3082\u3001\u3057\u3070\u3089\u304f\u3057\u3066\u3001\u305d\u3046\u3044\u3048\u3070\u3001\u3042\u308c\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u3064\u304f\u3063\u305f\u3060\u3051\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u306f\u8a00\u3048\u306a\u3044\u3088\u306d\u3047\u3001\u3068\u3044\u3046\u6c17\u6301\u3061\u306b\u306a\u3063\u3066\u307e\u3044\u308a\u307e\u3057\u305f\u3002\u518d\u5229\u7528\u3082\u3067\u304d\u306a\u3044\u3057\u3001\u62e1\u5f35\u6027\u306b\u3082\u4e4f\u3057\u3044\u3067\u3059\u304b\u3089\u306d\u3002\u3068\u3001\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f\u3001\u5148\u65e5\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u3057\u3066\u307f\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u3092\u30c6\u30fc\u30de\u306b\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Python\u3067\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u3064\u304f\u308b\u3068\u3001<code>import<\/code>\u6587\u3067\u8aad\u307f\u8fbc\u3093\u3067\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u5148\u65e5\u306f\u3001\u300c<code>python hexdump.py \u30d5\u30a1\u30a4\u30eb\u540d<\/code>\u300d\u3067\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u304c\u3001\u3053\u306e\u6a5f\u80fd\u3092\u6b8b\u3057\u305f\u307e\u307e\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u4e2d\u3067\u300c<code>h=hexdump(filename)<\/code>\u300d\u306e\u3088\u3046\u306b\u6587\u5b57\u5217\u3092\u8fd4\u3059\u3088\u3046\u306b\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eca\u56de\u3082\u3001\u6642\u9593\u306e\u306a\u3044\u65b9\u306b\u3001\u5b8c\u6210\u3057\u305f\u30bd\u30fc\u30b9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from os.path import exists\n\ndef hexdump(filename, separator=\" \", enterper=20, separateper=10, start=None, end=None):\n    '''\u51e6\u7406\uff1a\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u309216\u9032\u6570\u3067\u30c0\u30f3\u30d7\u3059\u308b\n\u5f15\u6570\uff1aseparator \u533a\u5207\u308a\u6587\u5b57 \u521d\u671f\u5024\u7a7a\u767d \u30d0\u30a4\u30c8\u3054\u3068\u306b\u633f\u5165\u3059\u308b\n\u3000\u3000\u3000enterper \u4f55\u30d0\u30a4\u30c8\u3054\u3068\u306b\u6539\u884c\u3059\u308b\u304b\n\u3000\u3000\u3000separateper \u4f55\u30d0\u30a4\u30c8\u3054\u3068\u306b\u8ffd\u52a0\u3067\u533a\u5207\u308a\u6587\u5b57\u3092\u5165\u308c\u308b\u304b\n\u3000\u3000\u3000start \u4f55\u30d0\u30a4\u30c8\u76ee\u304b\u3089\u30b9\u30e9\u30a4\u30b9\u306e\u958b\u59cb\u5024\n\u3000\u3000\u3000end \u4f55\u30d0\u30a4\u30c8\u76ee\u307e\u3067\u30b9\u30e9\u30a4\u30b9\u306e\u7d42\u4e86\u5024\n    '''\n    if not exists(filename):\n        raise Exception(f\"\u6307\u5b9a\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u5b58\u5728\u3057\u307e\u305b\u3093\u3002[{filename}]\")\n\n    with open(filename, 'rb') as f:\n        data = f.read()\n\n    output = \"\"\n    data = data[start:end]\n    for i, x in enumerate(data, 1):\n        output += f'{x:02x}' + separator\n        if enterper &gt; 0 and i % enterper == 0:\n            output += \"\\n\"\n        elif separateper &gt; 0 and i % separateper == 0:\n            output += separator\n\n    return output\n\nif __name__ == '__main__':\n    from sys import argv\n    howtouse = f'\u4f7f\u3044\u65b9\uff1apython {argv[0]} \u30c0\u30f3\u30d7\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u540d'\n    if len(argv) != 2:\n        print(howtouse)\n        exit()\n    print(hexdump(argv[1]))<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u53d6\u308a\u6025\u304e\u3001\u307e\u305a\u306f\u3001\u95a2\u6570\u3092\u4f5c\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u3087\u3046\u3002\u95a2\u6570\u306f\u3001<code>def<\/code>\u3092\u4f7f\u3063\u3066\u5b9a\u7fa9\u3057\u307e\u3059\u3002\u524d\u56de\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from os.path import exists\n\ndef hexdump(filename):\n    '''\u51e6\u7406\uff1a\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u309216\u9032\u6570\u3067\u30c0\u30f3\u30d7\u3059\u308b'''\n    if not exists(filename):\n        raise Exception(f\"\u6307\u5b9a\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u5b58\u5728\u3057\u307e\u305b\u3093\u3002[{filename}]\")\n\n    with open(filename, 'rb') as f:\n        data = f.read()\n\n    output = \"\"\n    for i, x in enumerate(data, 1):\n        output += f'{x:02x} '\n        if i % 20 == 0:\n            output += \"\\n\"\n        elif i % 10 == 0:\n            output += ' '\n\n    return output\n\nif __name__ == '__main__':\n    from sys import argv\n    howtouse = f'\u4f7f\u3044\u65b9\uff1apython {argv[0]} \u30c0\u30f3\u30d7\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u540d'\n    if len(argv) != 2:\n        print(howtouse)\n        exit()\n    print(hexdump(argv[1]))<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u304b\u3089\u9806\u756a\u306b\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u307e\u305a<code>def<\/code>\u3092\u4f7f\u3063\u3066\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u6b21\u306e\u884c\u3067\u3059\u3002<code>'''<\/code>\u3067\u59cb\u307e\u3063\u3066\u3001<code>'''<\/code>\u3067\u7d42\u4e86\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u306f\u4e09\u9023\u5f15\u7528\u7b26\u3068\u3044\u3044\u307e\u3057\u3066\u3001\u9593\u306e\u6539\u884c\u3092\u8a31\u3057\u3066\u6587\u5b57\u5217\u3092\u751f\u6210\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u3053\u306e<code>def<\/code>\u306e\u76f4\u5f8c\u306e\u6587\u5b57\u5217\u306f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3068\u3057\u3066\u6271\u308f\u308c\u3001\u5927\u898f\u6a21\u958b\u767a\u306a\u3069\u3001\u305f\u304f\u3055\u3093\u306e\u4eba\u3068\u5354\u696d\u3057\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b\u3068\u304d\u306b\u3068\u3066\u3082\u5f79\u7acb\u3064\u8aac\u660e\u306b\u306a\u308a\u307e\u3059\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>help<\/code>\u95a2\u6570\u3092\u4f7f\u3063\u3066\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&gt;&gt;&gt; from hexdump import hexdump\n&gt;&gt;&gt; help(hexdump)\nHelp on function hexdump in module hexdump:\n\nhexdump(filename)\n    \u51e6\u7406\uff1a\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u309216\u9032\u6570\u3067\u30c0\u30f3\u30d7\u3059\u308b\n\n&gt;&gt;&gt;                                 <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u6587\u5b57\u5217\u3001\u5b9f\u969b\u306b\u306f\u3001\u95a2\u6570\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5c5e\u6027<code>__doc__<\/code>\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u307e\u3059\u3002<code>help<\/code>\u95a2\u6570\u306f\u3053\u306e\u5c5e\u6027\u5024\u3092\u6574\u5f62\u3057\u3066\u51fa\u529b\u3057\u3066\u3044\u308b\u306e\u3067\u3057\u3087\u3046\u306d\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&gt;&gt;&gt; hexdump.__doc__\n'\u51e6\u7406\uff1a\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u309216\u9032\u6570\u3067\u30c0\u30f3\u30d7\u3059\u308b'\n&gt;&gt;&gt;                                             <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3055\u3066\u3001\u6b21\u306b\u3055\u3089\u308a\u3068\u767b\u5834\u3057\u305f\u306e\u304c<code>raise Exception<\/code>\u3067\u3059\u306d\u3002\u3053\u308c\u306f\u4f8b\u5916(Exception)\u3068\u3044\u3046Python\u306e\u6a5f\u69cb\u3067\u3001\u5b9f\u884c\u6642\u306e\u30a8\u30e9\u30fc\u306b\u5bfe\u51e6\u3059\u308b\u305f\u3081\u306b\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3067\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u3092\u8003\u616e\u305b\u305a\u5b9f\u884c\u3059\u308c\u3070\u3001<code>open<\/code>\u3067<code>FileNotFoundError: [Errno 2] No such file or directory: '\u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u540d'<\/code>\u3068\u3044\u3046\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3059\u3002\u3067\u3082\u3001\u4eca\u56de\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u3001\u300c\u6307\u5b9a\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u5b58\u5728\u3057\u307e\u305b\u3093\u3002[\u30d5\u30a1\u30a4\u30eb\u540d]\u300d\u3068\u4e01\u5be7\u306b\u6559\u3048\u3066\u3042\u3052\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\u5927\u898f\u6a21\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u958b\u767a\u3059\u308b\u3068\u304d\u306f\u72ec\u81ea\u306e\u4f8b\u5916\u3092\u5b9a\u7fa9\u3059\u308b\u3088\u3046\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u898f\u6a21\u3082\u5c0f\u3055\u3044\u306e\u3067\u3001\u3053\u308c\u3067\u3088\u3044\u3067\u3057\u3087\u3046\u3002<br>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u958b\u3051\u306a\u304b\u3063\u305f\u6642\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u306e\u4e00\u822c\u7684\u306a\u51e6\u7f6e\u3068\u3057\u3066\u3001\u95a2\u6570\u306e\u623b\u308a\u5024\u3092\u4f7f\u3063\u3066<code>None<\/code>\u3092\u8fd4\u3059\u3053\u3068\u3067\u30a8\u30e9\u30fc\u3092\u6559\u3048\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u4e88\u671f\u305b\u306c\u4e0d\u5177\u5408\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u3053\u306e\u3088\u3046\u306a\u5834\u5408\u306b\u306f\u4f8b\u5916\u3092\u9078\u3076\u3001\u3068\u3044\u3046\u306e\u304c\u30d1\u30a4\u30bd\u30cb\u30c3\u30af\u306a\u8003\u3048\u65b9\u3060\u305d\u3046\u3067\u3059(\u7b11)\u3002<br>\u3061\u306a\u307f\u306b\u3001\u3069\u3046\u3044\u3046\u3068\u304d\u306b\u4e88\u671f\u305b\u306c\u4e0d\u5177\u5408\u306b\u306a\u308b\u304b\u3068\u3044\u3046\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u304c0\u306e\u6642\u306e\u623b\u308a\u5024\u5224\u5b9a\u306a\u3069\u3067\u3059\u306d\u3002<code>if not data:<\/code>\u306e\u3088\u3046\u306b\u66f8\u3044\u3066\u3057\u307e\u3046\u3068\u3001\u30a8\u30e9\u30fc\u304b\u30c7\u30fc\u30bf\u306a\u3057\u304b\u308f\u304b\u3089\u305a\u306b\u51e6\u7406\u7d9a\u884c\u3057\u3066\u3057\u30c9\u30c4\u30dc\u306b\u30cf\u30de\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3055\u3066\u3001\u306e\u3053\u308a\u3082\u3046\u3072\u3068\u3064\u6ce8\u76ee\u70b9\u306f\u3001\u6700\u5f8c\u306e\u65b9\u306e<code>if __name__ == '__main__':<\/code>\u3067\u3059\u3002\u3053\u306e\u8a18\u8ff0\u306b\u3088\u308a\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u3057\u3066<code>import<\/code>\u3057\u305f\u3068\u304d\u306b\u3053\u306e\u884c\u4ee5\u964d\u306f\u5b9f\u884c\u3055\u308c\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u305f\u3060\u3057\u3001<code>python hexdump.py ...<\/code>\u3068\u5b9f\u884c\u3055\u308c\u305f\u3068\u304d\u306b\u306f\u3001\u3053\u306e<code>if<\/code>\u4ee5\u964d\u306e\u51e6\u7406\u304c\u6709\u52b9\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u3082Python\u3067\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30b9\u30bf\u30f3\u30c9\u30a2\u30ed\u30f3\u3068\u3057\u3066\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u6e96\u6a19\u6e96\u30a4\u30c7\u30a3\u30aa\u30e0\u306a\u306e\u3067\u3001\u899a\u3048\u3066\u304a\u304f\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002\u6700\u5f8c\u306b\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304f\u3053\u3068\u3067\u3001\u30b9\u30bf\u30f3\u30c9\u30a2\u30ed\u30f3\u3068\u3057\u3066\u5b9f\u884c\u3067\u304d\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u4f7f\u3044\u65b9\u306e\u5177\u4f53\u4f8b\u3092\u793a\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u7a4d\u6975\u7684\u306b\u66f8\u3044\u305f\u65b9\u304c\u3044\u3044\u306e\u304b\u306a\u3001\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3044\u3044\u611f\u3058\u306b\u3067\u304d\u307e\u3057\u305f\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u305f\u3068\u3053\u308d\u3001\u30b9\u30bf\u30f3\u30c9\u30a2\u30ed\u30f3\u306e\u5b9f\u884c\u306f\u3053\u308c\u307e\u3067\u901a\u308a\u3067\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u3057\u304b\u3057\u3001\u95a2\u6570\u3068\u3057\u3066\u5b9f\u884c\u3057\u305f\u7d50\u679c\u306f\u3044\u307e\u3044\u3061\u3067\u3059\u3002\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&gt;&gt;&gt; import hexdump\n&gt;&gt;&gt; hexdump.hexdump('hexdump.py')\n'66 72 6f 6d 20 6f 73 2e 70 61  74 68 20 69 6d 70 6f 72 74 20 \\n65 78 69 73 74 73 0d 0a 0d 0a  64 65 66 20 68 65 78 64 75 6d \\n70 28 \n\u30fb\u30fb\u30fb\uff08\u4e2d\u7565\uff09\u30fb\u30fb\u30fb\n\\n20 20 65 78 69 74 28 29 0d 0a  20 20 20 20 70 72 69 6e 74 28 \\n68 65 78 64 75 6d 70 28 61 72  67 76 5b 31 5d 29 29 0d 0a 0d \\n0a '\n&gt;&gt;&gt;                                                                                                                     <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u9593\u306e\u7a7a\u767d\u3084\u6539\u884c\u30b3\u30fc\u30c9\u3001\u81ea\u7531\u306b\u6307\u5b9a\u3057\u305f\u3044\u3067\u3059\u3088\u306d\u3002\u305d\u308c\u306b\u3001\u958b\u59cb\u3068\u53d6\u5f97\u30d0\u30a4\u30c8\u6570\u306a\u3069\u304c\u3042\u308b\u3068\u3044\u3044\u304b\u3082\u3002\u3068\u3001\u3044\u3046\u3053\u3068\u3067\u3001\u6307\u5b9a\u53ef\u80fd\u306b\u5909\u66f4\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def hexdump(filename, separator=\" \", enterper=20, separateper=10, start=None, end=None):\n    '''\u51e6\u7406\uff1a\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u309216\u9032\u6570\u3067\u30c0\u30f3\u30d7\u3059\u308b\n\u5f15\u6570\uff1aseparator \u533a\u5207\u308a\u6587\u5b57 \u521d\u671f\u5024\u7a7a\u767d \u30d0\u30a4\u30c8\u3054\u3068\u306b\u633f\u5165\u3059\u308b\n\u3000\u3000\u3000enterper \u4f55\u30d0\u30a4\u30c8\u3054\u3068\u306b\u6539\u884c\u3059\u308b\u304b\uff080\u306f\u6539\u884c\u306a\u3057\uff09\n\u3000\u3000\u3000separateper \u4f55\u30d0\u30a4\u30c8\u3054\u3068\u306b\u8ffd\u52a0\u3067\u533a\u5207\u308a\u6587\u5b57\u3092\u5165\u308c\u308b\u304b\uff080\u306f\u8ffd\u52a0\u306a\u3057\uff09\n\u3000\u3000\u3000start \u4f55\u30d0\u30a4\u30c8\u76ee\u304b\u3089\u30b9\u30e9\u30a4\u30b9\u306e\u958b\u59cb\u5024\n\u3000\u3000\u3000end \u4f55\u30d0\u30a4\u30c8\u76ee\u307e\u3067\u30b9\u30e9\u30a4\u30b9\u306e\u7d42\u4e86\u5024\n    '''<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u3042\u308a\u3059\u304e\u3066\u3001\u3061\u3087\u3063\u3068\u4f7f\u3044\u52dd\u624b\u304c\u3088\u304f\u306a\u3044\u3067\u3059\u3051\u3069\u3001\u305d\u306e\u4ed6\u306e\u5909\u66f4\u7b87\u6240\u306f\u308f\u308a\u3068\u9650\u5b9a\u3055\u308c\u3066\u3044\u3066\u3001\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">    data = data[start:end]\n    for i, x in enumerate(data, 1):\n        output += f'{x:02x}' + separator\n        if enterper &gt; 0 and i % enterper == 0:\n            output += \"\\n\"\n        elif separateper &gt; 0 and i % separateper == 0:\n            output += separator<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u307e\u3067\u5b8c\u5168\u306b\u30b9\u30eb\u30fc\u3057\u3066\u307e\u3057\u305f\u3051\u3069\u3001\u300c%\u300d\u6f14\u7b97\u5b50\u306f\u4f59\u308a\u3092\u6c42\u3081\u308b\u6f14\u7b97\u5b50\u3067\u30e2\u30b8\u30e5\u30ed\u3068\u3044\u3044\u307e\u3059\u30020\u3067\u5272\u308a\u7b97\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u306e\u3067\u3001<code>enterper &gt; 0<\/code>\u3092\u5165\u308c\u308b\u3053\u3068\u3067\u610f\u5473\u306e\u306a\u3044\u30de\u30a4\u30ca\u30b9\u5024\u3068\u30a8\u30e9\u30fc\u3092\u56de\u907f\u3057\u3066\u3044\u307e\u3059\u3002\u3061\u306a\u307f\u306bPython\u306e\u8ad6\u7406\u6f14\u7b97\u306f\u3001\u5de6\u304b\u3089\u9806\u756a\u306b\u8a55\u4fa1\u3057\u3066\u3044\u304d\u307e\u3059\u3002<code>enterper &gt; 0<\/code>\u3092\u8a55\u4fa1\u3057\u3066\u304b\u3089<code>i % enterper == 0<\/code>\u3092\u8a55\u4fa1\u3059\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u307e\u305f\u3001<code>enterper &gt; 0<\/code>\u304cFalse\u306b\u306a\u308b\u5834\u5408\u306f\u305d\u306e\u6642\u70b9\u3067\u5f0f\u5168\u4f53\u304cFalse\u3067\u3042\u308b\u3068\u3044\u3046\u3053\u3068\u304c\u78ba\u5b9a\u3059\u308b\u306e\u3067\u3001\u6b21\u306e\u5f0f\u306e\u8a55\u4fa1\u306f\u5fc5\u8981\u306a\u3044\u305f\u3081\u884c\u3044\u307e\u305b\u3093\u3002\u3053\u306e\u305f\u3081\u3001\u8a55\u4fa1\u3057\u3066\u307b\u3057\u3044\u9806\u756a\u306b\u5f0f\u3092\u66f8\u304f\u3088\u3046\u6c17\u3092\u3064\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6539\u826f\u70b9\u306f\u307e\u3060\u307e\u3060\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u3053\u307e\u3067\u3067\u3044\u3063\u305f\u3093\u30e2\u30b8\u30e5\u30fc\u30eb\u3078\u306e\u7f6e\u304d\u63db\u3048\u306f\u5b8c\u4e86\u3068\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u65e5\u3082\u898b\u306b\u6765\u3066\u304f\u3060\u3055\u3063\u3066\u3001\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002\u306a\u305c\u304b\u7740\u3005\u3068\u8aad\u8005\u6570\u304c\u5897\u3048\u3066\u3044\u307e\u3059\u3002 \u5148\u65e5\u3001Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u8a18\u4e8b\u3092\u30a2\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002\u3067\u3082\u3001\u3057\u3070\u3089\u304f\u3057\u3066\u3001\u305d\u3046\u3044\u3048\u3070\u3001\u3042\u308c\u306f\u30b9\u30af\u30ea &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b\u3000\u305d\u306e\uff12&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":761,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,2],"tags":[],"class_list":["post-751","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-program","category-blog"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"sTone\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"ja_JP\" \/>\n\t\t<meta property=\"og:site_name\" content=\"\u682a\u5f0f\u4f1a\u793e \u77f3\u5ddd\u8a2d\u8a08 \u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3092\u3068\u3053\u3068\u3093\u6975\u3081\u307e\u3059\uff01 | \u3068\u3044\u3046\u3053\u3068\u3067\u4e00\u7dd2\u306b\u6975\u3081\u307e\u3057\u3087\u3046\uff01\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u8ad6\u7406\u8a2d\u8a08\uff08\u696d\u52d9\u5206\u6790\uff09\u304c\u8da3\u5473\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u306e\u30b9\u30da\u30b7\u30e3\u30ea\u30b9\u30c8\u3067\u3059\u3002\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3082\u5f97\u610f\u3067\u3059\u3002\u30b7\u30b9\u30c6\u30e0\u306b\u304a\u3051\u308b\u69d8\u3005\u306a\u554f\u984c\u3092\u89e3\u6c7a\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u308c\u3089\u3092\u5171\u6709\u3067\u304d\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b \u305d\u306e\uff12 | \u682a\u5f0f\u4f1a\u793e \u77f3\u5ddd\u8a2d\u8a08 \u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3092\u3068\u3053\u3068\u3093\u6975\u3081\u307e\u3059\uff01\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.ishikawasekkei.com\/wp-content\/uploads\/2019\/02\/cropped-ishikawasekkei-2.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.ishikawasekkei.com\/wp-content\/uploads\/2019\/02\/cropped-ishikawasekkei-2.png\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-02-06T09:00:05+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-03-10T12:55:46+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b \u305d\u306e\uff12 | \u682a\u5f0f\u4f1a\u793e \u77f3\u5ddd\u8a2d\u8a08 \u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3092\u3068\u3053\u3068\u3093\u6975\u3081\u307e\u3059\uff01\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.ishikawasekkei.com\/wp-content\/uploads\/2019\/02\/cropped-ishikawasekkei-2.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#article\",\"name\":\"Python\\u306716\\u9032\\u6570\\u30c0\\u30f3\\u30d7\\u3059\\u308b\\u30d7\\u30ed\\u30b0\\u30e9\\u30e0\\u3092\\u3064\\u304f\\u308b \\u305d\\u306e\\uff12 | \\u682a\\u5f0f\\u4f1a\\u793e \\u77f3\\u5ddd\\u8a2d\\u8a08 \\u30b7\\u30b9\\u30c6\\u30e0\\u958b\\u767a\\u3092\\u3068\\u3053\\u3068\\u3093\\u6975\\u3081\\u307e\\u3059\\uff01\",\"headline\":\"Python\\u306716\\u9032\\u6570\\u30c0\\u30f3\\u30d7\\u3059\\u308b\\u30d7\\u30ed\\u30b0\\u30e9\\u30e0\\u3092\\u3064\\u304f\\u308b\\u3000\\u305d\\u306e\\uff12\",\"author\":{\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/DSC_0062-scaled.jpg\",\"width\":1280,\"height\":2560,\"caption\":\"DSC_0062\"},\"datePublished\":\"2020-02-06T00:00:05+09:00\",\"dateModified\":\"2020-03-10T03:55:46+09:00\",\"inLanguage\":\"ja\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#webpage\"},\"articleSection\":\"Program, \\u30d6\\u30ed\\u30b0\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.ishikawasekkei.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/category\\\/blog\\\/#listItem\",\"name\":\"\\u30d6\\u30ed\\u30b0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/category\\\/blog\\\/#listItem\",\"position\":2,\"name\":\"\\u30d6\\u30ed\\u30b0\",\"item\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/category\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#listItem\",\"name\":\"Python\\u306716\\u9032\\u6570\\u30c0\\u30f3\\u30d7\\u3059\\u308b\\u30d7\\u30ed\\u30b0\\u30e9\\u30e0\\u3092\\u3064\\u304f\\u308b\\u3000\\u305d\\u306e\\uff12\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#listItem\",\"position\":3,\"name\":\"Python\\u306716\\u9032\\u6570\\u30c0\\u30f3\\u30d7\\u3059\\u308b\\u30d7\\u30ed\\u30b0\\u30e9\\u30e0\\u3092\\u3064\\u304f\\u308b\\u3000\\u305d\\u306e\\uff12\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/category\\\/blog\\\/#listItem\",\"name\":\"\\u30d6\\u30ed\\u30b0\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/#organization\",\"name\":\"\\u682a\\u5f0f\\u4f1a\\u793e \\u77f3\\u5ddd\\u8a2d\\u8a08\",\"description\":\"\\u3068\\u3044\\u3046\\u3053\\u3068\\u3067\\u4e00\\u7dd2\\u306b\\u6975\\u3081\\u307e\\u3057\\u3087\\u3046\\uff01\\u30c7\\u30fc\\u30bf\\u30d9\\u30fc\\u30b9\\u8ad6\\u7406\\u8a2d\\u8a08\\uff08\\u696d\\u52d9\\u5206\\u6790\\uff09\\u304c\\u8da3\\u5473\\u306e\\u3088\\u3046\\u306b\\u306a\\u3063\\u3066\\u3057\\u307e\\u3063\\u305f\\u30b7\\u30b9\\u30c6\\u30e0\\u958b\\u767a\\u306e\\u30b9\\u30da\\u30b7\\u30e3\\u30ea\\u30b9\\u30c8\\u3067\\u3059\\u3002\\u30d1\\u30d5\\u30a9\\u30fc\\u30de\\u30f3\\u30b9\\u30c1\\u30e5\\u30fc\\u30cb\\u30f3\\u30b0\\u3082\\u5f97\\u610f\\u3067\\u3059\\u3002\\u30b7\\u30b9\\u30c6\\u30e0\\u306b\\u304a\\u3051\\u308b\\u69d8\\u3005\\u306a\\u554f\\u984c\\u3092\\u89e3\\u6c7a\\u3057\\u3066\\u3044\\u307e\\u3059\\u306e\\u3067\\u3001\\u305d\\u308c\\u3089\\u3092\\u5171\\u6709\\u3067\\u304d\\u308c\\u3070\\u3068\\u601d\\u3044\\u307e\\u3059\\u3002\",\"url\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/ishikawasekkei.png\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#organizationLogo\",\"width\":1000,\"height\":1000},\"image\":{\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#organizationLogo\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/author\\\/admin\\\/\",\"name\":\"sTone\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2f57b28952073aaca504b61d7b66d58e91b0b7847aabadc207080755d0f507ea?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"sTone\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#webpage\",\"url\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/\",\"name\":\"Python\\u306716\\u9032\\u6570\\u30c0\\u30f3\\u30d7\\u3059\\u308b\\u30d7\\u30ed\\u30b0\\u30e9\\u30e0\\u3092\\u3064\\u304f\\u308b \\u305d\\u306e\\uff12 | \\u682a\\u5f0f\\u4f1a\\u793e \\u77f3\\u5ddd\\u8a2d\\u8a08 \\u30b7\\u30b9\\u30c6\\u30e0\\u958b\\u767a\\u3092\\u3068\\u3053\\u3068\\u3093\\u6975\\u3081\\u307e\\u3059\\uff01\",\"inLanguage\":\"ja\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/author\\\/admin\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/DSC_0062-scaled.jpg\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#mainImage\",\"width\":1280,\"height\":2560,\"caption\":\"DSC_0062\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/index.php\\\/2020\\\/02\\\/06\\\/python-hex-dump-part2\\\/#mainImage\"},\"datePublished\":\"2020-02-06T00:00:05+09:00\",\"dateModified\":\"2020-03-10T03:55:46+09:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/#website\",\"url\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/\",\"name\":\"\\u682a\\u5f0f\\u4f1a\\u793e \\u77f3\\u5ddd\\u8a2d\\u8a08 \\u30b7\\u30b9\\u30c6\\u30e0\\u958b\\u767a\\u3092\\u3068\\u3053\\u3068\\u3093\\u6975\\u3081\\u307e\\u3059\\uff01\",\"description\":\"\\u3068\\u3044\\u3046\\u3053\\u3068\\u3067\\u4e00\\u7dd2\\u306b\\u6975\\u3081\\u307e\\u3057\\u3087\\u3046\\uff01\\u30c7\\u30fc\\u30bf\\u30d9\\u30fc\\u30b9\\u8ad6\\u7406\\u8a2d\\u8a08\\uff08\\u696d\\u52d9\\u5206\\u6790\\uff09\\u304c\\u8da3\\u5473\\u306e\\u3088\\u3046\\u306b\\u306a\\u3063\\u3066\\u3057\\u307e\\u3063\\u305f\\u30b7\\u30b9\\u30c6\\u30e0\\u958b\\u767a\\u306e\\u30b9\\u30da\\u30b7\\u30e3\\u30ea\\u30b9\\u30c8\\u3067\\u3059\\u3002\\u30d1\\u30d5\\u30a9\\u30fc\\u30de\\u30f3\\u30b9\\u30c1\\u30e5\\u30fc\\u30cb\\u30f3\\u30b0\\u3082\\u5f97\\u610f\\u3067\\u3059\\u3002\\u30b7\\u30b9\\u30c6\\u30e0\\u306b\\u304a\\u3051\\u308b\\u69d8\\u3005\\u306a\\u554f\\u984c\\u3092\\u89e3\\u6c7a\\u3057\\u3066\\u3044\\u307e\\u3059\\u306e\\u3067\\u3001\\u305d\\u308c\\u3089\\u3092\\u5171\\u6709\\u3067\\u304d\\u308c\\u3070\\u3068\\u601d\\u3044\\u307e\\u3059\\u3002\",\"inLanguage\":\"ja\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.ishikawasekkei.com\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b \u305d\u306e\uff12 | \u682a\u5f0f\u4f1a\u793e \u77f3\u5ddd\u8a2d\u8a08 \u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3092\u3068\u3053\u3068\u3093\u6975\u3081\u307e\u3059\uff01","description":"","canonical_url":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#article","name":"Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b \u305d\u306e\uff12 | \u682a\u5f0f\u4f1a\u793e \u77f3\u5ddd\u8a2d\u8a08 \u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3092\u3068\u3053\u3068\u3093\u6975\u3081\u307e\u3059\uff01","headline":"Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b\u3000\u305d\u306e\uff12","author":{"@id":"https:\/\/www.ishikawasekkei.com\/index.php\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/www.ishikawasekkei.com\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.ishikawasekkei.com\/wp-content\/uploads\/2020\/02\/DSC_0062-scaled.jpg","width":1280,"height":2560,"caption":"DSC_0062"},"datePublished":"2020-02-06T00:00:05+09:00","dateModified":"2020-03-10T03:55:46+09:00","inLanguage":"ja","mainEntityOfPage":{"@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#webpage"},"isPartOf":{"@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#webpage"},"articleSection":"Program, \u30d6\u30ed\u30b0"},{"@type":"BreadcrumbList","@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.ishikawasekkei.com#listItem","position":1,"name":"Home","item":"https:\/\/www.ishikawasekkei.com","nextItem":{"@type":"ListItem","@id":"https:\/\/www.ishikawasekkei.com\/index.php\/category\/blog\/#listItem","name":"\u30d6\u30ed\u30b0"}},{"@type":"ListItem","@id":"https:\/\/www.ishikawasekkei.com\/index.php\/category\/blog\/#listItem","position":2,"name":"\u30d6\u30ed\u30b0","item":"https:\/\/www.ishikawasekkei.com\/index.php\/category\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#listItem","name":"Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b\u3000\u305d\u306e\uff12"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.ishikawasekkei.com#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#listItem","position":3,"name":"Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b\u3000\u305d\u306e\uff12","previousItem":{"@type":"ListItem","@id":"https:\/\/www.ishikawasekkei.com\/index.php\/category\/blog\/#listItem","name":"\u30d6\u30ed\u30b0"}}]},{"@type":"Organization","@id":"https:\/\/www.ishikawasekkei.com\/#organization","name":"\u682a\u5f0f\u4f1a\u793e \u77f3\u5ddd\u8a2d\u8a08","description":"\u3068\u3044\u3046\u3053\u3068\u3067\u4e00\u7dd2\u306b\u6975\u3081\u307e\u3057\u3087\u3046\uff01\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u8ad6\u7406\u8a2d\u8a08\uff08\u696d\u52d9\u5206\u6790\uff09\u304c\u8da3\u5473\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u306e\u30b9\u30da\u30b7\u30e3\u30ea\u30b9\u30c8\u3067\u3059\u3002\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3082\u5f97\u610f\u3067\u3059\u3002\u30b7\u30b9\u30c6\u30e0\u306b\u304a\u3051\u308b\u69d8\u3005\u306a\u554f\u984c\u3092\u89e3\u6c7a\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u308c\u3089\u3092\u5171\u6709\u3067\u304d\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002","url":"https:\/\/www.ishikawasekkei.com\/","logo":{"@type":"ImageObject","url":"https:\/\/www.ishikawasekkei.com\/wp-content\/uploads\/2019\/02\/ishikawasekkei.png","@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#organizationLogo","width":1000,"height":1000},"image":{"@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#organizationLogo"}},{"@type":"Person","@id":"https:\/\/www.ishikawasekkei.com\/index.php\/author\/admin\/#author","url":"https:\/\/www.ishikawasekkei.com\/index.php\/author\/admin\/","name":"sTone","image":{"@type":"ImageObject","@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/2f57b28952073aaca504b61d7b66d58e91b0b7847aabadc207080755d0f507ea?s=96&d=mm&r=g","width":96,"height":96,"caption":"sTone"}},{"@type":"WebPage","@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#webpage","url":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/","name":"Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b \u305d\u306e\uff12 | \u682a\u5f0f\u4f1a\u793e \u77f3\u5ddd\u8a2d\u8a08 \u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3092\u3068\u3053\u3068\u3093\u6975\u3081\u307e\u3059\uff01","inLanguage":"ja","isPartOf":{"@id":"https:\/\/www.ishikawasekkei.com\/#website"},"breadcrumb":{"@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#breadcrumblist"},"author":{"@id":"https:\/\/www.ishikawasekkei.com\/index.php\/author\/admin\/#author"},"creator":{"@id":"https:\/\/www.ishikawasekkei.com\/index.php\/author\/admin\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/www.ishikawasekkei.com\/wp-content\/uploads\/2020\/02\/DSC_0062-scaled.jpg","@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#mainImage","width":1280,"height":2560,"caption":"DSC_0062"},"primaryImageOfPage":{"@id":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/#mainImage"},"datePublished":"2020-02-06T00:00:05+09:00","dateModified":"2020-03-10T03:55:46+09:00"},{"@type":"WebSite","@id":"https:\/\/www.ishikawasekkei.com\/#website","url":"https:\/\/www.ishikawasekkei.com\/","name":"\u682a\u5f0f\u4f1a\u793e \u77f3\u5ddd\u8a2d\u8a08 \u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3092\u3068\u3053\u3068\u3093\u6975\u3081\u307e\u3059\uff01","description":"\u3068\u3044\u3046\u3053\u3068\u3067\u4e00\u7dd2\u306b\u6975\u3081\u307e\u3057\u3087\u3046\uff01\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u8ad6\u7406\u8a2d\u8a08\uff08\u696d\u52d9\u5206\u6790\uff09\u304c\u8da3\u5473\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u306e\u30b9\u30da\u30b7\u30e3\u30ea\u30b9\u30c8\u3067\u3059\u3002\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3082\u5f97\u610f\u3067\u3059\u3002\u30b7\u30b9\u30c6\u30e0\u306b\u304a\u3051\u308b\u69d8\u3005\u306a\u554f\u984c\u3092\u89e3\u6c7a\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u308c\u3089\u3092\u5171\u6709\u3067\u304d\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002","inLanguage":"ja","publisher":{"@id":"https:\/\/www.ishikawasekkei.com\/#organization"}}]},"og:locale":"ja_JP","og:site_name":"\u682a\u5f0f\u4f1a\u793e \u77f3\u5ddd\u8a2d\u8a08 \u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3092\u3068\u3053\u3068\u3093\u6975\u3081\u307e\u3059\uff01 | \u3068\u3044\u3046\u3053\u3068\u3067\u4e00\u7dd2\u306b\u6975\u3081\u307e\u3057\u3087\u3046\uff01\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u8ad6\u7406\u8a2d\u8a08\uff08\u696d\u52d9\u5206\u6790\uff09\u304c\u8da3\u5473\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u306e\u30b9\u30da\u30b7\u30e3\u30ea\u30b9\u30c8\u3067\u3059\u3002\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3082\u5f97\u610f\u3067\u3059\u3002\u30b7\u30b9\u30c6\u30e0\u306b\u304a\u3051\u308b\u69d8\u3005\u306a\u554f\u984c\u3092\u89e3\u6c7a\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u308c\u3089\u3092\u5171\u6709\u3067\u304d\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002","og:type":"article","og:title":"Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b \u305d\u306e\uff12 | \u682a\u5f0f\u4f1a\u793e \u77f3\u5ddd\u8a2d\u8a08 \u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3092\u3068\u3053\u3068\u3093\u6975\u3081\u307e\u3059\uff01","og:url":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/","og:image":"https:\/\/www.ishikawasekkei.com\/wp-content\/uploads\/2019\/02\/cropped-ishikawasekkei-2.png","og:image:secure_url":"https:\/\/www.ishikawasekkei.com\/wp-content\/uploads\/2019\/02\/cropped-ishikawasekkei-2.png","article:published_time":"2020-02-06T09:00:05+00:00","article:modified_time":"2020-03-10T12:55:46+00:00","twitter:card":"summary","twitter:title":"Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b \u305d\u306e\uff12 | \u682a\u5f0f\u4f1a\u793e \u77f3\u5ddd\u8a2d\u8a08 \u30b7\u30b9\u30c6\u30e0\u958b\u767a\u3092\u3068\u3053\u3068\u3093\u6975\u3081\u307e\u3059\uff01","twitter:image":"https:\/\/www.ishikawasekkei.com\/wp-content\/uploads\/2019\/02\/cropped-ishikawasekkei-2.png"},"aioseo_meta_data":{"post_id":"751","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-21 04:00:35","updated":"2025-07-16 15:14:58","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.ishikawasekkei.com\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.ishikawasekkei.com\/index.php\/category\/blog\/\" title=\"\u30d6\u30ed\u30b0\">\u30d6\u30ed\u30b0<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tPython\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b\u3000\u305d\u306e\uff12\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.ishikawasekkei.com"},{"label":"\u30d6\u30ed\u30b0","link":"https:\/\/www.ishikawasekkei.com\/index.php\/category\/blog\/"},{"label":"Python\u306716\u9032\u6570\u30c0\u30f3\u30d7\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308b\u3000\u305d\u306e\uff12","link":"https:\/\/www.ishikawasekkei.com\/index.php\/2020\/02\/06\/python-hex-dump-part2\/"}],"_links":{"self":[{"href":"https:\/\/www.ishikawasekkei.com\/index.php\/wp-json\/wp\/v2\/posts\/751","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ishikawasekkei.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ishikawasekkei.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ishikawasekkei.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ishikawasekkei.com\/index.php\/wp-json\/wp\/v2\/comments?post=751"}],"version-history":[{"count":6,"href":"https:\/\/www.ishikawasekkei.com\/index.php\/wp-json\/wp\/v2\/posts\/751\/revisions"}],"predecessor-version":[{"id":842,"href":"https:\/\/www.ishikawasekkei.com\/index.php\/wp-json\/wp\/v2\/posts\/751\/revisions\/842"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ishikawasekkei.com\/index.php\/wp-json\/wp\/v2\/media\/761"}],"wp:attachment":[{"href":"https:\/\/www.ishikawasekkei.com\/index.php\/wp-json\/wp\/v2\/media?parent=751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ishikawasekkei.com\/index.php\/wp-json\/wp\/v2\/categories?post=751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ishikawasekkei.com\/index.php\/wp-json\/wp\/v2\/tags?post=751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}