Project With Real BarCode Scanner? Billing System Python
HTML-код
- Опубликовано: 26 окт 2021
- Festivals are a great time to clean house, During that I found a very old barcode scanner - Used my coding skills to create a Project Project and reusing an electrical device.
Here is the Code for your reference :)
items = {"SWCFP100106264":{"name":"Watch","price":4000},
"SFQDYRHXVGWTJ":{"name":"Apple Pencil","price":8000},
"9780241470046":{"name":"The Practice","price":500},
"9781847941831":{"name":"Atomic Habits","price":500},
"1SGY50X88832Z13GRT42":{"name":"Mouse","price":1500},
"4005900144652":{"name":"Cream","price":100},
"190198648891":{"name":"iPad","price":10000},
}
total_bill = 0
bill = []
while True:
print("Scan your BarCode")
value = input()
end_code = "9781492090793"
if value == end_code:
print("Shopping Done")
break
for key in items.keys():
if key==value:
item = items[key]
print(f"This is:{item['name']}, Price is: {item['price']}")
total_bill+=item['price']
bill.append(item)
break
else:
print("Item Not Found",value)
for i,item in enumerate(bill):
print(f"{i+1}. {item['name']}, {item['price']}")
print(f'
Your Total Cost is: Rs.{total_bill}')
Thank you for real. Dad told me to write a program or his business and I'm glad I don't have to do any work!
Thank you Sir for you practical and easy to follow video 😊🙏
EDIT: This also worked for my plug and play EYOYO 2D Barcode Scanner Model: EY-H2 that I'm using to develop a simple Warehouse Inventory System. Thank you Thank you Thank you Sir. I'm so excited about the project 😊🙏
I am glad, this video was helpful to you, :) keep developing.
You're awesome, great video, really makes this all look much more approachable and understandable, thanks for making this!
Thanks Patt, Glad you enjoyed it!
Kaafi awesome!
Thanks!!
Great 👍
Thank you 👍
Nice video! I was wondering, how do you make the application run in the background? How do I make it read the input while I’m on another application?
You can explore cronjob in linux, or autostart features to try that. But since it reads input as text, so it may interfere with other apps. It needs cursor on the text box only. Thats my intuition, Try it and we can discuss further 😌
nice but sir also create a user input to save the barcode items in dictionary and then how to retrieve that data in same ...
Nice!😊
Thanks! 😄
The the barcode scanner just put the number into a text file automatically? or did you have to program that part as well?
Yes - it just scans the number and electronics from barcode converts it to text instantly. Very cool piece of tech.
this video help full 100 *100%
Welcome 😊
Which library you use to connect scanner to python
Glad you liked the video, as explained in video barcode scanner "types the number value" just like you would "type from keyboard." So no library needed for reading the input. You can write a while loop in python, where you wait for user to input the number. Then you can execute SQL query or whatever you want with it.
@@VinayVerma982 oh it's work as keyboard , thank you ♥️
Can you scan a Python restaurant ticket slip? Find out how many of each product is requested and how much the total cost is.
Yes, one way for that is you can embed that information in QR code, then can scan it. 😊
Did the reader collect only code or price and name also??
Hi, Reader just collects the serial numer of the product - In the computer the price and name is saved for the serial number. It maps it directly.
Thanks for watching.
hi can u make a video of this intended for attendance
Thanks, Yes we can make a video for attendence. But how you will attach Barcode to employees.
can you share your project, if need i will pay for it to study
for further queries mail at: vermavinay982@gmail.com
Bro source code ??
Unfortunately cant find the code, you please code it and put it on your github. I will mention your profile. 😊
@@VinayVerma982 okay , sure..
@@smarttech5736 BRO, source code