amitt001 / amitt001/delegator.py
My work make URL. py
- Linguagem predominante
- Python
- Estrelas
- 1.7k
- Forks
- 86
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
import qrcode
def generate_qr():
# 1. طلب الرابط من المستخدم وتطوير النص (إزالة المسافات الزائدة)
url = input("Enter the URL: ").strip()
# 2. إعداد كائن الـ QRCode مع تخصيص الخصائص
qr = qrcode.QRCode(
version=1, # حجم الرمز (1-40)
error_correction=qrcode.constants.ERROR_CORRECT_L, # مستوى تصحيح الأخطاء
box_size=10, # حجم المربعات الصغيرة داخل الرمز
border=4, # حجم الإطار الأبيض حول الرمز
)
# 3. إضافة البيانات (الرابط) إلى الكائن
qr.add_data(url)
qr.make(fit=True)
# 4. تحويل الكائن إلى هيئة صورة (Image)
# يمكنك تغيير fill_color للون الرمز و back_color للون الخلفية
img = qr.make_image(fill_color="black", back_color="white")
# 5. حفظ الصورة في الجهاز
file_path = "qrcode.png"
img.save(file_path)
print(f"\n✅ Done! Your QR code has been saved as: {file_path}")
if __name__ == "__main__":
generate_qr()
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.