Reading two files?
I will be very grateful to get help about this script.
Apython script which can be used to have a convenient format to print the bill in a store. Your script is reading two files:
The first one is containing a list of lines and each line contains four fields: and ID number identifying each article, the name of the article, the category (i.e food, frozen food, house equipment, clothes,. . . ) and finally the price like:
A233 Apple FOOD 5.00 A345 Blanck CD 10 DATA 0.25 B453 Pasta FOOD 12.00 T545 USB-Memory 16GB DATA 25
The second file is provided by the cash machine and contains the list of ID numbers produced by the cash machine. (It’s possible that the same ID appears more than once if the buyer bought several items of the same product):
A233 T545 A354 A233 B453
The script is to produce a nice bill (we can simulated it to the screen) such the following example: (the format is just one example, the most important are the different fields). For each category products should sorted according their names and cotegories according their sum (the most expensive last). You can see an example below:
---- FOOD --------- Product Qty Price/each Price total Apple 2 5.00 10.00 Pasta 1 12.00 12.00 SUM: 17.00 --------- DATA Blank CD 10 0.25 2.50 USB-Memory 16GB 1 25 25 SUM: 27.50 Nomber of articles: 14 Price to pay: 44.50
** I appreciate your help**
Edited by tony75