python 收银系统_python 编程练习——根据一张单据设计点单收银系统

import time

import datetime

# # 创建shop_goods.txt文件用于存放商品信息

# with open('shop_goods.txt', 'w') as goods_flie:

# pass

# # 创建consumption_records.txt文件用于存放用户的购买记录

# with open('consumption_records.txt', 'w') as cmr_flie:

# pass

# # 创建daily_sale.txt文件用来存放每日销售情况

# with open('daily_sale.txt', 'w') as ds_file:

# pass

dict = {} # 用来存放顾客消费记录

total = 0 # 存放总金额

dict_save = {} # 统计当日销售情况

def showGoods():

with open('shop_goods.txt', 'r', encoding='utf-8') as rstream:

goodsFile = rstream.read()

if len(goodsFile) == 0:

print('请先添加商品!')

else:

print('商品信息如下!')

str = '%s\t%s\t%s\t%s' % ('编号', '名称', '单价', '数量')

print(str)

print("*" * 30)

print(goodsFile)

print('*' * 30)

def addGoods():

id = input('请输入商品编号:')

name = input('请输入商品名称:')

goods_save = []

with open('shop_goods.txt', 'r', encoding='utf-8') as rstream:

while True:

goodsFile = rstream.readlines()

if not good

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值