主入口文件:
enter,operate __name__ == : () enter.user() : operate.welcome()
|
逻辑处理文件
huowu = { : , :, :, :, :, } huo = { } name = [] welcome(): enter,os,lists s_1 = ()s_1 == : enter.catg() s_1 == : () s_1 == : enter.mone() s_1 == : () enter.shopp() s_1 == : enter.dele() s_1 == : enter.topup() s_1 == : b_1 = b_1.format(= name[],= lists.die[]) s_1 == : enter.login() s_1 == : os._exit()
|
函数文件
(,)u_1 : ss = u_1.readlines() dic = () lind ss: lind = lind.strip().split() dic[lind[]] = lind[] welcome(wel): sent = aa = (sent.format(=wel)) scr = text = (aa)-box = text left = (scr - box) // * left + + *(box) + * left + + *text + * left + +aa + * left + + *text + * left + + *(box) + user(): operate : user_1 = () user_2 = () operate.name.append(user_1) user_1 dic.keys(): passw = dic[user_1] user_2 == passw: welcome(user_1) : ()() : ()() shopp(): operate operate.huo: (): cart() shop_1 = () shop_1 == :deal() shop_1 == :() cart(): operate shop_1 = sho_1 operate.huo.keys(): sho_1 operate.huowu.keys(): sh_2 = (sho_1) sh_3 = -sh_2 ca_4 = (+*sh_3+)ca_4.format(=shop_1,=sho_1,=operate.huo[sho_1])shop_1 += deal(): operate,lists aas = (lists.die[]) sa operate.huo.keys(): sa_1 = (operate.huo[sa]) aas >= sa_1: aas = aas - sa_1 lists.die[] = aas operate.huo[sa] ss_1 = ss_1.format(=sa,=sa_1) :ss_2 = ss_2.format(=sa,=sa_1)clo = lists.dia.index(lists.aaa) f=(,) flist=f.readlines() aa = flist[clo]= aa.format(=lists.die[],=lists.die[],=lists.die[])f=(,) f.writelines(flist) f.close()() dele(): operate operate.huo: () : cart() :saa = ()saa == :saa operate.huo.keys():operate.huo[saa] () saa_1 = () saa_1 == : : topup(): listsclb = lists.dia.index(lists.aaa) : q_1 = () q_2 = .isdigit(q_1) q_1 == : q_2 == : q_1 = (q_1) q_3 = (q_1) q_3 == : lists.die[] = (lists.die[]) lists.die[] = lists.die[] + q_1 f=(,) flist=f.readlines() aa = flist[clb]= aa.format(=lists.die[],=lists.die[],=lists.die[])f=(,) f.writelines(flist) f.close() vv_1 = () (vv_1.format(=q_1,=lists.die[])) :() :() catg(): operate()car = ca_1 operate.huowu:ca_2 = (ca_1) ca_3 = -ca_2 ca_4 = (+*ca_3+)ca_4.format(=car,=ca_1,=operate.huowu[ca_1])car += () mone(): operate :mon = ()mon operate.huo.keys(): () mon operate.huowu.keys():() operate.huo[mon] = operate.huowu[mon] mon == :() :() login(): lists : (,)u_3: ads = u_3.readlines() diz = [] lin ads: lin = lin.strip().split() diz.append(lin[]) w_1 = ()w_1 diz:() w_1 == : : w_2 = ()w_3 = (w_2)w_3 > :output = (, ) aa = flist= aa.format(=w_1,=w_2,=)output.write(flist) output.close()ll = ll.format(=w_1) : () |
全局调用的文件
operate aaa = operate.name[] (,)u_2 : ss = u_2.readlines() die = [] line ss: aaa line: line = line.strip().split() die.append(line[]) die.append(line[]) die.append(line[]) (,)u_3: ads = u_3.readlines() dia = [] lin ads: lin = lin.strip().split() dia.append(lin[]) |
用户信息保存在users下
数据结构
admin:123.com:10000 用户,密码,余额
本文出自 “刘明远的博客” 博客,请务必保留此出处http://liumingyuan.blog.51cto.com/9065923/1735211
原文:http://liumingyuan.blog.51cto.com/9065923/1735211