Este projeto é um gerador de QR Code interativo via terminal, desenvolvido em Python.
O usuário insere um conteúdo (texto, link, etc.), e o programa gera automaticamente uma imagem de QR Code correspondente.
- Coleta o conteúdo fornecido pelo usuário.
- Converte o conteúdo em QR Code.
- Salva a imagem gerada em um arquivo
.pngdiferentes (não sobrescreve). - Permite gerar múltiplos QR Codes em sequência, através de um loop interativo.
gerador_qrcode()→ coleta o conteúdo e gera o QR Code.loop_qrcode()→ controla a inicialização, execução em loop e encerramento do programa.- Execução principal → chama
loop_qrcode()para iniciar o programa.
python
Importa a biblioteca padrão do Python "os" (Operating System), que permite interagir com o sistema operacional.
import os
contador = 1
Insira o conteúdo que você deseja converter em QR Code: https://github.com
O QR Code foi gerado com sucesso!
Você deseja gerar outro QR Code? [S/N]:
1.Clone o repositório:
git clone https://github.com/seu-usuario/qr-code-generator.git
cd qr-code-generator- Instale a biblioteca necessária:
pip install qrcode[pil]Execute o programa:
python src/main.pyO QR Code gerado será salvo como uma imagem .png na pasta do repositório clonado.
This project is an interactive terminal-based QR code generator, developed in Python.
The user enters content (text, link, etc.), and the program automatically generates a corresponding QR code image.
- Collects the content provided by the user.
- Converts the content into a QR code.
- Saves the generated image to a separate
.pngfile (does not overwrite). - Allows generating multiple QR codes sequentially through an interactive loop.
-
qrcode_generator()→ collects the content and generates the QR code. -
qrcode_loop()→ controls the initialization, loop execution, and termination of the program. -
Main execution → calls
qrcode_loop()to start the program.
python
Imports the Python standard library "os" (Operating System), which allows interaction with the operating system.
import os
counter = 1
Enter the content you want to convert into a QR Code: https://github.com
The QR Code was successfully generated!
Do you want to generate another QR Code? [S/N]:
- Clone the repository:
git clone https://github.com/your-username/qr-code-generator.git
cd qr-code-generator- Install the necessary library:
pip install qrcode[pil]Run the program:
python src/main.pyThe generated QR code will be saved as a .png image in the cloned repository folder.