E
E
Enalenaral2022-03-01 18:52:20
Python
Enalenaral, 2022-03-01 18:52:20

How to bind random to qr code in python?

users = surname + " " + name + "/" + grade + "/" + day + "/" + number
img = qrcode.make(users)
img.save('qr_code.png')
bot.send_photo(call. message.chat.id, open('qr_code.png', 'rb'))

# should be a random number instead of number

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Nesterov, 2022-03-01
@AlexNest

1. Forget about the bot.
2. Learn the basics of python. Specifically on the topic of the question:
- What are variables;
- What type are there;
- Basic operations with variables;
- The random module and its methods;
3. Return to the bot and solve this elementary task.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question