amitt001 / amitt001/delegator.py
My work make URL. py
- Lenguaje dominante
- Python
- Estrellas
- 1.7k
- Forks
- 86
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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()
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.