{"id":259408,"date":"2023-03-30T16:01:00","date_gmt":"2023-03-30T07:01:00","guid":{"rendered":"https:\/\/hldc.co.jp\/support\/?post_type=qna&#038;p=259408"},"modified":"2023-03-30T17:57:41","modified_gmt":"2023-03-30T08:57:41","slug":"qna-259408","status":"publish","type":"qna","link":"https:\/\/hldc.co.jp\/support\/qna\/qna-259408\/","title":{"rendered":"ctypes\u3092\u5229\u7528\u3057\u305fC+Python\u6df7\u5408\u74b0\u5883\u3067\u4f7f\u7528\u3059\u308b(Linux)"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; _builder_version=&#8221;4.16&#8243; da_disable_devices=&#8221;off|off|off&#8221; global_colors_info=&#8221;{}&#8221; da_is_popup=&#8221;off&#8221; da_exit_intent=&#8221;off&#8221; da_has_close=&#8221;on&#8221; da_alt_close=&#8221;off&#8221; da_dark_close=&#8221;off&#8221; da_not_modal=&#8221;on&#8221; da_is_singular=&#8221;off&#8221; da_with_loader=&#8221;off&#8221; da_has_shadow=&#8221;on&#8221;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;4.16&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.16&#8243; custom_padding=&#8221;|||&#8221; global_colors_info=&#8221;{}&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;4.18.0&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]<\/p>\n<p>Linux\u74b0\u5883\u4e0b\u3067ctypes\u3092\u5229\u7528\u3057\u305fPython\u30a2\u30d7\u30ea\uff0bC\u30e9\u30a4\u30d6\u30e9\u30ea\u3078\u306eDT\uff0b\u5c0e\u5165\u624b\u9806\u4f8b\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">Contents<\/p><ul class=\"toc_list\"><li><a href=\"#i\"><span class=\"toc_number toc_depth_1\">1<\/span> \u30b5\u30f3\u30d7\u30eb\u30c9\u30e9\u30a4\u30d0<\/a><\/li><li><a href=\"#i-2\"><span class=\"toc_number toc_depth_1\">2<\/span> \u5168\u4f53\u306e\u30a4\u30e1\u30fc\u30b8<\/a><\/li><li><a href=\"#i-3\"><span class=\"toc_number toc_depth_1\">3<\/span> \u69cb\u7bc9\u624b\u9806<\/a><ul><li><a href=\"#DT\"><span class=\"toc_number toc_depth_2\">3.1<\/span> \u2460DT+\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210<\/a><\/li><li><a href=\"#C\"><span class=\"toc_number toc_depth_2\">3.2<\/span> \u2461C\u8a00\u8a9e\u30c9\u30e9\u30a4\u30d0\u306e\u5909\u66f4\u30fb\u30d3\u30eb\u30c9<\/a><\/li><li><a href=\"#DTso\"><span class=\"toc_number toc_depth_2\">3.3<\/span> \u2462DT\u30c9\u30e9\u30a4\u30d0(*so)\u3092\u4ed6\u306e\u5171\u6709\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3001\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u306b\u7d44\u307f\u8fbc\u3080<\/a><\/li><li><a href=\"#DTPythonDT\"><span class=\"toc_number toc_depth_2\">3.4<\/span> \u2463DT+Python\u30c9\u30e9\u30a4\u30d0\u3001DT+\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30ea\u30f3\u30af<\/a><\/li><li><a href=\"#i-4\"><span class=\"toc_number toc_depth_2\">3.5<\/span> \u2464\u30c6\u30b9\u30c8\u5b9f\u884c\u3057\u3001\u30ec\u30dd\u30fc\u30c8\u30c7\u30fc\u30bf\u3092\u53d6\u5f97<\/a><\/li><\/ul><\/li><\/ul><\/div>\n<h2><span id=\"i\">\u30b5\u30f3\u30d7\u30eb\u30c9\u30e9\u30a4\u30d0<\/span><\/h2>\n<p>\u30b5\u30f3\u30d7\u30eb\u30c9\u30e9\u30a4\u30d0\u306f\u4ee5\u4e0b\u3088\u308a\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304f\u3060\u3055\u3044\u3002<\/p>\n<table class=\"left_head head_bg head_normal vline\" style=\"margin-bottom: 3em;\">\n<colgroup>\n<col width=\"50%\"\/>\n<col width=\"50%\"\/>\n<\/colgroup>\n<tbody>\n<tr>\n<th>\u63a5\u7d9a\u65b9\u5f0f<\/th>\n<th>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/th>\n<\/tr>\n<tr>\n<td>Ethermet(\u30c9\u30e9\u30a4\u30d0\u5bfe\u5fdc\u65b9\u5f0f)<\/td>\n<td><a href=\"https:\/\/hldc.co.jp\/support\/wp-content\/uploads\/2023\/03\/259398_dt_ether_drv_36C3.zip\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a><\/td>\n<\/tr>\n<tr>\n<td>\u30d5\u30a1\u30a4\u30eb\u66f8\u304d\u51fa\u3057(\u30c9\u30e9\u30a4\u30d0\u5bfe\u5fdc\u65b9\u5f0f)<\/td>\n<td><a href=\"https:\/\/hldc.co.jp\/support\/wp-content\/uploads\/2023\/03\/259398_dt_datawriting_drv_38C2.zip\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u306a\u304a\u3001c\u90e8\u5206\u306e\u30c9\u30e9\u30a4\u30d0\u306f\u901a\u5e38\u306e\u30b5\u30f3\u30d7\u30eb\u30c9\u30e9\u30a4\u30d0\u3068\u540c\u69d8\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><span id=\"i-2\">\u5168\u4f53\u306e\u30a4\u30e1\u30fc\u30b8<\/span><\/h2>\n<div style=\"text-align: center;\">\n<p><img decoding=\"async\" data-src=\"https:\/\/hldc.co.jp\/support\/wp-content\/uploads\/2023\/03\/259398_1.png\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1254px; --smush-placeholder-aspect-ratio: 1254\/550;\"><\/p>\n<\/div>\n<p>\u4e0a\u8a18\u306fEthernet\u63a5\u7d9a\u306e\u5834\u5408\u306e\u5168\u4f53\u30a4\u30e1\u30fc\u30b8\u56f3\u3067\u3059\u3002Python\u30b3\u30fc\u30c9\u304b\u3089\u306fDTTestPointDriver.py\u3092\u4ecb\u3057\u3066\u3001\u305d\u306e\u4ed6C\uff0fC++\u306e\u51e6\u7406\u306fDT+\u30c9\u30e9\u30a4\u30d0\u3092\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u30d3\u30eb\u30c9\u3057\u3001\u305d\u308c\u3092\u30ea\u30f3\u30af\u3059\u308b\u5f62\u3067\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u66f8\u304d\u51fa\u3057\u306e\u5834\u5408\u306f\u300cdt_datawriting_drv.c\u300d\u300cdt_datawriting_drv.so\u300d\u3068\u3057\u3066Linux\u4e0a\u306b\u30d0\u30a4\u30ca\u30ea\u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u30ec\u30dd\u30fc\u30c8\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><span id=\"i-3\">\u69cb\u7bc9\u624b\u9806<\/span><\/h2>\n<h3><span id=\"DT\">\u2460DT+\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210<\/span><\/h3>\n<p>\u901a\u5e38\u901a\u308a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u306a\u304a\u3001\u30b5\u30f3\u30d7\u30eb\u30c9\u30e9\u30a4\u30d0\u306f\u3044\u305a\u308c\u3082\u30c9\u30e9\u30a4\u30d0\u5bfe\u5fdc\u3068\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<div style=\"text-align: center;\">\n<p><img decoding=\"async\" data-src=\"https:\/\/hldc.co.jp\/support\/wp-content\/uploads\/2023\/03\/259398_2.png\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 797px; --smush-placeholder-aspect-ratio: 797\/718;\" \/><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>C\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30bd\u30fc\u30b9\u3068Python\u30bd\u30fc\u30b9\u306e\u4e21\u65b9\u3092DT+\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<div style=\"text-align: center;\">\n<p><img decoding=\"async\" data-src=\"https:\/\/hldc.co.jp\/support\/wp-content\/uploads\/2023\/03\/259398_3.png\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 856px; --smush-placeholder-aspect-ratio: 856\/772;\" \/><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><span id=\"C\">\u2461C\u8a00\u8a9e\u30c9\u30e9\u30a4\u30d0\u306e\u5909\u66f4\u30fb\u30d3\u30eb\u30c9<\/span><\/h3>\n<p>C\u8a00\u8a9e\u30c9\u30e9\u30a4\u30d0\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u70b9\u306f\u901a\u5e38\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3068\u540c\u69d8\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u30da\u30fc\u30b8\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a href='https:\/\/hldc.co.jp\/support\/by-product\/dtplus-trace\/tutorial\/ethernet_config\/'>Ethernet\u63a5\u7d9a\u306e\u5834\u5408<\/a><\/p>\n<p><a href='https:\/\/hldc.co.jp\/support\/by-product\/dtplus-trace\/tutorial\/datawriting_config\/'>\u30d5\u30a1\u30a4\u30eb\u66f8\u304d\u51fa\u3057\u63a5\u7d9a\u306e\u5834\u5408<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u4fee\u6b63\u5f8c\u3001C\u8a00\u8a9e\u30c9\u30e9\u30a4\u30d0\u3092<strong>\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea<\/strong>\u3068\u3057\u3066\u30d3\u30eb\u30c9\u3057\u307e\u3059\u3002<\/p>\n<p>&quot;xxx&quot;\u306f&quot;datawriting&quot;\u307e\u305f\u306f&quot;ether&quot;\u306b\u306a\u308a\u307e\u3059\u3002\u9069\u6642\u8aad\u307f\u66ff\u3048\u3066\u3054\u5229\u7528\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code>$cd ~\/root\/src\/lib\/dtxlib\n$ls\n$DtTestPointDriver.py  dt_xxx_drv.c\n$gcc -fPIC --shared dt_xxx_drv.c -o libdt_lib.so\n\u307e\u305f\u306f\n$g++ -fPIC --shared dt_xxx_drv.cpp -o libdt_lib.so\n$ls\n$DtTestPointDriver.py  dt_xxx_drv.c  libdt_lib.so\n<\/code><\/pre>\n<p>\u751f\u6210\u3059\u308b\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u540d\u306f\u4efb\u610f\u306e\u540d\u524d\u3067\u69cb\u3044\u307e\u305b\u3093\u3002\u305f\u3060\u3057\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u547d\u540d\u898f\u5247\u306b\u5f93\u3044\u30d5\u30a1\u30a4\u30eb\u540d\u5148\u982d\u306f&quot;lib&quot;\u3001\u62e1\u5f35\u5b50\u3092&quot;*.so&quot;\u3068\u306a\u308b\u3088\u3046\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3><span id=\"DTso\">\u2462DT\u30c9\u30e9\u30a4\u30d0(*so)\u3092\u4ed6\u306e\u5171\u6709\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3001\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u306b\u7d44\u307f\u8fbc\u3080<\/span><\/h3>\n<p>\u4ed6\u306eC\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u7d44\u307f\u8fbc\u3080\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002\u4f8b\u3067\u306fctypes_sample\u304cpython\u3067\u4f7f\u7528\u3055\u308c\u308bC\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u60f3\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Makefile\u7b49\u306b\u4ee5\u4e0b\u306e\u51e6\u7406\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3000\u2460DT+\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea(libdt_lib.so)\u3092\u4ed6\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u30d5\u30a9\u30eb\u30c0\u3001\u307e\u305f\u306f\u30d3\u30eb\u30c9\u5bfe\u8c61\u30d5\u30a9\u30eb\u30c0\u76f4\u4e0b\u306b\u30b3\u30d4\u30fc<\/p>\n<p>\u3000\u2461gcc\u30b3\u30de\u30f3\u30c9\u307e\u305f\u306fMakefile\u7b49\u306bDT+\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30ea\u30f3\u30af\u3092\u8ffd\u52a0<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u4e0b\u306f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u64cd\u4f5c\u3067\u306egcc\u30b3\u30de\u30f3\u30c9\u304b\u3089\u306e\u30d3\u30eb\u30c9\u306e\u4f8b\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<pre><code>$cp .libdt_lib.so ~\/yourlibpath\/ctypes_sample\n$cd ~\/yourlibpath\/ctypes_sample\n$ls\n$DT_ctypes_sample.h  ctypes_sample.c  ctypes_sample.h  libdt_lib.so\n$gcc -fPIC --shared ctypes_sample.c -o libctypes_sample.so -ldt_lib -L.\/\n$ls\n$DT_ctypes_sample.h  ctypes_sample.c  ctypes_sample.h  libctypes_sample.so  libdt_lib.so\n<\/code><\/pre>\n<p>&quot;-l&quot;\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u30ea\u30f3\u30af\u3059\u308b\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u3001&quot;-L&quot;\u304c\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30d1\u30b9\u306e\u6307\u5b9a\u3068\u306a\u308a\u307e\u3059\u3002&quot;-l&quot;\u3067\u6307\u5b9a\u3059\u308b\u969b\u3001\u63a5\u982d\u8a9e\u306e&quot;lib&quot;\u3001\u62e1\u5f35\u5b50\u306f\u9664\u3044\u305f\u5f62\u3067\u306e\u6307\u5b9a\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>Makefile\u306b\u8ffd\u52a0\u3059\u308b\u5834\u5408\u306f\u4e00\u822c\u7684\u306aMakefile\u3067\u3042\u308c\u3070&quot;LDFLAGS&quot;\u3001&quot;LIBS&quot;\u306a\u3069\u306b\u8ffd\u8a18\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>CMake\u306b\u8ffd\u52a0\u3059\u308b\u5834\u5408\u306f\u5bfe\u8c61\u306etarget_link_libraries\u306bDT+\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8ffd\u8a18\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><span id=\"DTPythonDT\">\u2463DT+Python\u30c9\u30e9\u30a4\u30d0\u3001DT+\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30ea\u30f3\u30af<\/span><\/h3>\n<p>Python\u30a2\u30d7\u30ea\u306bDtTestPointDriver.py\u3092\u7d44\u307f\u8fbc\u307f\u307e\u3059\u3002\u3053\u306e\u969b\u3001DtTestPointDriver.py\u4e26\u3073\u306bDT+\u3092\u9069\u7528\u3057\u305f\u72ec\u81ea\u306e\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u304b\u3089DT+\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u53c2\u7167\u3067\u304d\u308b\u3088\u3046\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>Python\u306ecdll.LoadLibrary\u306b\u76f4\u63a5\u30d1\u30b9\u3092\u6307\u5b9a\u3059\u308b<\/h4>\n<p>Python\u30a2\u30d7\u30ea\u3078\u306e\u9069\u7528\u306b\u3064\u3044\u3066\u306fctypes\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u3001\u76f4\u63a5\u30d1\u30b9\u306e\u6307\u5b9a\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre><code class='language-python' lang='python'>import struct\nimport ctypes\n\nDtTestPoint_DriverLib = ctypes.cdll.LoadLibrary(&quot;.\/libdt_lib.so&quot;) # Customize its \n<\/code><\/pre>\n<p>python\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u76f4\u63a5DT+\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u53c2\u7167\u3059\u308b\u5834\u5408\u306f\u3001DtTestPointDriver.py\u306e\u4e0a\u8a18\u306e\u53c2\u7167\u30d1\u30b9\u3092\u76f4\u63a5\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u53ef\u5909\u306b\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6307\u5b9a\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre><code class='language-python' lang='python'>import os\n\npath = os.path.dirname(os.path.realpath(__file__))\nDtTestPoint_DriverLib = DtTestPoint_DriverLib(&quot;%slibdt_lib.so&quot; % path)\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h4>\u74b0\u5883\u5909\u6570\u306b\u8ffd\u52a0\u3057\u3066\u5b9f\u884c\u3059\u308b<\/h4>\n<p>\u81ea\u4f5c\u306e\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u7d44\u307f\u8fbc\u3080\u5834\u5408\u3001\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u9593\u306e\u30ea\u30f3\u30af\u306f\u4fdd\u8a3c\u3055\u308c\u306a\u3044\u305f\u3081DT+\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u53c2\u7167\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002\u74b0\u5883\u5909\u6570\u306bDT+\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8ffd\u52a0\u3057\u3066\u3054\u5229\u7528\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code>$cp .*.so ~\/yourpython\n$cd ~\/yourPython\n$ls\n$libctypes_sample.so  libdt_lib.so  main.py  testlib src\n$LD_LIBRARY_PATH=. python3 main.py\n<\/code><\/pre>\n<p>\u307e\u305f\u306f<\/p>\n<pre><code>$ls\n$libctypes_sample.so  libdt_lib.so  main.py  testlib src\n$export LD_LIBRARY_PATH=\/home\/foo\/dt_libPath\/\n$python3 main.py\n<\/code><\/pre>\n<p>\u306a\u304a\u3001\u74b0\u5883\u5909\u6570\u3092\u5e38\u306b\u8a2d\u5b9a\u3057\u3066\u304a\u304f\u5834\u5408\u306f~.\/bash_profile\u3084~\/.bashrc\u306bLD_LIBRARY_PATH\u3068\u3057\u3066\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u306e\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u53c2\u7167\u30d1\u30b9\u306b\u8ffd\u52a0\u3059\u308b<\/h4>\n<p>\u74b0\u5883\u5909\u6570\u3067\u306f\u306a\u304f\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u306b\u5bfe\u3057\u3066\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u8ffd\u52a0\u3092\u9069\u5fdc\u3059\u308b\u5834\u5408\u306f\u3001\/etc\/ld.so.conf\u306bDT+\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30d1\u30b9\u3092\u8ffd\u8a18\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code>$sudo vi \/etc\/ld.so.conf\n\/usr\/local\/lib\n\/usr\/lib\n\u2026\n\/home\/foo\/dt_libPath\/ \u2190\u8ffd\u8a18\n:wq\n\n$sudo ldconfig\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h3><span id=\"i-4\">\u2464\u30c6\u30b9\u30c8\u5b9f\u884c\u3057\u3001\u30ec\u30dd\u30fc\u30c8\u30c7\u30fc\u30bf\u3092\u53d6\u5f97<\/span><\/h3>\n<div style=\"text-align: center;\">\n<p><img decoding=\"async\" data-src=\"https:\/\/hldc.co.jp\/support\/wp-content\/uploads\/2023\/03\/259398_4.png\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 2659px; --smush-placeholder-aspect-ratio: 2659\/1851;\"><\/p>\n<\/div>\n<p>Python\u30a2\u30d7\u30ea\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002Ethernet\u63a5\u7d9a\u3084\u30d5\u30a1\u30a4\u30eb\u66f8\u304d\u51fa\u3057\u63a5\u7d9a\u306e\u8a2d\u5b9a\u8a73\u7d30\u306f\u672cQA\u3067\u306f\u5272\u611b\u3057\u307e\u3059\u3002\u4e0a\u8a18\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u53d6\u5f97\u3057\u305f\u30c6\u30b9\u30c8\u30ec\u30dd\u30fc\u30c8\u4e0a\u3067python\u3068C\u306e\u30ec\u30dd\u30fc\u30c8\u51fa\u529b\u304c\u78ba\u8a8d\u3067\u304d\u308c\u3070\u5b8c\u4e86\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u74b0\u5883\u4e0b\u3067ctypes\u3092\u5229\u7528\u3057\u305fPython\u30a2\u30d7\u30ea\uff0bC\u30e9\u30a4\u30d6\u30e9\u30ea\u3078\u306eDT\uff0b\u5c0e\u5165\u624b\u9806\u4f8b\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 &nbsp; \u30b5\u30f3\u30d7\u30eb\u30c9\u30e9\u30a4\u30d0 \u30b5\u30f3\u30d7\u30eb\u30c9\u30e9\u30a4\u30d0\u306f\u4ee5\u4e0b\u3088\u308a\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304f\u3060\u3055\u3044\u3002 \u63a5\u7d9a\u65b9\u5f0f \u30c0\u30a6\u30f3\u30ed\u30fc\u30c9&#8230;<\/p>\n","protected":false},"author":11,"featured_media":0,"menu_order":1,"comment_status":"open","ping_status":"open","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","inline_featured_image":false,"footnotes":"","_links_to":"","_links_to_target":""},"qna_category":[33],"qna_tag":[48,46],"class_list":["post-259408","qna","type-qna","status-publish","hentry","qna_category-how-to","qna_tag-48","qna_tag-46"],"acf":[],"_links":{"self":[{"href":"https:\/\/hldc.co.jp\/support\/wp-json\/wp\/v2\/qna\/259408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hldc.co.jp\/support\/wp-json\/wp\/v2\/qna"}],"about":[{"href":"https:\/\/hldc.co.jp\/support\/wp-json\/wp\/v2\/types\/qna"}],"author":[{"embeddable":true,"href":"https:\/\/hldc.co.jp\/support\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/hldc.co.jp\/support\/wp-json\/wp\/v2\/comments?post=259408"}],"version-history":[{"count":9,"href":"https:\/\/hldc.co.jp\/support\/wp-json\/wp\/v2\/qna\/259408\/revisions"}],"predecessor-version":[{"id":259426,"href":"https:\/\/hldc.co.jp\/support\/wp-json\/wp\/v2\/qna\/259408\/revisions\/259426"}],"wp:attachment":[{"href":"https:\/\/hldc.co.jp\/support\/wp-json\/wp\/v2\/media?parent=259408"}],"wp:term":[{"taxonomy":"qna_category","embeddable":true,"href":"https:\/\/hldc.co.jp\/support\/wp-json\/wp\/v2\/qna_category?post=259408"},{"taxonomy":"qna_tag","embeddable":true,"href":"https:\/\/hldc.co.jp\/support\/wp-json\/wp\/v2\/qna_tag?post=259408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}