一.需求分析

  ATM机要为用户提供转账,提现,还款,付款,消费流水,操作记录等操作接口

  ATM机要为管理员提供创建用户,冻结解冻,修改额度的功能

  ATM机管理员认证使用装饰器来实现

  购物车要提供管理员和用户两个接口

  用户接口需要提供,查询余额,充值,查询用户消费记录,购物等操作接口

  商户接口需要提供,上架,下架,修改,查看上架货品等操作接口

二.流程图

三.代码实现

  工程的创建按照较为简便的格式来描述,大致目录结构如图:

ATMandShopCar/
|-- bin/
| |--
|-- DataAccess
| |--ATM_UserCard.txt
|  |--ATM_UserInfo.txt
|  |--ATM_UserOpt.txt
|  |--goods_info.txt
|  |--users_info.txt
|  |--users_value.txt
|  
|-- ShopingCar/
| |-- tests/
| | |-- __init__.py
| | |-- test_main.py
| |--ATM.py
|  |--DataAccess.py
|  |--ShoopingCar.py
| |-- __init__.py
| |-- main.py
|
|-- docs/
| |-- conf.py
| |-- abc.rst
|
|-- setup.py
|-- requirements.txt
|-- README   上述目录中最主要的部分是:
DataAccess和ShopingCar两个文件夹,DataAccess主要存放用户操作数据,俗称数据库,本工程使用文本作为存储数据的载体。ShopingCar为程序处理.py,DataAccess.py主要用于对数据库的操作,ATM.py和ShoopingCar.py分别处理相应的atm机和购物车的逻辑。main.py为主函数,处理程序主逻辑。   DataAccess.py程序代码如下:
import  os
import time
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+'/DataAccess/'#设置路径
user_status = False # 用户转账接口
def ATM_UserTranster(UserID):
#用户转账接口
#此程序接口不适用与管理数据量较大的数据,采用的是一次读取文件所有数据操作方式
with open(BASE_DIR +'ATM_Useropt.txt', 'a')as f:
info = UserID + ' ' + '转账' + ' ' + time.strftime('%Y-%m-%d-%X') + '\n'
f.write(info)
a = []
with open(BASE_DIR + 'ATM_UserCard.txt', 'r') as f:
for line in f:
a.append(line.strip().split(' '))
for i,index in enumerate(a):
if index[0] == UserID:
if index[4] == '':
print("当前账户被冻结,无法转账!")
return
Balance = int(index[5])
pos=i
print("账户\033[32;1m%s\033[0m可供转账余额为 :%s" % (UserID, Balance))
break
while True:
UserCardID = input('请输入待转账用户卡号输入q退出 :')
if UserCardID.isdigit():
for index in a :
if index[0] == UserCardID:
Value = input("请输入转账金额输q退出:")
if Value.isdigit():
Value = int(Value)
if Value>Balance:
print("操作失败,余额不足!")
else:
index[5]=str(int(index[5])+Value)
a[pos][5]=str(Balance-Value)
with open(BASE_DIR + 'ATM_UserCard.txt', 'w') as f:
for line in a:
f.write(' '.join(line)+'\n')
print("转账成功!当前账户余额为 :\033[32;1m%s\033[0m"%a[pos][5])
return
elif 'q' == Value:
break
else:
pass
elif 'q' == UserCardID:
break
else:
pass
#提现接口
def ATM_UserWithdrawal(UserID):
with open(BASE_DIR +'ATM_Useropt.txt', 'a')as f:
info = UserID+ ' '+'提现' + ' ' + time.strftime('%Y-%m-%d-%X') + '\n'
f.write(info)
a = []
with open(BASE_DIR + 'ATM_UserCard.txt', 'r') as f:
for line in f:
a.append(line.strip().split(' '))
for i,index in enumerate(a):
if index[0] == UserID:
if index[4] == '':
print("当前账户被冻结,无法提现!")
return
Balance = int(index[5])
print("账户\033[32;1m%s\033[0m可供提现金额为 :%s" % (UserID, Balance))
break
while True:
Value=input("请输入要提现的金额输入q退出:")
if Value.isdigit():
Value = int(Value)
if Value>Balance:
print("余额不足,提现失败")
else:
Balance = Balance-Value
print("提现成功,账户余额为 \033[32;1m%s\033[0m"%Balance)
elif 'q'==Value:
index[5] = str(Balance)
with open(BASE_DIR + 'ATM_UserCard.txt', 'w') as f:
for line in a:
f.write(' '.join(line) + '\n')
print("谢谢使用!")
return
break
else:
pass
#流水
def ATM_UserWater(UserName,UserID):
with open(BASE_DIR + 'ATM_Useropt.txt', 'a')as f:
info = UserID + ' ' + '查流水' + ' ' + time.strftime('%Y-%m-%d-%X') + '\n'
f.write(info)
user_info = []
with open(BASE_DIR + 'ATM_UserInfo.txt', 'r')as f:
for line in f:
user_info.append(line.strip().split(' '))
T = False
for line in user_info:
if UserName == line[0]:
T = True
print('用户 :\033[32;1m%s\033[0m 购物清单 :%s 消费 :%s 日期 :%s' % (line[0], line[1], line[2], line[3]))
if T == False:
print("用户\033[32;1m%s\033[0m无消费记录!" % UserName)
#操作记录
def ATM_UserOpt(UserID):
with open(BASE_DIR + 'ATM_Useropt.txt', 'a')as f:
info = UserID + ' ' + '查操作记录' + ' ' + time.strftime('%Y-%m-%d-%X') + '\n'
f.write(info)
user_info = []
with open(BASE_DIR + 'ATM_Useropt.txt', 'r')as f:
for line in f:
user_info.append(line.strip().split(' '))
T = False
for line in user_info:
if UserID == line[0]:
T = True
print('用户 :\033[32;1m%s\033[0m 操作内容 :%s 日期 :%s' % (line[0],line[1],line[2]))
if T == False:
print("用户\033[32;1m%s\033[0m 无操作记录!" % UserID) #还款接口
def ATM_UserReimbursement(UserID):
with open(BASE_DIR + 'ATM_Useropt.txt', 'a')as f:
info = UserID + ' ' + '还款' + ' ' + time.strftime('%Y-%m-%d-%X') + '\n'
f.write(info)
a = []
with open(BASE_DIR + 'ATM_UserCard.txt', 'r') as f:
for line in f:
a.append(line.strip().split(' '))
for i, index in enumerate(a):
if index[0] == UserID:
if index[4] == '':
print("当前账户被冻结,无法操作!")
return
Balance = 15000-int(index[5])
if Balance<0:
print("账户\033[32;1m%s\033[0m无需还款!"%UserID)
return
print("账户\033[32;1m%s\033[0m需要还款金额为 :%s" % (UserID, Balance))
break
while True:
Value = input("请输入还款金额输入q退出 :")
if Value.isdigit():
Value = int(Value)
if(int(index[5])+Value)>int(index[3]):
index[5] = str(int(index[5])+Value)
print("还款成功,当前账户活期余额为 :%s,剩余可用信用额度为 :%s"%(int(index[5])-int(index[3]),index[3]))
else:
index[5] = str(int(index[5]) + Value)
print("还需还款金额为 :%s,当前可用额度为 :%s" %(int(index[3])-int(index[5]),index[5]))
elif Value=='q':
with open(BASE_DIR + 'ATM_UserCard.txt', 'w') as f:
for line in a:
f.write(' '.join(line) + '\n')
print("谢谢使用!")
break
else:
pass
# 用户刷卡接口
# 参数:Count_Value消费金额
def ATM_ExpensePort(Count_Value):
UserInfo = []
with open(BASE_DIR + 'ATM_UserCard.txt', 'r') as f:
for line in f:
UserInfo.append(line.strip().split(' '))
while True:
UserID = input("请输入账户名称:")
Password = input("请输入密码:")
t = True
for line in UserInfo:
if line[0] == UserID and line[1] == Password:
t = False
if line[4] == '':
print("账户当前可用额度为:\033[32;1m%s\033[0m" % line[5])
if int(Count_Value) > int(line[5]):
print("账户额度不足!")
else:
line[5] = str(int(line[5]) - int(Count_Value))
print("此次消费:\033[32;1m%s\033[0m,当前额度为:\033[32;1m%s\033[0m" % (Count_Value, line[5]))
with open(BASE_DIR + 'ATM_UserCard.txt', 'w')as f:
for line in UserInfo:
f.write(' '.join(line) + '\n')
return True
else:
print("帐号已被封锁,请到柜台处理!")
return False
if t == True:
print("账户或密码错误!")
pass #认证装饰器
def login(func):
def inuc(*args, **kwargs):
_username = "alex" # 假装这是DB里存的用户信息
_password = "" # 假装这是DB里存的用户信息
global user_status
if user_status == False:
username = input("username:")
password = input("password:")
if username == _username and password == _password:
print("登入成功!")
user_status = True
if user_status == True:
func(*args, **kwargs) return inuc #添加账户
@login
def ATM_UserAdd():
a=[]
with open(BASE_DIR + 'ATM_UserCard.txt', 'r') as f:
for line in f:
a.append(line.strip().split(' '))
while True:
Value = input("请输入要注册的账号,密码,用户名,以逗号隔开,输入q退出 :")
if Value =='q':
break
else:
b=Value.split(',')
f = True
for line in a:
if line[0]==b[0]:
f = False
break
if f==False:
print("账户已存在!")
pass
else:
b.extend(['','','',time.strftime( '%Y-%m-%d-%X')])
with open(BASE_DIR + 'ATM_UserCard.txt','a')as f:
f.write(' '.join(b) + '\n')
print("用户注册成功!")
break
#用户额度管理
@login
def Account_Manage():
a = []
with open(BASE_DIR + 'ATM_UserCard.txt', 'r') as f:
for line in f:
a.append(line.strip().split(' '))
Over_Flag = False
while True:
if Over_Flag == True:
break
UserId = input("请输入用户账户:")
if UserId.isdigit():
F = False
for line in a:
if UserId == line[0]:
F = True
print("用户当前额度为:\033[32;1m%s\033[0m"%line[3])
while True:
Value = input("请输入更新额度,输入q退出:")
if Value.isdigit():
line[3] = Value
print("额度修改成功!")
elif Value=='q':
with open(BASE_DIR + 'ATM_UserCard.txt','w')as f:
for lines in a:
f.write(' '.join(lines)+'\n')
Over_Flag = True
break
else:
print("输入有误!")
break
if F == False:
print("账户不存在!")
elif UserId == 'q':
break
else:
print("输入有误!")
pass
#账户冻结
@login
def user_freeze():
a=[]
with open(BASE_DIR + 'ATM_UserCard.txt', 'r') as f:
for line in f:
a.append(line.strip().split(' '))
while True:
UserId = input("请输入用户账户:")
if UserId.isdigit():
for line in a:
if UserId == line[0]:
if line[4]=='':
print("账户当前状态为:\033[32;1m%s\033[0m" %('正常'))
else:
print("账户当前状态为:\033[32;1m%s\033[0m" %('冻结'))
while True:
Flag = input("1.冻结,2.解冻,q.退出:")
if Flag.isdigit():
if Flag =='':
line[4] = ''
print("该账户已冻结!")
elif Flag =='':
line[4] = ''
print("该账户已解冻!")
else:
pass
elif Flag == 'q':
with open(BASE_DIR + 'ATM_UserCard.txt','w')as f:
for lines in a:
f.write(' '.join(lines)+'\n')
break
else:
pass
elif Flag == 'q':
break
else:
pass #查询数据库中的数据
def search_data_access():
goods=[]
with open(BASE_DIR+'goods_info.txt','r')as f:
for line in f:
goods.append(line.strip().split(' '))
for i in range(len(goods)):
print('%s 价格 :%s 库存 :%s'%(goods[i][0],goods[i][1],goods[i][2]))
#添加商品操作
#参数说明:goodname 商品名 prace 价格 Num 库存量
def add_goods_opt(GoodName,prace,Num):
goods = []
with open(BASE_DIR+'goods_info.txt','r')as f:
for line in f:
goods.append(line.strip().split(' '))
T = False
for line in goods:
if line[0] == GoodName:
T = True
print("商品已存在,添加失败!")
return Info = GoodName+' '+str(prace)+' '+str(Num)+'\n'
with open(BASE_DIR + 'goods_info.txt', 'a')as f:
f.write(Info)
print("添加商品%s成功!" %GoodName )
#删除商品操作
def delet_goods_opt(GoodName):
goods=[]
with open(BASE_DIR+'goods_info.txt','r')as f:
for line in f:
goods.append(line.strip().split(' '))
for line in goods:
if GoodName == line[0]:
print("删除商品%s成功!"%line[0])
goods.remove(line)
with open(BASE_DIR + 'goods_info.txt', 'w')as f:
for line in goods:
f.write(' '.join(line) + '\n')
return
print("没有此商品信息,删除失败!")
#修改商品参数
#参数说明:goodname 商品名 prace 价格 Num 库存量
def Change_goods_info(GoodName,prace,Num):
goods = []
with open(BASE_DIR+'goods_info.txt','r')as f:
for line in f:
goods.append(line.strip().split(' '))
for line in goods:
if line[0] == GoodName:
line[1] = str(prace)
line[2] = str(Num)
with open(BASE_DIR+'goods_info.txt','w')as f:
for lines in goods:
f.write(' '.join(lines) + '\n')
print("商品%s参数修改成功!"%(GoodName))
return
print("数据库中没有此商品,修改失败!") #查用户余额
def user_printAccountBalance(UserName):
user_info=[]
with open(BASE_DIR + 'users_value.txt', 'r')as f:
for line in f:
user_info.append(line.strip().split(' '))
for line in user_info:
if line[0] == UserName:
print("\033[32;1m%s\033[0m的账户余额 :\033[32;1m%s\033[0m"%(UserName,line[1]))
return
#充值
# UserName :用户名,充值金额 :新老用户标识 新用户为True老用户为False
def user_TopUp(UserName,Value):
user_info = []
with open(BASE_DIR+'users_value.txt', 'r')as f:
for line in f:
user_info.append(line.strip().split(' '))
for line in user_info:
if line[0] == UserName:
line[1]=str(int(line[1])+Value)
with open(BASE_DIR+'users_value.txt', 'w')as f:
for lines in user_info:
f.write(' '.join(line) + '\n')
print("充值成功\033[32;1m%s\033[0m当前的账户余额 :\033[32;1m%s\033[0m" % (UserName, line[1]))
return
user_info = UserName + ' ' + str(Value) + '\n'
with open(BASE_DIR + 'users_value.txt', 'a')as f:
f.write(user_info)
print("新用户充值成功\033[32;1m%s\033[0m当前的账户余额 :\033[32;1m%s\033[0m" % (UserName, Value))
#查询用户消费记录
def user_RecordsConsumption(UserName):
user_info = []
with open(BASE_DIR+'users_info.txt', 'r')as f:
for line in f:
user_info.append(line.strip().split(' '))
T = False
for line in user_info:
if UserName == line[0]:
T=True
print('用户 :\033[32;1m%s\033[0m 购物清单 :%s 消费 :%s 日期 :%s'%(line[0],line[1],line[2],line[3]))
if T==False:
print("用户\033[32;1m%s\033[0m无消费记录!"%UserName)
#购物车
def user_ShoopCar(Username):
goods_info = []
ShoopCar = [] # 创建购物车列表
expense = 0
Salary = 0
Count = 0
with open(BASE_DIR + 'goods_info.txt', 'r')as f:
for line in f:
goods_info.append(line.strip().split(' '))
with open(BASE_DIR + 'users_value.txt', 'r')as f:
for line in f:
if line.split(' ')[0] == Username:
Salary = int(line.split(' ')[1])
while True:
for i, index in enumerate(goods_info):
print(i, index)
getNum = input("请输入要购买的商品编号,输入c结算,输入q退出:")
if getNum.isdigit():#
getNum=int(getNum)
Count += int(goods_info[getNum][1])
ShoopCar.append(goods_info[getNum][0])
expense += int(goods_info[getNum][1])#消费入库
if int(goods_info[getNum][2]) > 0:
goods_info[getNum][2] = str(int(goods_info[getNum][2])-1)
print("当前已消费 :\033[32;1m%s\033[0m"%Count)
elif getNum=='c':#结算
while True:
opt = input("结算方式:1.余额,2.刷卡,3.退出 :")
if opt.isdigit():
if opt=='':
if Salary < Count:
print("余额不足")
pass
else:
print("付款成功,当前余额为:\033[32;1m%s\033[0m"%(Salary-Count))
with open(BASE_DIR + 'users_info.txt', 'a')as f:
f.write(Username + ' ' + ','.join(ShoopCar) + ' ' + str(expense) + ' ' + time.strftime('%Y-%m-%d-%X') + '\n')
with open(BASE_DIR+'goods_info.txt', 'w')as f:
for line in goods_info:
f.write(' '.join(line)+'\n')
value_info = []
with open(BASE_DIR+'users_value.txt', 'r')as f:
for line in f:
value_info.append(line.strip().split(' '))
for line in value_info:
if line[0] == Username:
line[1] = str(Salary-Count)
with open(BASE_DIR + 'users_value.txt', 'w')as f:
for line in value_info:
f.write(' '.join(line) + '\n')
elif opt == '':#刷卡
if ATM_ExpensePort(Count)==True:#刷卡接口
with open(BASE_DIR + 'ATM_UserInfo.txt', 'a')as f:
f.write(Username + ' ' + ','.join(ShoopCar) + ' ' + str(expense) + ' ' + time.strftime('%Y-%m-%d-%X') + '\n')
with open(BASE_DIR + 'users_info.txt', 'a')as f:
f.write(Username + ' ' + ','.join(ShoopCar) + ' ' + str(expense) + ' ' + time.strftime('%Y-%m-%d-%X') + '\n')
with open(BASE_DIR+'goods_info.txt', 'w')as f:
for line in goods_info:
f.write(' '.join(line)+'\n')
elif opt == '':
return
else:
pass
break
elif getNum=='q':#退出
break
else:
pass

  ATM.py程序代码如下:

