M
M
micsma2020-09-18 02:59:19
Python
micsma, 2020-09-18 02:59:19

How to generate qr code in console?

How to generate a Qr Code and print it to the console?
For example, I have a piece of code:

import qrcode

value = input('Значение: ')
name = input('Название файла: ')
img = qrcode.make(value)

print(img)
img.save(name)


but this code generates png qr code.
but I need by type:
█████████████████████████████████████
█████████████████████████████████████
████ ▄▄▄▄▄ █▀▄   ▀ █▄▀ ███ ▄▄▄▄▄ ████
████ █   █ █ ▀▄▀▀▀▀▀ ▀█▄▀█ █   █ ████
████ █▄▄▄█ ██▄▄▀▄ ▀█▀█ ▄ █ █▄▄▄█ ████
████▄▄▄▄▄▄▄█ ▀ ▀ █▄▀ █▄█▄█▄▄▄▄▄▄▄████
████ ███▀█▄█ ▀█▄▄▀▀ █▄ ▀█▄▄▀▀▄  █████
████▀██ ▄ ▄ █  █▀ ▄ ▀█▄▀█ ▄█  ▄▀▀████
████▄██ ▀ ▄ ▄▀█ █▄█▀ █ ▀ ▀ ▄▀ ▀▄ ████
████ ▄▀▄██▄ ▀█▀  ██▄ █ █▀ █▀  ▀▀▀████
████ ▄ ▀  ▄ █▀▄  ▀▀▀▀██▀█▄▀▀▀█▄▄ ████
████ ▄ ▀█ ▄▄▄▀ ▄▄▀█  █ ▄ ▄▄▀██▄▀▄████
████▄█▄▄▄█▄▄ █▀▀▀█ ▀█▄▀▀ ▄▄▄ ▀▄█▄████
████ ▄▄▄▄▄ ██▄▀▀▀█▀ ███  █▄█  ██▀████
████ █   █ ██ ▀█ ▄  ▀██   ▄▄▄███ ████
████ █▄▄▄█ ██▄▄ ▀ ▀▄▄█▀▄▄ ▄▄▄▀▀▄▀████
████▄▄▄▄▄▄▄█▄▄██▄▄█▄▄▄█▄█▄▄█▄▄▄██████
█████████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

(so that the promotional code is displayed in the console in the text as in the example above).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2020-09-18
@micsma

In other words, do you need an ASCII representation of the picture? Then check out this recipe https://www.google.ru/amp/s/www.geeksforgeeks.org/...
Well, in Google search for “png to ascii art python”.
To the heap - https://dev.to/anuragrana/generating-ascii-art-fro...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question