import time,os
user_status = False
def login():
file = os.path.exists('student.txt')
if file is True:
file = open('student.txt','r+',encoding='utf8')
student_info = eval(file)
file.close()
else:
choice = input("是否選擇注冊YorN:)
file = open('student.txt','w',encoding='uft8')
if choice == 'Y':
name = input("your name:")
password = input("your password:")
user_info = {'name':name,'password':password}
user_info = str(user_info)
file.write(user_info)
file.close()
def inner() :
realname = user['name']
realpassword = user['password']
if user_status is False:
name = input('輸入你的用戶名:)
password = input('輸入你的密碼:
if name == realname and password == realpassword:
print("welcome user")
user_status = True
else:
func()
return inner
def log_1():
print('%s-%s-%s'%(a.tm_year, a.tm_mon, a.tm_mday))
@login
def log_2():
time.sleep(2)
print('%s-%s-%s' % (a.tm_year, a.tm_mon, a.tm_mday))
@login
def log_3():
time.sleep(4)
print('%s-%s-%s' % (a.tm_year, a.tm_mon, a.tm_mday))
log_1()
log_2()
log_3()
2018-11-29
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
- 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來茵典,“玉大人湘换,你說我怎么就攤上這事⊥嘲ⅲ” “怎么了彩倚?”我有些...
- 文/不壞的土叔 我叫張陵,是天一觀的道長扶平。 經(jīng)常有香客問我帆离,道長,這世上最難降的妖魔是什么结澄? 我笑而不...
- 正文 為了忘掉前任哥谷,我火速辦了婚禮,結(jié)果婚禮上麻献,老公的妹妹穿的比我還像新娘们妥。我一直安慰自己,他們只是感情好勉吻,可當(dāng)我...
- 文/花漫 我一把揭開白布监婶。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪惑惶。 梳的紋絲不亂的頭發(fā)上煮盼,一...
- 文/蒼蘭香墨 我猛地睜開眼雷绢,長吁一口氣:“原來是場噩夢啊……” “哼泛烙!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起翘紊,我...
- 正文 年R本政府宣布,位于F島的核電站倒堕,受9級特大地震影響灾测,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜垦巴,卻給世界環(huán)境...
- 文/蒙蒙 一媳搪、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧魂那,春花似錦蛾号、人聲如沸。這莊子的主人今日做“春日...
- 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春精刷,著一層夾襖步出監(jiān)牢的瞬間拗胜,已是汗流浹背。 一陣腳步聲響...