from ATMandShoopCar.ShoopingCar import DataAccess
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+'/DataAccess/'#设置路径 #ATM操作
def ATM_Opt():
a=[]
with open(BASE_DIR+'ATM_UserCard.txt','r')as f:
for line in f:
a.append(line.strip().split(' '))
while True:
opt = input("1.用户选项,2.管理员选项,输入q退出:")
if opt.isdigit():
if opt =='':#用户选项
while True:
username=input("请输入用户账号,输入q退出:")
if username=='q':break
password=input("请输入密码,输入q退出:")
if password=='q':
break
T = False
for line in a:
if line[0]==username and line[1]==password:
T = True
print("登入成功!!!")
while True:
Chose =input("1.转账,2.提现,3.消费流水,4.还款,5.用户操作记录,输入q退出: ")
if Chose.isdigit():
if Chose=='':
DataAccess.ATM_UserTranster(username)#转账
elif Chose=='':
DataAccess.ATM_UserWithdrawal(username)#提现
elif Chose=='':
Username=input("请输入用户名:")
DataAccess.ATM_UserWater(Username,username)#消费流水
elif Chose=='':
DataAccess.ATM_UserReimbursement(username)#还款
elif Chose=='':
DataAccess.ATM_UserOpt(username)#用户操作记录
else:
pass elif Chose=='q':
break
else:
pass
break
if T ==False:
print("账号密码错误!!")
elif opt=='':#管理员选项
while True:
Chose = input("1.添加账户,2.用户额度管理,3.账户冻结,输入q退出: ")
if Chose.isdigit():
if Chose == '':
DataAccess.ATM_UserAdd()#账户添加
elif Chose =='':
DataAccess.Account_Manage()
elif Chose =='':
DataAccess.user_freeze()
else:
pass elif Chose =='q':
global user_status
user_status = False
break
else:
pass
else:
pass
elif opt=='q':
break
else:
pass

  ShoopingCar.py程序代码如下:

