{"id":330977,"date":"2022-03-23T15:00:07","date_gmt":"2022-03-23T15:00:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=330977"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=330977","title":{"rendered":"<span>C \u0438\u0437 Python (ctypes) \u043d\u0430 Android<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" alt=\"main\" width=\"500\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/yj\/-c\/sm\/yj-csmwltho22f1-38_w8exbryu.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/yj\/-c\/sm\/yj-csmwltho22f1-38_w8exbryu.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u043f\u0438\u0441\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/habr.com\/ru\/post\/466499\/\">C\/C++ \u0438\u0437 Python (ctypes)<\/a>, \u0432 \u043d\u0435\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 <strong>Linux<\/strong> \u043f\u043e\u0434 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439 <strong>x86_64<\/strong>. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0430 <strong>Android<\/strong> \u043f\u043e\u0434 <strong>armeabi-v7a<\/strong>.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u041a\u043e\u0434 \u043d\u0430 <strong>C<\/strong> \u043d\u0438 \u043a\u0430\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u0440\u043f\u0435\u043b. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430. \u0421 \u043a\u043e\u0434\u043e\u043c \u043d\u0430 <strong>C++<\/strong> \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">I\/python  (13637):  OSError: dlopen failed: empty\/missing DT_HASH in \"libstdc++.so.6\" (built with --hash-style=gnu?)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0438\u0436\u0435. \u0415\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c <strong>libstdc++.so.6<\/strong> \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c <strong>arm-linux-gnueabi-gcc<\/strong> \u0441 \u043a\u043b\u044e\u0447\u043e\u043c <strong>-Wl,-hash-style=sysv<\/strong>. \u0418 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c.<\/p>\n<p>  <\/p>\n<h2 id=\"c\">C<\/h2>\n<p>  <\/p>\n<p>test.c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#include \"test.h\"  int a = 5; double b = 5.12345; char c = 'X';  int  func_ret_int(int val) {      return val; }   double  func_ret_double(double val) {      return val; }   char * func_ret_str(char *val) {      return val; }   char func_many_args(int val1, double val2, char val3, short val4) {      return val3; }   test_st_t * func_ret_struct(test_st_t *test_st) {              return test_st; }  <\/code><\/pre>\n<p>  <\/p>\n<p>test.h:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">#ifndef _TEST_H_ #define _TEST_H_  #ifdef  __cplusplus extern \"C\" { #endif  typedef struct test_st_s test_st_t;  extern int a; extern double b; extern char c;  int func_ret_int(int val); double func_ret_double(double val); char *func_ret_str(char *val); char func_many_args(int val1, double val2, char val3, short val4); test_st_t *func_ret_struct(test_st_t *test_st);  struct test_st_s {     int val1;     double val2;     char val3; };  #ifdef  __cplusplus } #endif  #endif  \/* _TEST_H_ *\/<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u0435\u0442\u0435\u0440\u043f\u0435\u043b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f <strong>arm-linux-gnueabi-gcc<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c :<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">arm-linux-gnueabi-gcc -c -Wl,-hash-style=sysv -g -O2 -march=armv7-a -fPIC -I.\/src\/c  -o .\/objs\/test.o .\/src\/c\/test.c arm-linux-gnueabi-gcc -Wl,-hash-style=sysv -g -O2 -march=armv7-a -shared -o .\/objs\/libtest.so .\/objs\/test.o<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u043b\u0430\u0433 <strong>-march=armv7-a<\/strong> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u041d\u043e \u043e\u0441\u043e\u0431\u0443\u044e \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0434\u0432\u0430 \u0444\u043b\u0430\u0433\u0430 <strong>-Wl, -hash-style=sysv<\/strong>, \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0441 \u0444\u043b\u0430\u0433\u043e\u043c <strong>-hash-style=gnu<\/strong>. \u041d\u043e \u0442\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 hash \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f android:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">I\/python  (13157): dlopen failed: empty\/missing DT_HASH in \"libtest.so\" (built with --hash-style=gnu?)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u0435\u0437 <strong>Wl<\/strong> \u0442\u043e\u0436\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0442.\u043a. \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0449\u0438\u043a \u0441\u043e\u0431\u0435\u0440\u0435\u0442 \u0432\u0441\u0435 \u0441 -hash-style=gnu. \u041f\u0438\u0448\u0443\u0442, \u0447\u0442\u043e \u0435\u0449\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 <strong>hash-style=both<\/strong>, \u043d\u043e \u044f \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b. \u041d\u0430 \u044d\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043d\u0430 C \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a <strong>python<\/strong>-\u0443.<\/p>\n<p>  <\/p>\n<h2 id=\"python\">Python<\/h2>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a <strong>Kivy<\/strong> \u0438 <strong>buildozer<\/strong> \u2014 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f apk \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b \u043f\u043e \u0441\u0442\u0430\u0442\u044c\u0435: <a href=\"https:\/\/habr.com\/ru\/post\/479236\/\">Kivy. \u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043f\u043e\u0434 Android \u0438 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043c\u0430\u0433\u0438\u0438<\/a><\/p>\n<p>  <\/p>\n<h3 id=\"ustanovka-kivy--buildozer\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 kivy &amp; buildozer<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">sudo pip3 install kivy git clone https:\/\/github.com\/kivy\/buildozer.git cd buildozer sudo python3 setup.py install<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 kivy \u0438 buildozer \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \u043f\u043e\u0434 \u043d\u0435\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">mkdir android_python cd android_python<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <strong>main.py<\/strong>, \u044d\u0442\u043e \u0442\u043e\u0447\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">touch main.py<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u0435\u0433\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/python3 #-*- coding: utf-8 -*-  import os import sys import ctypes  import kivy kivy.require(\"1.9.1\") from kivy.app import App from kivy.uix.button import Button  # class in which we are creating the button class ButtonApp(App):      def build(self):         # use a (r, g, b, a) tuple         btn = Button(text =\"Push Me !\",                    font_size =\"20sp\",                    background_color = (1, 1, 1, 1),                    color = (1, 1, 1, 1),                    size_hint = (.2, .1),                    pos_hint = {'x':.4, 'y':.45})          # bind() use to bind the button to function callback         btn.bind(on_press = self.callback)         return btn      # callback function tells when button pressed     def callback(self, event):         exit(0)  ## #  \u0421\u0442\u0430\u0440\u0442. ## if __name__ == \"__main__\":      test = None     # \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438     try :         test = ctypes.CDLL('.\/lib\/libtest\/libtest.so')     except OSError as e:         print(str(e))         exit(0)      ###     ## C     ###      print(\"ctypes\\n\")     print(\"C\\n\")      ##     # \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438     ##      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 int     test.func_ret_int.restype = ctypes.c_int     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 int     test.func_ret_int.argtypes = [ctypes.c_int, ]      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 double     test.func_ret_double.restype = ctypes.c_double     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 double     test.func_ret_double.argtypes = [ctypes.c_double]      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 char *     test.func_ret_str.restype = ctypes.c_char_p     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 char *     test.func_ret_str.argtypes = [ctypes.POINTER(ctypes.c_char), ]      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 char     test.func_many_args.restype = ctypes.c_char     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b int, double. char, short     test.func_many_args.argtypes = [ctypes.c_int, ctypes.c_double, ctypes.c_char, ctypes.c_short]      print('\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438:')     print('ret func_ret_int: ', test.func_ret_int(101))     print('ret func_ret_double: ', test.func_ret_double(12.123456789))     # \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0431\u0430\u0439\u0442\u043e\u0432, \u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442\u043e\u0432 \u043a \u0441\u0442\u0440\u043e\u043a\u0435.     print('ret func_ret_str: ', test.func_ret_str('Hello!'.encode('utf-8')).decode(\"utf-8\"))     print('ret func_many_args: ', test.func_many_args(15, 18.1617, 'X'.encode('utf-8'), 32000).decode(\"utf-8\"))      ##     # \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438     ##      print('\\n\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438:')     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0442\u0438\u043f\u0430 int     a = ctypes.c_int.in_dll(test, \"a\")     print('ret a: ', a.value)      # \u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.     a.value = 22     a = ctypes.c_int.in_dll(test, \"a\")     print('new a: ', a.value)      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0442\u0438\u043f\u0430 double     b = ctypes.c_double.in_dll(test, \"b\")     print('ret b: ', b.value)      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0442\u0438\u043f\u0430 char     c = ctypes.c_char.in_dll(test, \"c\")     print('ret c: ', c.value.decode(\"utf-8\"))      ##     # \u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438     ##      print('\\n\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438:')      # \u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0432 Python \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0432 C     class test_st_t(ctypes.Structure):         _fields_ = [('val1', ctypes.c_int),                     ('val2', ctypes.c_double),                     ('val3', ctypes.c_char)]      # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 test_st_t *     test.func_ret_struct.restype = ctypes.POINTER(test_st_t)     # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 void *     test.func_ret_struct.argtypes = [ctypes.c_void_p]      # \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443     test_st = test_st_t(19, 3.5, 'Z'.encode('utf-8'))      # Python None == Null C     # ret = test.func_ret_struct(None)     # print('ret func_ret_struct: ', ret) # \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 None, \u0442\u043e \u0435\u0433\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u0430\u0437\u0430\u0434     ret = test.func_ret_struct(ctypes.byref(test_st))      # \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 C     print('ret val1 = {}\\nret val2 = {}\\nret val3 = {}'.format(ret.contents.val1, ret.contents.val2,                                                                ret.contents.val3.decode(\"utf-8\")))      ButtonApp().run()<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c C \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0435.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0444\u0430\u0439\u043b \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 buildozer, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 <strong>apk<\/strong>. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0433\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">touch buildozer.spec<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[app]  # (str) Title of your application title = KivyTest  # (str) Package name package.name = kivy_test  # (str) Package domain (needed for android\/ios packaging) package.domain = com.heattheatr  # (str) Source code where the main.py live source.dir = .  # (list) Source files to include (let empty to include all the files) source.include_exts = py,png,jpg,jpeg,ttf,so,6  # (list) Application version version = 0.0.1  # (list) Application requirements # comma separated e.g. requirements = sqlite3,kivy requirements = python3, kivy==2.0.0  # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes # requirements.source.kivy = ..\/..\/kivy #requirements.source.libtest = lib\/libtest  # (str) Supported orientation (one of landscape, sensorLandscape, portrait or all) orientation = portrait  # (bool) Indicate if the application should be fullscreen or not fullscreen = 1  # (list) Permissions android.permissions = INTERNET,WRITE_EXTERNAL_STORAGE  # (int) Target Android API, should be as high as possible. android.api = 28  # (int) Minimum API your APK will support. android.minapi = 21  # (str) Android NDK version to use android.ndk = 19c  # (bool) If True, then skip trying to update the Android sdk # This can be useful to avoid excess Internet downloads or save time # when an update is due and you just want to test\/build your package android.skip_update = False  # (bool) If True, then automatically accept SDK license # agreements. This is intended for automation only. If set to False, # the default, you will be shown the license when first running # buildozer. android.accept_sdk_license = True  # (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64 android.arch = armeabi-v7a  # (list) Android additionnal libraries to copy into libs\/armeabi android.add_libs_armeabi_v7a = \/home\/djvu\/workspace\/c_from_python\/ctypes\/src\/python\/android\/lib\/libtest\/*.*  [buildozer]  # (int) Log level (0 = error only, 1 = info, 2 = debug (with command output)) log_level = 2  # (int) Display warning if buildozer is run as root (0 = False, 1 = True) warn_on_root = 0  # (str) Path to build artifact storage, absolute or relative to spec file build_dir = .\/.buildozer  # (str) Path to build output (i.e. .apk, .ipa) storage bin_dir = .\/bin<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u044b\u0434\u0435\u043b\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li><strong>source.include_exts<\/strong> \u2014 \u0444\u0430\u0439\u043b\u044b \u0441 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u043f\u0440\u043e\u0435\u043a\u0442.<\/li>\n<li><strong>requirements<\/strong> \u2014 \u0441\u043f\u0438\u0441\u043e\u043a python \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043a\u0430\u0447\u0435\u043d\u044b \u0447\u0435\u0440\u0435\u0437 pip \u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u043f\u0440\u043e\u0435\u043a\u0442.<\/li>\n<li><strong>android.arch<\/strong> \u2014 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0431\u043e\u0440\u043a\u0430<\/li>\n<li><strong>android.add_libs_armeabi_v7a<\/strong> \u2014 \u043f\u0430\u043f\u043a\u0430 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u043f\u0440\u043e\u0435\u043a\u0442. \u041f\u043e\u0434 \u043a\u0430\u0436\u0434\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0441\u0432\u043e\u0439 \u043a\u043b\u044e\u0447:<br \/> \n<ul>\n<li>android.add_libs_armeabi = libs\/android\/*.so<\/li>\n<li>android.add_libs_armeabi_v7a = libs\/android-v7\/*.so<\/li>\n<li>android.add_libs_arm64_v8a = libs\/android-v8\/*.so<\/li>\n<li>android.add_libs_x86 = libs\/android-x86\/*.so<\/li>\n<li>android.add_libs_mips = libs\/android-mips\/*.so<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u043f\u0440\u043e\u0441 \u043a <strong>\u0437\u043d\u0430\u044e\u0449\u0438\u043c \u043b\u044e\u0434\u044f\u043c<\/strong>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>android.add_libs_armeabi_v7a = \/home\/djvu\/workspace\/c_from_python\/ctypes\/src\/python\/android\/lib\/libtest<em>.<\/em><\/strong> \u044f \u043d\u0438 \u043a\u0430\u043a \u043d\u0435 \u0441\u043c\u043e\u0433 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 apk \u043f\u0430\u043a\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>libstdc++.so.6<\/strong>. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438 <strong>so<\/strong>. \u041f\u043e\u0434\u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c?<\/p>\n<p>  <\/p>\n<p>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 <strong>lib\/libtest\/<\/strong> \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e <strong>C<\/strong> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>libtest.so<\/strong>.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0431\u0435\u0440\u0435\u043c apk \u043f\u0430\u043a\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">buildozer android debug<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u0430\u044f \u0438 \u0440\u0430\u0441\u0442\u044f\u043d\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u043c\u0438\u043d\u0443\u0442. \u0422\u0430\u043a \u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0440\u044f\u0434\u043a\u0430 <strong>1.5 GB<\/strong> \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430, \u0442.\u043a. buildozer \u043f\u043e\u0434\u0442\u044f\u043d\u0435\u0442 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>bin<\/strong> \u0441\u043e\u0431\u0435\u0440\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442 <strong>kivy_test-0.0.1-armeabi-v7a-debug.apk<\/strong>.<\/p>\n<p>  <\/p>\n<h2 id=\"telefon\">\u0422\u0435\u043b\u0435\u0444\u043e\u043d<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043f\u043e <strong>USB<\/strong> \u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 <strong>USB<\/strong>.<br \/>  \u041c\u043e\u0436\u043d\u043e \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0447\u0435\u0440\u0435\u0437 <strong>telegram<\/strong> (\u0442\u0430\u043a \u0434\u0435\u043b\u0430\u043b \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u0441\u043e \u0441\u043b\u043e\u043c\u0430\u043d\u043d\u044b\u043c USB).<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" alt=\"main\" width=\"300\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/53\/dg\/bj\/53dgbjcchbcypis05uzqdyi7n58.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/53\/dg\/bj\/53dgbjcchbcypis05uzqdyi7n58.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0432\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">adb install -r .\/bin\/kivy_test-0.0.1-armeabi-v7a-debug.apk<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f \u0447\u0442\u043e \u043f\u0430\u043a\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u0438 \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">adb shell run-as com.heattheatr.kivy_test ls files\/app\/lib\/libtest<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/xh\/hn\/yr\/xhhnyrwgqaiqtjz_wmayytjs1u8.png\" data-src=\"https:\/\/habrastorage.org\/webt\/xh\/hn\/yr\/xhhnyrwgqaiqtjz_wmayytjs1u8.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435:<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" alt=\"main\" width=\"300\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/rw\/9v\/wm\/rw9vwmh-reotpkzhj9yjsw1hkpi.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/rw\/9v\/wm\/rw9vwmh-reotpkzhj9yjsw1hkpi.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">adb logcat | grep python<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u2014 <strong>C<\/strong> \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">I\/python  (23580): C I\/python  (23580): \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438: I\/python  (23580): ret func_ret_int:  101 I\/python  (23580): ret func_ret_double:  12.123456789 I\/python  (23580): ret func_ret_str:  Hello! I\/python  (23580): ret func_many_args:  X I\/python  (23580): \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438: I\/python  (23580): ret a:  5 I\/python  (23580): new a:  22 I\/python  (23580): ret b:  5.12345 I\/python  (23580): ret c:  X I\/python  (23580): \u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438: I\/python  (23580): ret val1 = 19 I\/python  (23580): ret val2 = 3.5 I\/python  (23580): ret val3 = Z<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430 \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443:<\/p>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" alt=\"main\" width=\"300\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/dv\/xg\/qj\/dvxgqjdrunzpibh8ormbrhbe6l4.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/dv\/xg\/qj\/dvxgqjdrunzpibh8ormbrhbe6l4.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043a\u0430\u043a \u043d\u0430\u0434\u043e. \u0416\u043c\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0411\u043e\u043b\u044c\u0448\u0435 \u043e\u043d\u043e \u043d\u0438 \u0447\u0435\u0433\u043e \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \ud83d\ude09<\/p>\n<p>  <\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"ssylki\">\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/dvjdjvu\/c_from_python\" rel=\"nofollow noopener noreferrer\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/a><\/li>\n<li>C\/C++ \u0438\u0437 Python <a href=\"https:\/\/habr.com\/ru\/post\/466499\/\"><strong>ctypes<\/strong><\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/656453\/\"> https:\/\/habr.com\/ru\/post\/656453\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<div style=\"text-align:center;\"><img decoding=\"async\" alt=\"main\" width=\"500\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/yj\/-c\/sm\/yj-csmwltho22f1-38_w8exbryu.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/yj\/-c\/sm\/yj-csmwltho22f1-38_w8exbryu.jpeg\" data-blurred=\"true\"\/><\/div>\n<p>  <\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u043f\u0438\u0441\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/habr.com\/ru\/post\/466499\/\">C\/C++ \u0438\u0437 Python (ctypes)<\/a>, \u0432 \u043d\u0435\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430 <strong>Linux<\/strong> \u043f\u043e\u0434 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439 <strong>x86_64<\/strong>. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0430 <strong>Android<\/strong> \u043f\u043e\u0434 <strong>armeabi-v7a<\/strong>.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-330977","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330977","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=330977"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330977\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}