{"id":6986,"date":"2025-01-14T21:41:33","date_gmt":"2025-01-14T18:41:33","guid":{"rendered":"https:\/\/1.cbm.ua\/?p=6986"},"modified":"2025-01-24T14:01:45","modified_gmt":"2025-01-24T11:01:45","slug":"python-%d0%b8-%d0%b8%d0%bd%d0%b4%d0%b5%d0%ba%d1%81%d0%b0%d1%86%d0%b8%d1%8f-%d0%bf%d0%be-%d1%81%d0%be%d0%b4%d0%b5%d1%80%d0%b6%d0%b8%d0%bc%d0%be%d0%bc%d1%83-%d1%84%d0%b0%d0%b9%d0%bb%d0%be%d0%b2-%d0%b2","status":"publish","type":"post","link":"https:\/\/1.cbm.ua\/?p=6986","title":{"rendered":"! ___ \u041f\u041e \u0434\u043b\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 &#8212; DocFetcher, Everything,  Recoll, Python \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u043f\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Window 11."},"content":{"rendered":"\n<p>DocFetcher &#8212; <a href=\"https:\/\/docfetcher.sourceforge.io\/\">https:\/\/docfetcher.sourceforge.io<\/a><br>Everything &#8212; <a href=\"https:\/\/www.voidtools.com\/\">https:\/\/www.voidtools.com\/<\/a><br>Recoll &#8212; <a href=\"https:\/\/www.recoll.org\/\">https:\/\/www.recoll.org\/<\/a><br>Python &#8212; \u043d\u0443\u0436\u043d\u043e \u0438\u043a\u0430\u0442\u044c \u0441\u043e\u0444\u0442.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"619\" height=\"468\" src=\"https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2025\/01\/83EBD7BC-97D0-409F-8547-9B928B699D96.png\" alt=\"\" class=\"wp-image-7056\" srcset=\"https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2025\/01\/83EBD7BC-97D0-409F-8547-9B928B699D96.png 619w, https:\/\/fjngqp1mvftjzxfzrdiggafze9wxueam.cdn-freehost.com.ua\/wp-content\/uploads\/2025\/01\/83EBD7BC-97D0-409F-8547-9B928B699D96-300x227.png 300w\" sizes=\"auto, (max-width: 619px) 100vw, 619px\" \/><\/figure>\n\n\n\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e! \u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 Windows 11:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>fsindex<\/strong>: \u042d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u043d\u0430 Python \u0434\u043b\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 Windows. \u041e\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430, \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442 CSV1. GitHub &#8212; fsindex<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/HizkiFW\/fsindex\">https:\/\/github.com\/HizkiFW\/fsindex<\/a> &#8212;  FS \u0418\u043d\u0434\u0435\u043a\u0441. \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 Python \u0434\u043b\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Windows \u0438 Python 2.7. \u041e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u044d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043d\u0443\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f\u0445.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u043d\u0430 \u0431\u0430\u0437\u0435 Python 3<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import os\nimport sqlite3\n\n# \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445\nconn = sqlite3.connect('file_index.db')\nc = conn.cursor()\nc.execute('''\nCREATE TABLE IF NOT EXISTS files (\n    id INTEGER PRIMARY KEY,\n    path TEXT NOT NULL,\n    content TEXT\n)\n''')\nconn.commit()\n\ndef index_files(directory):\n    for root, dirs, files in os.walk(directory):\n        for file in files:\n            file_path = os.path.join(root, file)\n            try:\n                with open(file_path, 'r', encoding='utf-8') as f:\n                    content = f.read()\n                c.execute('INSERT INTO files (path, content) VALUES (?, ?)', (file_path, content))\n                conn.commit()\n            except Exception as e:\n                print(f\"Could not read {file_path}: {e}\")\n\ndef search_files(keyword):\n    c.execute('SELECT path FROM files WHERE content LIKE ?', ('%' + keyword + '%',))\n    return c.fetchall()\n\n# \u0418\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438\nindex_files('C:\/your_directory')\n\n# \u041f\u043e\u0438\u0441\u043a \u043f\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u043c\u0443 \u0441\u043b\u043e\u0432\u0443\nresults = search_files('your_keyword')\nfor result in results:\n    print(result[0])\n\nconn.close()\n<\/pre>\n\n\n\n<p>\u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Python 3 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 SQLite \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445.<\/li>\n\n\n\n<li>\u041f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0432\u0441\u0435\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n\n\n\n<li>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u043f\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0441\u043b\u043e\u0432\u0430\u043c \u0432 \u0438\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c.<\/li>\n<\/ol>\n\n\n\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b, \u0443\u043a\u0430\u0437\u0430\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435, \u0434\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u0442\u044c!<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DocFetcher &#8212; https:\/\/docfetcher.sourceforge.ioEverything &#8212; https:\/\/www.voidtools.com\/Recoll &#8212; https:\/\/www.recoll.org\/Python &#8212; \u043d\u0443\u0436\u043d\u043e \u0438\u043a\u0430\u0442\u044c \u0441\u043e\u0444\u0442. \u041a\u043e\u043d\u0435\u0447\u043d\u043e! \u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 Windows 11: https:\/\/github.com\/HizkiFW\/fsindex &#8212; FS \u0418\u043d\u0434\u0435\u043a\u0441. \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 Python \u0434\u043b\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 Windows \u0438 Python 2.7. \u041e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438,&hellip;&nbsp;<a href=\"https:\/\/1.cbm.ua\/?p=6986\" rel=\"bookmark\">\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 &raquo;<span class=\"screen-reader-text\">! ___ \u041f\u041e \u0434\u043b\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 &#8212; DocFetcher, Everything,  Recoll, Python \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u043f\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Window 11.<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":7056,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[31,2],"tags":[],"class_list":["post-6986","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-windows","category-python"],"_links":{"self":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts\/6986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6986"}],"version-history":[{"count":5,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts\/6986\/revisions"}],"predecessor-version":[{"id":7058,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts\/6986\/revisions\/7058"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/media\/7056"}],"wp:attachment":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}