from ATMandShoopCar.ShoopingCar import DataAccess

def ShoopingCar_Opt():
while True:
Num=input("1.用户界面,2.商家界面,输入q退出 :")
if Num.isdigit():
Num = int(Num)
if Num == 1:
username = input("Please Input The Username :")
DataAccess.user_printAccountBalance(username)
while True:
UserChoose = input("1.查询购物记录,2.购物,3.充值,输入q返回上级目录 :")
if UserChoose.isdigit():
UserChoose = int(UserChoose)
if UserChoose == 1:
DataAccess.user_RecordsConsumption(username)#查询购物记录
break
elif UserChoose == 2:
DataAccess.user_ShoopCar(username)#购物车
break
elif UserChoose == 3:
value = int(input("请输入充值金额 :"))
DataAccess.user_TopUp(username, value)#充值
elif UserChoose=='q':
break
else:
pass elif Num == 2:#商家界面
DataAccess.search_data_access()#打印商品信息和库存
while True:
UserChoose = input("1.添加商品,2.修改商品信息,3.删除商品,输入q返回上级目录 :")
if UserChoose.isdigit():
UserChoose = int(UserChoose)
if UserChoose==1:
goodsname=input("请输入商品名 :")
goodsvalue=int(input("请输入商品价格 :"))
goodnum = int(input("请输入商品数量 :"))
DataAccess.add_goods_opt(goodsname, goodsvalue, goodnum)#商品添加操作
elif UserChoose==2:
goodsname = input("请输入要修改的商品名 :")
goodsvalue = int(input("请输入商品价格 :"))
goodnum = int(input("请输入商品数量 :"))
DataAccess.Change_goods_info(goodsname, goodsvalue, goodnum)
elif UserChoose==3:
goodsname = input("请输入要删除的商品名 :")
DataAccess.delet_goods_opt(goodsname)
elif UserChoose=='q':
break
else:
pass
else:
pass
elif Num == 'q':
break
else:
pass

  main.py程序代码如下:

