开始学习python!day1作业。学习ing!

# -*- coding:UTF-8 -*-
import time
bl=open('b.txt','a')
wl=open('w.txt','a')

for i in range(3):
name=raw_input("please input your name:")
ps=raw_input('please input ps:')
for line in open('b.txt','r+'):
if name==line.strip():
print('Black List!')
break
else:
if(name=='admin' and ps=='123'):
print('login sucess!')
wl.write( "Welcome:%s,time:%s\n" %(name,time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())))
wl.close()
break;
else:
print ('wrong ps or name!')
else:
bl.write(name+'\n')
bl.close()
posted @ 2017-12-01 16:44  bigsnowball  阅读(131)  评论(0)    收藏  举报