{"id":355707,"date":"2024-05-20T23:14:24","date_gmt":"2024-05-20T23:14:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=355707"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=355707","title":{"rendered":"<span>\u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c \u043d\u0430\u043a\u0440\u044b\u043b\u0441\u044f)), \u0431\u043e\u0442 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0414\u0435\u043b\u0430\u044e GUI-\u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442.<br \/>\u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u0432\u044b\u043b\u043e\u0436\u0438\u043b<a href=\"https:\/\/habr.com\/ru\/articles\/720130\/\" rel=\"noopener noreferrer nofollow\"> \u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u043f\u0440\u043e \u0431\u043e\u0442\u0430.<\/p>\n<p>\u0418 \u0432\u043e\u0442 \u0442\u0443\u0442 \u043c\u0435\u043d\u044f \u0437\u0430\u0446\u0435\u043f\u0438\u043b) \u043e\u0434\u0438\u043d <a href=\"https:\/\/habr.com\/ru\/articles\/720130\/#comment_25286804\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439<\/a>.<\/p>\n<p>\u0423\u0436\u0435 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u0442\u0430 \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u043a\u0440\u0443\u0442\u0438\u043b\u0430\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u043e\u0433\u043e GUI-\u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044f).<br \/> \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044f \u0442\u0430\u043c \u043d\u0435 \u0443\u0432\u0438\u0434\u0435\u043b. \u041d\u043e \u0448\u043e-\u0442\u043e \u043d\u0430\u0440\u043e\u0434 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u043e. \u041d\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u0448\u044c &#8212; \u043d\u0435 \u0443\u0437\u043d\u0430\u0435\u0448\u044c), \u0430 \u0442\u0443\u0442 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u043a\u0440\u043e\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041f\u043e\u0433\u043d\u0430\u043b\u0438)<\/p>\n<p>\u041a\u0430\u0447\u0430\u044e Delphi 11CE (\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f, \u043f\u0438\u0441\u044c\u043c\u0430 \u0441 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u0438 \u043d\u0430 \u044f\u043d\u0434\u0435\u043a\u0441-\u043f\u043e\u0447\u0442\u0443), \u0441\u0442\u0430\u0432\u043b\u044e Python4Delphi &#8212; \u0443\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u042f\u041f \u0438 Delphi4PythonExporter &#8212; \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c GUI \u043d\u0430 Delphi \u0432 Python (\u043d\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0441\u044f).<\/p>\n<p>\u041c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/87e\/787\/bae\/87e787baee547fbdd29919156be8aeb0.jpg\" width=\"787\" height=\"592\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/87e\/787\/bae\/87e787baee547fbdd29919156be8aeb0.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0418\u0437 \u043a\u043e\u0434\u0430 \u0431\u043e\u0442\u0430 \u043d\u0430 Python \u0432\u044b\u0440\u0435\u0437\u0430\u044e \u0432\u0441\u0435 \u043b\u0438\u0448\u043d\u0435\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u0448\u0430\u0431\u043b\u043e\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 memo \u0444\u043e\u0440\u043c\u044b:<\/p>\n<pre><code class=\"python\">#  pip install yadisk #  pip install delphivcl  import yadisk  # \u0442\u043e\u043a\u0435\u043d \u044f\u043d\u0434\u0435\u043a\u0441 \u0434\u0438\u0441\u043a\u0430 y = yadisk.YaDisk(token='\u0430\u0431\u0440\u0430-\u043a\u0430\u0434\u0430\u0431\u0440\u0430 \u043e\u0442 \u044f\u043d\u0434\u0435\u043a\u0441\u0430')  ##search_dir = 'GOST' ## ##find_str = '1811'  if y.check_token():     # \u0438\u0449\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441     if not y.is_dir('\/'+search_dir):         print('\u041f\u0430\u043f\u043a\u0430 ' + search_dir +' \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430. \u0428\u043e-\u0442\u043e \u043f\u043e\u043b\u043e\u043c\u0430\u043b\u043e\u0441\u044c. \u0418\u0437\u0432\u0438\u043d\u0438\u0442\u0435.')     else:         Spis = []         for item in y.listdir(search_dir):             if find_str in item['name']:                 if len(Spis) &lt; 7:                     print('\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442: ')                     print(item['name'].encode().decode(\"ansi\"))                 Spis.append(item['name'])         if len(Spis) == 0:             print('\u0418\u0437\u0432\u0438\u043d\u0438\u0442\u0435, \u043f\u043e\u043a\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 \u043f\u0430\u043f\u043a\u0435 '+ search_dir +' \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c.')         if len(Spis) == 1:                 # ------------\u0434\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0444\u0430\u0439\u043b-------------------                 y.publish('\/'+search_dir+'\/'+Spis[0])  # \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b                 # \u0448\u043b\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443                 print(y.get_meta('\/'+search_dir+'\/'+Spis[0]).public_url)          if len(Spis) > 1:             print('\u041d\u0430\u0439\u0434\u0435\u043d\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432: '+str(len(Spis)) + '. \u0423\u0442\u043e\u0447\u043d\u0438\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441:') else:     print('\u0418\u0437\u0432\u0438\u043d\u0438\u0442\u0435 \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0434\u0438\u0441\u043a \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437')<\/code><\/pre>\n<p>\u041f\u043e\u043f\u0443\u0442\u043d\u043e \u0443\u0431\u0438\u0440\u0430\u044e \u0444\u0430\u0439\u043b \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438, \u0442\u043e\u043a\u0435\u043d \u0432\u0441\u043e\u0432\u044b\u0432\u0430\u044e \u0432 \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<p>\u0412 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0438\u0442\u043e\u043d\u0430 \u0434\u0443\u043c\u0430\u043b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u0425\u043e\u0442\u044f \u0438 \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u041d\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0434\u0443\u043c\u0430\u043b &#8212; \u0442\u0430\u043a\u0438 \u044d\u0442\u043e \u0436 \u044f \u043c\u043e\u0433\u0443 \u0438 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 memo \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code>Memo2.Lines.Insert(0, 'search_dir = \"'+ComboBox1.Text+'\"'); Memo2.Lines.Insert(0, 'find_str = \"'+Edit1.Text+'\"'); <\/code><\/pre>\n<p>\u041f\u0438\u0442\u043e\u043d \u0433\u0438\u0431\u043a\u0438\u0439). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0437\u0431\u0435\u0433\u0430\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u043e \u043e\u0431\u043c\u0435\u043d\u0443 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 2-\u043c\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0442\u043e\u043b\u044c\u043a\u043e 2 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u0430\u043a\u0435\u0442\u0430 P4D &#8212; PythonEngine1: TPythonEngine \u0438 PythonGUIInputOutput1: TPythonGUIInputOutput.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/8f7\/2fa\/91d\/8f72fa91d71b8b6effbbeb023589d790.jpg\" width=\"1059\" height=\"534\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8f7\/2fa\/91d\/8f72fa91d71b8b6effbbeb023589d790.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u0412\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0432\u044b\u0431\u043e\u0440\u0443 \u043f\u0430\u043f\u043a\u0438 \u043f\u043e\u0438\u0441\u043a\u0430, \u0432\u0432\u043e\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438. \u041f\u043e\u0441\u043b\u0435 \u0432 \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0439 memo2 \u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 print \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 memo1.<\/p>\n<pre><code class=\"delphi\">unit Unit2;  interface  uses   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls,   PythonEngine, Vcl.PythonGUIInputOutput, SynEdit;  type   TForm2 = class(TForm)     Memo1: TMemo;     Edit1: TEdit;     Splitter1: TSplitter;     Panel1: TPanel;     Label1: TLabel;     ComboBox1: TComboBox;     Button1: TButton;     PythonEngine1: TPythonEngine;     PythonGUIInputOutput1: TPythonGUIInputOutput;     Memo2: TMemo;     SynEdit1: TSynEdit;     procedure FormCreate(Sender: TObject);     procedure Button1Click(Sender: TObject);   private     { Private declarations }   public     { Public declarations }   end;  var   Form2: TForm2;  implementation  {$R *.dfm}  procedure TForm2.Button1Click(Sender: TObject); begin   Memo1.Clear;   SynEdit1.Clear;   SynEdit1.Lines.Add('\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443: ');   SynEdit1.Lines.Add(Edit1.Text);   SynEdit1.Lines.Add('\u0412 \u043f\u0430\u043f\u043a\u0435: '+ComboBox1.Text);   Application.ProcessMessages;   Memo2.Clear;   Memo2.Lines.LoadFromFile('bot_no_tg.py');   \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0430\u043f\u043a\u0443 \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441   Memo2.Lines.Insert(0, 'search_dir = \"'+ComboBox1.Text+'\"');   Memo2.Lines.Insert(0, 'find_str = \"'+Edit1.Text+'\"');   PythonEngine1.ExecStrings( Memo2.Lines );   Memo1.Visible:=false;   Application.ProcessMessages;   Memo1.Text:=Utf8ToAnsi(memo1.Text);   Memo1.Visible:=true;   Application.ProcessMessages; end;  procedure TForm2.FormCreate(Sender: TObject); begin   Memo1.Clear;   Memo2.Clear;   SynEdit1.Clear; end;  end. <\/code><\/pre>\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u043e\u0442\u0430. \u0420\u044e\u0448\u0435\u0447\u0435\u043a \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e).<\/p>\n<p>\u0418\u0437 \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u0430\u043c\u043d\u0435\u0439:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c \u043d\u0430\u0434\u043e \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c: \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u044564, \u0442\u043e \u0438 Python \u044564,<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0432\u043e\u0437\u0438\u0442\u0441\u044f \u0441 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c 1)Delphi: Memo1.Text:=Utf8ToAnsi(memo1.Text); 2)Python: print(item[&#8216;name&#8217;].encode().decode(&#171;ansi&#187;)),<\/p>\n<\/li>\n<li>\n<p>debug \u0438 release \u0438\u043c\u0435\u044e\u0442 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043c\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e exe \u0444\u0430\u0439\u043b\u0430, \u0430 \u0435\u0449\u0435 \u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0435. \u0418 \u043f\u0430\u043f\u043a\u0438 \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439 \u0442\u043e\u0436\u0435 \u0440\u0430\u0437\u043d\u044b\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e Python \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0430\u0441\u044c Delphi, \u043f\u043e\u0442\u043e\u043c \u0432 \u043d\u0435\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u043d\u0438 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u0438\u043b\u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432\u0435\u0440\u0441\u0438\u044e Python. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u044d\u0442\u0438 \u0441\u0432\u044f\u0437\u0438 \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0438 \u043f\u0440\u043e\u0433\u0430 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0412 \u0438\u043d\u0435\u0442\u0435 \u0441\u043a\u0443\u0434\u043d\u043e\u0432\u0430\u0442\u043e, \u043d\u043e \u0435\u0441\u0442\u044c \u0438\u043d\u0444\u0430 \u043a\u0430\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438. \u0412\u0440\u043e\u0434\u0435 \u0434\u0430\u0436\u0435 \u043f\u0438\u0448\u0443\u0442, \u0448\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043f\u043e\u0440\u0442\u0430\u0431\u043b\u0435 \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0412\u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043e\u043c\u043f\u0435 \u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b-\u0431\u043e\u043a\u0441\u0435 (\u0441\u043c \u043d\u0438\u0436\u0435).<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442\u043d\u044f\u043b\u0430 \u044d\u0442\u0430 \u0431\u043e\u0440\u044c\u0431\u0430 \u0441 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438 &#8212; \u043a\u0440\u044f\u043a\u043e-\u0437\u044f\u0431\u043b\u044b \u043b\u0435\u0437\u043b\u0438. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u043f\u0430\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u044b \u0438 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c. \u0414\u0443\u043c\u0430\u043b \u0443\u0436\u0435 \u043d\u0435 \u043f\u043e\u0431\u0435\u0434\u044e, \u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u0441\u0430\u043c\u043e \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e). \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 memo \u0442\u0443\u043f\u043e\u0432\u0430\u0442 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e &#8212; \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430\u0445. \u041f\u043e\u043b\u0435\u0437 \u0434\u0430\u0436\u0435 SynEdit \u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u0438 \u043e\u043d \u043d\u0435 \u043f\u043e\u043c\u043e\u0433. \u0422\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c. \u0414\u0430 \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 memo \u043d\u0430 1\u0448\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c.<\/p>\n<p>\u0423\u0440\u0430, \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/ba4\/531\/71c\/ba453171ccbaf6a5171f5d78836e56e8.jpg\" width=\"1901\" height=\"985\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ba4\/531\/71c\/ba453171ccbaf6a5171f5d78836e56e8.jpg\" data-blurred=\"true\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/1a7\/f27\/d1d\/1a7f27d1d7ad41282b56d3e7f4992d80.jpg\" width=\"787\" height=\"592\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1a7\/f27\/d1d\/1a7f27d1d7ad41282b56d3e7f4992d80.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041a\u043d\u043e\u043f\u043a\u0443 &#171;\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c&#187; &#8212; \u0443\u0431\u0440\u0430\u043b \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438, \u0438 \u0442\u0430\u043a \u0432\u0441\u0435 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0447\u0438\u0441\u0442\u044f\u0442\u0441\u044f).<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b-\u0431\u043e\u043a\u0441\u0435 \u043a\u0430\u0447\u0430\u044e tiny10 23h1 x64, \u0441\u0442\u0430\u0432\u043b\u044e, \u0447\u0435\u0440\u0435\u0437 ISO \u0437\u0430\u043a\u0438\u0434\u044b\u0432\u0430\u044e \u044d\u043a\u0437\u0435\u0448\u043d\u0438\u043a \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c. \u041f\u0440\u043e\u0431\u0443\u044e. \u0411\u0435\u0437 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u043e\u0439 dll \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u043e\u0441\u044c. \u0414\u0430 \u0435\u0449\u0435 \u0438 \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u0440\u0443\u0433\u0443\u044e \u0437\u0430\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e (\u043d\u0430 \u043c\u043e\u0435\u043c \u043a\u043e\u043c\u043f\u0435 3.11\u044564 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442), \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0447\u0442\u043e-\u0442\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/bd5\/caf\/903\/bd5caf90372de1b400b144d0c3e34d26.jpg\" width=\"1026\" height=\"854\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bd5\/caf\/903\/bd5caf90372de1b400b144d0c3e34d26.jpg\" data-blurred=\"true\"\/><\/figure>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/763054\/\"> https:\/\/habr.com\/ru\/articles\/763054\/<\/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 article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442.<br \/>\u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u0432\u044b\u043b\u043e\u0436\u0438\u043b<a href=\"https:\/\/habr.com\/ru\/articles\/720130\/\" rel=\"noopener noreferrer nofollow\"> \u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u043f\u0440\u043e \u0431\u043e\u0442\u0430.<\/p>\n<p>\u0418 \u0432\u043e\u0442 \u0442\u0443\u0442 \u043c\u0435\u043d\u044f \u0437\u0430\u0446\u0435\u043f\u0438\u043b) \u043e\u0434\u0438\u043d <a href=\"https:\/\/habr.com\/ru\/articles\/720130\/#comment_25286804\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439<\/a>.<\/p>\n<p>\u0423\u0436\u0435 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u043e\u0442\u0430 \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u043a\u0440\u0443\u0442\u0438\u043b\u0430\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u043e\u0433\u043e GUI-\u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044f).<br \/> \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044f \u0442\u0430\u043c \u043d\u0435 \u0443\u0432\u0438\u0434\u0435\u043b. \u041d\u043e \u0448\u043e-\u0442\u043e \u043d\u0430\u0440\u043e\u0434 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u043e. \u041d\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u0448\u044c &#8212; \u043d\u0435 \u0443\u0437\u043d\u0430\u0435\u0448\u044c), \u0430 \u0442\u0443\u0442 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u043a\u0440\u043e\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041f\u043e\u0433\u043d\u0430\u043b\u0438)<\/p>\n<p>\u041a\u0430\u0447\u0430\u044e Delphi 11CE (\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f, \u043f\u0438\u0441\u044c\u043c\u0430 \u0441 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u0438 \u043d\u0430 \u044f\u043d\u0434\u0435\u043a\u0441-\u043f\u043e\u0447\u0442\u0443), \u0441\u0442\u0430\u0432\u043b\u044e Python4Delphi &#8212; \u0443\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u042f\u041f \u0438 Delphi4PythonExporter &#8212; \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c GUI \u043d\u0430 Delphi \u0432 Python (\u043d\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0441\u044f).<\/p>\n<p>\u041c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418\u0437 \u043a\u043e\u0434\u0430 \u0431\u043e\u0442\u0430 \u043d\u0430 Python \u0432\u044b\u0440\u0435\u0437\u0430\u044e \u0432\u0441\u0435 \u043b\u0438\u0448\u043d\u0435\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u0432\u0440\u043e\u0434\u0435 \u043a\u0430\u043a \u0448\u0430\u0431\u043b\u043e\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 memo \u0444\u043e\u0440\u043c\u044b:<\/p>\n<pre><code class=\"python\">#  pip install yadisk #  pip install delphivcl  import yadisk  # \u0442\u043e\u043a\u0435\u043d \u044f\u043d\u0434\u0435\u043a\u0441 \u0434\u0438\u0441\u043a\u0430 y = yadisk.YaDisk(token='\u0430\u0431\u0440\u0430-\u043a\u0430\u0434\u0430\u0431\u0440\u0430 \u043e\u0442 \u044f\u043d\u0434\u0435\u043a\u0441\u0430')  ##search_dir = 'GOST' ## ##find_str = '1811'  if y.check_token():     # \u0438\u0449\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441     if not y.is_dir('\/'+search_dir):         print('\u041f\u0430\u043f\u043a\u0430 ' + search_dir +' \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430. \u0428\u043e-\u0442\u043e \u043f\u043e\u043b\u043e\u043c\u0430\u043b\u043e\u0441\u044c. \u0418\u0437\u0432\u0438\u043d\u0438\u0442\u0435.')     else:         Spis = []         for item in y.listdir(search_dir):             if find_str in item['name']:                 if len(Spis) &lt; 7:                     print('\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442: ')                     print(item['name'].encode().decode(\"ansi\"))                 Spis.append(item['name'])         if len(Spis) == 0:             print('\u0418\u0437\u0432\u0438\u043d\u0438\u0442\u0435, \u043f\u043e\u043a\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 \u043f\u0430\u043f\u043a\u0435 '+ search_dir +' \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c.')         if len(Spis) == 1:                 # ------------\u0434\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0444\u0430\u0439\u043b-------------------                 y.publish('\/'+search_dir+'\/'+Spis[0])  # \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b                 # \u0448\u043b\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443                 print(y.get_meta('\/'+search_dir+'\/'+Spis[0]).public_url)          if len(Spis) > 1:             print('\u041d\u0430\u0439\u0434\u0435\u043d\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432: '+str(len(Spis)) + '. \u0423\u0442\u043e\u0447\u043d\u0438\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441:') else:     print('\u0418\u0437\u0432\u0438\u043d\u0438\u0442\u0435 \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0434\u0438\u0441\u043a \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437')<\/code><\/pre>\n<p>\u041f\u043e\u043f\u0443\u0442\u043d\u043e \u0443\u0431\u0438\u0440\u0430\u044e \u0444\u0430\u0439\u043b \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438, \u0442\u043e\u043a\u0435\u043d \u0432\u0441\u043e\u0432\u044b\u0432\u0430\u044e \u0432 \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<p>\u0412 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0438\u0442\u043e\u043d\u0430 \u0434\u0443\u043c\u0430\u043b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u0425\u043e\u0442\u044f \u0438 \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u041d\u043e \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0434\u0443\u043c\u0430\u043b &#8212; \u0442\u0430\u043a\u0438 \u044d\u0442\u043e \u0436 \u044f \u043c\u043e\u0433\u0443 \u0438 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 memo \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code>Memo2.Lines.Insert(0, 'search_dir = \"'+ComboBox1.Text+'\"'); Memo2.Lines.Insert(0, 'find_str = \"'+Edit1.Text+'\"'); <\/code><\/pre>\n<p>\u041f\u0438\u0442\u043e\u043d \u0433\u0438\u0431\u043a\u0438\u0439). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0437\u0431\u0435\u0433\u0430\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u043e \u043e\u0431\u043c\u0435\u043d\u0443 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 2-\u043c\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0442\u043e\u043b\u044c\u043a\u043e 2 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u0430\u043a\u0435\u0442\u0430 P4D &#8212; PythonEngine1: TPythonEngine \u0438 PythonGUIInputOutput1: TPythonGUIInputOutput.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0432\u044b\u0431\u043e\u0440\u0443 \u043f\u0430\u043f\u043a\u0438 \u043f\u043e\u0438\u0441\u043a\u0430, \u0432\u0432\u043e\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438. \u041f\u043e\u0441\u043b\u0435 \u0432 \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0439 memo2 \u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 print \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 memo1.<\/p>\n<pre><code class=\"delphi\">unit Unit2;  interface  uses   Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,   Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls,   PythonEngine, Vcl.PythonGUIInputOutput, SynEdit;  type   TForm2 = class(TForm)     Memo1: TMemo;     Edit1: TEdit;     Splitter1: TSplitter;     Panel1: TPanel;     Label1: TLabel;     ComboBox1: TComboBox;     Button1: TButton;     PythonEngine1: TPythonEngine;     PythonGUIInputOutput1: TPythonGUIInputOutput;     Memo2: TMemo;     SynEdit1: TSynEdit;     procedure FormCreate(Sender: TObject);     procedure Button1Click(Sender: TObject);   private     { Private declarations }   public     { Public declarations }   end;  var   Form2: TForm2;  implementation  {$R *.dfm}  procedure TForm2.Button1Click(Sender: TObject); begin   Memo1.Clear;   SynEdit1.Clear;   SynEdit1.Lines.Add('\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443: ');   SynEdit1.Lines.Add(Edit1.Text);   SynEdit1.Lines.Add('\u0412 \u043f\u0430\u043f\u043a\u0435: '+ComboBox1.Text);   Application.ProcessMessages;   Memo2.Clear;   Memo2.Lines.LoadFromFile('bot_no_tg.py');   \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0430\u043f\u043a\u0443 \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441   Memo2.Lines.Insert(0, 'search_dir = \"'+ComboBox1.Text+'\"');   Memo2.Lines.Insert(0, 'find_str = \"'+Edit1.Text+'\"');   PythonEngine1.ExecStrings( Memo2.Lines );   Memo1.Visible:=false;   Application.ProcessMessages;   Memo1.Text:=Utf8ToAnsi(memo1.Text);   Memo1.Visible:=true;   Application.ProcessMessages; end;  procedure TForm2.FormCreate(Sender: TObject); begin   Memo1.Clear;   Memo2.Clear;   SynEdit1.Clear; end;  end. <\/code><\/pre>\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u043e\u0442\u0430. \u0420\u044e\u0448\u0435\u0447\u0435\u043a \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e).<\/p>\n<p>\u0418\u0437 \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u0430\u043c\u043d\u0435\u0439:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c \u043d\u0430\u0434\u043e \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c: \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u044564, \u0442\u043e \u0438 Python \u044564,<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0432\u043e\u0437\u0438\u0442\u0441\u044f \u0441 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c 1)Delphi: Memo1.Text:=Utf8ToAnsi(memo1.Text); 2)Python: print(item[&#8216;name&#8217;].encode().decode(&#171;ansi&#187;)),<\/p>\n<\/li>\n<li>\n<p>debug \u0438 release \u0438\u043c\u0435\u044e\u0442 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043c\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e exe \u0444\u0430\u0439\u043b\u0430, \u0430 \u0435\u0449\u0435 \u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0435. \u0418 \u043f\u0430\u043f\u043a\u0438 \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439 \u0442\u043e\u0436\u0435 \u0440\u0430\u0437\u043d\u044b\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e Python \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0430\u0441\u044c Delphi, \u043f\u043e\u0442\u043e\u043c \u0432 \u043d\u0435\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u043d\u0438 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u0438\u043b\u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432\u0435\u0440\u0441\u0438\u044e Python. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u044d\u0442\u0438 \u0441\u0432\u044f\u0437\u0438 \u0442\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0438 \u043f\u0440\u043e\u0433\u0430 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0412 \u0438\u043d\u0435\u0442\u0435 \u0441\u043a\u0443\u0434\u043d\u043e\u0432\u0430\u0442\u043e, \u043d\u043e \u0435\u0441\u0442\u044c \u0438\u043d\u0444\u0430 \u043a\u0430\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438. \u0412\u0440\u043e\u0434\u0435 \u0434\u0430\u0436\u0435 \u043f\u0438\u0448\u0443\u0442, \u0448\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043f\u043e\u0440\u0442\u0430\u0431\u043b\u0435 \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0412\u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043e\u043c\u043f\u0435 \u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b-\u0431\u043e\u043a\u0441\u0435 (\u0441\u043c \u043d\u0438\u0436\u0435).<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442\u043d\u044f\u043b\u0430 \u044d\u0442\u0430 \u0431\u043e\u0440\u044c\u0431\u0430 \u0441 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438 &#8212; \u043a\u0440\u044f\u043a\u043e-\u0437\u044f\u0431\u043b\u044b \u043b\u0435\u0437\u043b\u0438. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u043f\u0430\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u044b \u0438 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c. \u0414\u0443\u043c\u0430\u043b \u0443\u0436\u0435 \u043d\u0435 \u043f\u043e\u0431\u0435\u0434\u044e, \u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u0441\u0430\u043c\u043e \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e). \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 memo \u0442\u0443\u043f\u043e\u0432\u0430\u0442 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e &#8212; \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430\u0445. \u041f\u043e\u043b\u0435\u0437 \u0434\u0430\u0436\u0435 SynEdit \u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u0438 \u043e\u043d \u043d\u0435 \u043f\u043e\u043c\u043e\u0433. \u0422\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c. \u0414\u0430 \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 memo \u043d\u0430 1\u0448\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c.<\/p>\n<p>\u0423\u0440\u0430, \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e:<\/p>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<p>\u041a\u043d\u043e\u043f\u043a\u0443 &#171;\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c&#187; &#8212; \u0443\u0431\u0440\u0430\u043b \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438, \u0438 \u0442\u0430\u043a \u0432\u0441\u0435 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0447\u0438\u0441\u0442\u044f\u0442\u0441\u044f).<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b-\u0431\u043e\u043a\u0441\u0435 \u043a\u0430\u0447\u0430\u044e tiny10 23h1 x64, \u0441\u0442\u0430\u0432\u043b\u044e, \u0447\u0435\u0440\u0435\u0437 ISO \u0437\u0430\u043a\u0438\u0434\u044b\u0432\u0430\u044e \u044d\u043a\u0437\u0435\u0448\u043d\u0438\u043a \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c. \u041f\u0440\u043e\u0431\u0443\u044e. \u0411\u0435\u0437 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u043e\u0439 dll \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u043e\u0441\u044c. \u0414\u0430 \u0435\u0449\u0435 \u0438 \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u0440\u0443\u0433\u0443\u044e \u0437\u0430\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e (\u043d\u0430 \u043c\u043e\u0435\u043c \u043a\u043e\u043c\u043f\u0435 3.11\u044564 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442), \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0447\u0442\u043e-\u0442\u043e.<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/763054\/\"> https:\/\/habr.com\/ru\/articles\/763054\/<\/a><br \/><\/br><\/br><\/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-355707","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/355707","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=355707"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/355707\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=355707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=355707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=355707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}