{"id":1020,"date":"2021-11-14T10:44:53","date_gmt":"2021-11-14T10:44:53","guid":{"rendered":"https:\/\/ethosspace.com\/programmers\/?p=1020"},"modified":"2021-11-22T08:56:26","modified_gmt":"2021-11-22T08:56:26","slug":"simple-code-to-generate-qr-code-using-python","status":"publish","type":"post","link":"https:\/\/ethosspace.com\/programmers\/simple-code-to-generate-qr-code-using-python\/","title":{"rendered":"Simple code to Generate QR Code using Python"},"content":{"rendered":"\n<p>To generate QR Code like Below<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignleft size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ethosspace.com\/programmers\/wp-content\/uploads\/2021\/11\/qrcode1.png\" alt=\"\" class=\"wp-image-1021\" width=\"82\" height=\"82\" srcset=\"https:\/\/ethosspace.com\/programmers\/wp-content\/uploads\/2021\/11\/qrcode1.png 328w, https:\/\/ethosspace.com\/programmers\/wp-content\/uploads\/2021\/11\/qrcode1-300x300.png 300w, https:\/\/ethosspace.com\/programmers\/wp-content\/uploads\/2021\/11\/qrcode1-150x150.png 150w, https:\/\/ethosspace.com\/programmers\/wp-content\/uploads\/2021\/11\/qrcode1-60x60.png 60w\" sizes=\"auto, (max-width: 82px) 100vw, 82px\" \/><\/figure><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>It is important to install pyqrcode and pypng. To install this you can use the command prompt and use the below command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install pyqrcode\npip install pypng<\/code><\/pre>\n\n\n\n<p>Below simple 5 line code will generate QR code for URL in python<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>#QR Code Generator\nimport pyqrcode\nfrom pyqrcode import QRCode\nurlDest = &#39;https:\/\/www.ethosspace.com\/&#39;\nvarQR = QRCode(urlDest, error=&#39;H&#39;, version=None, mode=None, encoding=&#39;iso-8859-1&#39;)\nvarQR.png(&#39;generatedQR.png&#39;, scale=8)\nvarQR.show()<\/code><\/pre><\/div>\n\n\n\n<p>Here in dest variable, we have used hyperlink ethosspace.com. Which can be replaced with url to generate QR Code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To generate QR Code like Below It is important to install pyqrcode and pypng. To install this you can use the command prompt and use the below command. Below simple 5 line code will generate QR code for URL in python Here in dest variable, we have used hyperlink ethosspace.com. Which can be replaced with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[11],"tags":[],"class_list":["post-1020","post","type-post","status-publish","format-standard","hentry","category-running-code-and-program"],"aioseo_notices":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"sparkling-featured":false,"sparkling-featured-fullwidth":false,"tab-small":false},"uagb_author_info":{"display_name":"program45_-rt8nb","author_link":"https:\/\/ethosspace.com\/programmers\/author\/program45_-rt8nb\/"},"uagb_comment_info":0,"uagb_excerpt":"To generate QR Code like Below It is important to install pyqrcode and pypng. To install this you can use the command prompt and use the below command. Below simple 5 line code will generate QR code for URL in python Here in dest variable, we have used hyperlink ethosspace.com. Which can be replaced with&hellip;","_links":{"self":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/1020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/comments?post=1020"}],"version-history":[{"count":3,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/1020\/revisions"}],"predecessor-version":[{"id":1024,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/posts\/1020\/revisions\/1024"}],"wp:attachment":[{"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/media?parent=1020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/categories?post=1020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ethosspace.com\/programmers\/wp-json\/wp\/v2\/tags?post=1020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}