{"id":9532,"date":"2023-03-25T21:22:25","date_gmt":"2023-03-25T21:22:25","guid":{"rendered":"https:\/\/max-drake.cc\/?p=9532"},"modified":"2023-03-25T21:22:29","modified_gmt":"2023-03-25T21:22:29","slug":"python-text-expander-hotkeys","status":"publish","type":"post","link":"https:\/\/max-drake.cc\/?p=9532","title":{"rendered":"Python Text Expander &#038; Hotkeys"},"content":{"rendered":"\n<p>I was looking up free productivity tools and came across the following video, unfortunately I&#8217;ll have to type out the code myself as there is no link for the code. <\/p>\n\n\n\n<p>This <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"How to create a text expander like Espanso in python.\" width=\"678\" height=\"381\" data-src=\"https:\/\/www.youtube.com\/embed\/M1XDThsInzI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Looking at YouTube there was another video, and rather than just text expanding, it allows you to execute something, like a function or script I presume, it can also be complied into a .EXE file too<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Simulate Key Presses in Python\" width=\"678\" height=\"381\" data-src=\"https:\/\/www.youtube.com\/embed\/DTnz8wA6wpw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>For the Keylogger the Website to code link is <strong><a rel=\"noreferrer noopener\" href=\"https:\/\/nitratine.net\/blog\/post\/simulate-keypresses-in-python\/\" target=\"_blank\">HERE<\/a><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"How to Make Hotkeys in Python\" width=\"678\" height=\"381\" data-src=\"https:\/\/www.youtube.com\/embed\/n_dfv5DLCGI?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>The video below has a link to the script on the website relating to the video and has the code <strong><a href=\"https:\/\/nitratine.net\/blog\/post\/how-to-make-hotkeys-in-python\/\" target=\"_blank\" rel=\"noreferrer noopener\">HERE<\/a><\/strong><\/p>\n\n\n\n<p>In fact he has a whole YouTube  series on Python and keyboard stuff  <strong><a href=\"https:\/\/www.youtube.com\/watch?v=x8GbWt56TlY&amp;list=PLshJcDKb9hL-YhNPAWJzjw8H9qjnYmjwY\" target=\"_blank\" rel=\"noreferrer noopener\">HERE<\/a><\/strong><\/p>\n\n\n\n<p>There is also a video on an GUI script he has for converting .py to .EXE and add ICON. <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Convert PY to EXE Automatically\" width=\"678\" height=\"381\" data-src=\"https:\/\/www.youtube.com\/embed\/OZSZHmWSOeM?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>The article on the app can be found <strong><a href=\"https:\/\/nitratine.net\/blog\/post\/auto-py-to-exe\/\" target=\"_blank\" rel=\"noreferrer noopener\">HERE<\/a><\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"> End Comment <\/h3>\n\n\n\n<p>I did a couple of the scripts to see how it could be setup and tested them. As I use AutoHotKey to do this and have an extensive library of hotkeys and hotstrings setup in that program I will not be perusing this at this time. If it ain&#8217;t broke don&#8217;t fix it. What I have works pretty well. <\/p>\n\n\n\n<p>It is good to see that it can be done in Python. One thing that makes me stay with AutoHotKey is its faster to load and run. I see with python its such a powerful coding language that it\u2019s a lot bigger. AHK exe file is about 1.17MB whilst the Python 10 dll is about 4.3 MB so will take longer to load and execute. <\/p>\n\n\n\n<p>So a good to know post, that I can revisit if I need to do something totally in python, in fact, it might be handy to have some hotkeys to execute different parts of a script. <\/p>\n\n\n\n<p>The convert .py to .exe is also a useful tool. I have been intending to make a python .EXE script but have not come across the most appropriate program to create yet, its on my todo list. <\/p>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>I was looking up free productivity tools and came across the following video, unfortunately I&#8217;ll have to type out the code myself as there is no link for the code. This Looking at YouTube there was another video, and rather than just text expanding, it allows you to execute something, like a function or script [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":9539,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[466,204,42,34],"tags":[],"class_list":["post-9532","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-autohotkey","category-automation","category-productivity","category-python"],"featured_image_src":"https:\/\/max-drake.cc\/wp-content\/uploads\/2023\/03\/How-to-Make-Hotkeys-in-Python-YouTube-\u2014-Mozilla-Firefox2023-03-26-10_21.jpg","featured_image_src_square":"https:\/\/max-drake.cc\/wp-content\/uploads\/2023\/03\/How-to-Make-Hotkeys-in-Python-YouTube-\u2014-Mozilla-Firefox2023-03-26-10_21.jpg","author_info":{"display_name":"Max Drake","author_link":"https:\/\/max-drake.cc\/?author=1"},"_links":{"self":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/9532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9532"}],"version-history":[{"count":2,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/9532\/revisions"}],"predecessor-version":[{"id":9540,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/9532\/revisions\/9540"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/media\/9539"}],"wp:attachment":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}