The other day, I went to a nearby dry cleaner to take out my clothes under the direction of my wife.
Saturday after the new year.
Probably the day when the most customers will come.
However, there is one part-time lady there.
The customers are coming.
Well, that's right.
And, behind the customer, I'm back. .. I wonder if the phone rings insanely.
But I'm too busy to pick up the phone. ..
No human being can do this together.
~~ In the first place, is this a shift mistake of the store owner or the store manager? ?? ~~
I wondered if this situation could be dealt with by systematic improvement.
In the previous article, you can easily publish the QR code in Python. I wrote an article called, so it's an application.
・ When cleaning is completed, add a service to call, email, or SMS as an option. (It's impossible for everyone ~~ It's annoying ~~, so it's just an option) Put a QR code on your clothes and hold it over your smartphone so that you can contact customers by email, SMS, or phone.
・ The QR code will be automatically issued when the customer's information is registered. Simple management.
Python 3.7.6 macOS Mojave 10.14.6
Import the required libraries first. (Install with pip if not included)
・ Qrcode for QR code creation ・ Datetime to enter the date and time at the time of customer registration ・ Csv for creating a database using CSV
customerdata.py
import qrcode
import datetime
import csv
Set to ask the customer database for the required information. Listen to the necessary information so that you can email, SMS, or call.
customerdata.py
name=input('Your name is?')
address=input('address?')
age=input('How old are you?')
tel=input('telephone number is?')
mail=input('Mail is?')
#Set the date and time to be registered in the database
dt_now=datetime.datetime.now()
dt=dt_now.strftime('%Y year%m month%d day%H o'clock%M minutes')
The QR code is set so that the name, phone number, email, address, and registration date and time are displayed. The name of the automatically issued img file is output by the person's name and phone number so that text search (by name and phone number) can be performed later.
customerdata.py
img=qrcode.make( 'phone number: ' + str(tel) +'Email: ' +str(mail)+'Full name:'+str(name) + 'Street address:'+ str(address)+'Creation date and time:'+ str(dt))
img.save(str(name)+str(tel))
#Register the QR code name with your name and phone number so that you can search the text later.
Register information in CSV. (Customer_data.csv)
customerdata.py
with open('customer_data.csv','a') as f:
writer = csv.writer(f)
#The next line is for initial registration only. Comment out when registering for the second time or later! !!
writer.writerow(['Full name','age','Street address','phone number','Email','Registration date'])
writer.writerow([str(name),str(age),str(address),str(tel),str(mail),str(dt)])
f.close()
Run it on the command line.
commandline
(kyoto) MacBook-Air% python3 customerdata.py
Your name is?Taro Tanaka
address? Kyoto City A Town B Street
How old are you? 40
telephone number is? 090-000-0000
Mail [email protected]
Registered in the database like this.
At the same time, a QR code will be issued automatically.
Information will come out when you hold it over your iPhone and read the QR code.
customerdata.py
import qrcode
import datetime
import csv
name=input('Your name is?')
address=input('address?')
age=input('How old are you?')
tel=input('telephone number is?')
mail=input('Mail is?')
dt_now=datetime.datetime.now()
dt=dt_now.strftime('%Y year%m month%d day%H o'clock%M minutes')
img=qrcode.make( 'phone number: ' + str(tel) +'Email: ' +str(mail)+'Full name:'+str(name) + 'Street address:'+ str(address)+'Creation date and time:'+ str(dt))
img.save(str(name)+str(tel))
with open('customer_data.csv','a') as f:
writer = csv.writer(f)
#The next line is for initial registration only. Comment out when registering for the second time or later! !!
writer.writerow(['Full name','age','Street address','phone number','Email','Registration date'])
writer.writerow([str(name),str(age),str(address),str(tel),str(mail),str(dt)])
f.close()
Creating a database and automatically issuing a QR code can be applied in many other ways. Food delivery, prevention of wandering in elderly people with dementia, allergy and drug contraindications.
I would be grateful if you could give us comments that are expandable and expandable so that you can use it like this.
Recommended Posts