from ATMandShoopCar.ShoopingCar import ShoopingCar
from ATMandShoopCar.ShoopingCar import ATM def main():
while True:
opt=input("1.ATM,2.购物车,输入q退出:")
if opt.isdigit():
if opt =='':
ATM.ATM_Opt()
elif opt=='':
ShoopingCar.ShoopingCar_Opt()
else:
pass
elif opt=='q':
break
else:
pass main()

  数据库ATM_Use'rCard.txt格式如图:

  数据库ATM_Use'rInfo.txt格式如图:

  数据库ATM_UserOpt.txt格式如图:

  数据库goods_info.txt格式如图:

  数据库users_info.txt格式如图:

 数据库users_value.txt格式如图:


 

python实现atm机基本操作及购物车的更多相关文章

  1. python ATM机 案例代码

    利用目前学的流程控制写的 ''' ATM机 需求: 1.登陆 输入账号输入密码 每日只有3次登陆密码错误的机会,超过3次禁止登陆 2.查询余额 3.存款 4.取款 5.转帐 6.退出 ''' info ...

  2. 模块购物商城和ATM机代码:

    http://outofmemory.cn/python/video/let-us-python/ python为程序员服务  快来加入群[python爬虫交流群](群号570070796),发现精彩 ...

  3. 模拟ATM机银行系统

    淄博汉企Java基础考核项目 模拟银行自助终端系统 一. 本系统模拟银行用户使用ATM机开户.查询.存款.取款功能,要求使用java语言编程实现. 说明: 1. 对于数据输入异常,可使用java异常处 ...

  4. JAVA - ATM机程序

    ATM机程序 UnionPayTest.java package oo.day06.work; public class UnionPayTest { } interface UnionPay{ // ...

  5. 基于python的堡垒机

    一 堡垒机的架构 堡垒机的核心架构通常如下图所示: 二.堡垒机的一般执行流程 管理员为用户在服务器上创建账号(将公钥放置服务器,或者使用用户名密码) 用户登陆堡垒机,输入堡垒机用户名密码,显示当前用户 ...

  6. 连接数据库——模拟ATM机查、存、取、开户功能

    1.界面:包含开户.查询.存款.取款.功能 package com.bank.test; /** * * @author Administrator *界面类 */ public class Jiem ...

  7. 在.bashrc中,使用python获取本机IP地址(现在只支持wlan)

    其实最好的办法是写个单独的脚本去查找IP,但是如果实在不愿意单写一个脚本文件,也可以直接将代码嵌入.bashrc中 在~/.bashrc下加入下面这行代码即可使用python获取本机的wlan的IP地 ...

  8. 第一次尝试使用JAVA编写的ATM机程序

    package study; import java.util.Scanner; public class ATM { private static int[] users = { 111111, 2 ...

  9. python获取本机IP、mac地址、计算机名

    在python中获取ip地址和在php中有很大不同,在php中往往比较简单.那再python中怎么做呢? 我们先来看一下python 获得本机MAC地址: 1 2 3 4 import uuid de ...

随机推荐

  1. UVa 11440 - Help Tomisu(欧拉函数 + 问题转换)

    链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  2. 【转】iOS - SQLite 数据库存储

    本文目录 1.SQLite 数据库 2.iOS 自带 SQLite 的使用 3.fmdb 的使用 4.fmdb 多线程操作 5.其他 SQLite 的第三方封装库 回到顶部 1.SQLite 数据库 ...

  3. HBase学习之路 (五)MapReduce操作Hbase

    MapReduce从HDFS读取数据存储到HBase中 现有HDFS中有一个student.txt文件,格式如下 95002,刘晨,女,19,IS 95017,王风娟,女,18,IS 95018,王一 ...

  4. SQL Server 断开某个数据库所有连接(还原的时候需要)

    问题描述: SQL Server数据库备份还原后,在数据库名称后会出现“受限制访问”字样 解决办法: 右键点击数据库 -> 属性 -> 选项 -> 状态 -> 限制访问 -&g ...

  5. h5py

    解决办法: sudo apt-get install libhdf5-dev sudo apt-get install python-h5py

  6. python list 使用技巧

    格式:list[start:stop:step] 示例:a =list(range(0,10))print(a[1:8:2]) #[1, 3, 5, 7]print(a[:8:2]) #[0, 2, ...

  7. jenkins+pytest+ allure运行多个py文件测试用例

    jenkins的pytest运行多个py文件,导出allure报告方法,只需改下job的配置中的构建即可(pytest会运行指定文件下的所有test开头的py文件),如下:              ...

  8. POJ 1080( LCS变形)

    题目链接: http://poj.org/problem?id=1080 Human Gene Functions Time Limit: 1000MS   Memory Limit: 10000K ...

  9. iOS 多线程:『RunLoop』详尽总结

    1. RunLoop 简介 1.1 什么是 RunLoop? 可以理解为字面意思:Run 表示运行,Loop 表示循环.结合在一起就是运行的循环的意思.哈哈,我更愿意翻译为『跑圈』.直观理解就像是不停 ...

  10. [控件] Firemonkey 跨平台 Toast

    控件说明:一个简单的讯息提示功能,使用 FMX 基本控件,因此支持 Win, macOS, iOS, Android 平台. 已知问题:如果使用了 WebBrowser, MapView... 等原生 ...