LOGIN_FLAG = CURRENT_USER =outer(func): inner(): LOGIN_FLAG () LOGIN_FLAG: : login_part() func() inner login_part(): LOGIN_FLAG CURRENT_USER arg_name = () arg_password = () (,) f: line_raw f: line = line_raw.strip().split() arg_name == line[]: arg_password == line[]: (%(line[])) CURRENT_USER = line[] LOGIN_FLAG = : () LOGIN_FLAG == : arg= () .upper(arg) == : () register_part() : () register_part(): arg_name = () (,) f: line_raw f: line = line_raw.strip().split() arg_name == line[]: () () arg_password = () arg_mail = () arg_mail: () () arg_cell = () arg_cell.isdigit() (arg_cell) == : arg_right = () right_symbol = .upper(arg_right) == : () adm_account = () adm_password = () (,) f: line_raw f: line = line_raw.strip().split() line[-] == line[] == adm_account line[] == adm_password: right_symbol = right_symbol != : () () .upper(arg_right) == : right_symbol = : () () (,) f: line = arg_name++arg_password++arg_mail++arg_cell++right_symbol+f.write(line) @change_part(): CURRENT_USER line_new = (,) f: line_raw f: line = line_raw.strip().split() line[] == CURRENT_USER: line[] = () line_tmp = .join(line) line_new+= line_tmp+: line_new+=line_raw (,) f: f.write(line_new) @list_part(): (,) f: line_raw f: line = line_raw.strip().split() line[] == CURRENT_USER line[-] == : (%(line[],line[],line[],line[])) line[] == CURRENT_USER line[-] == : (%(line[],line[],line[],line[])) @promote_part(): CURRENT_USER line_new = (,) f: line_raw f: line = line_raw.strip().split() line[] == CURRENT_USER line[-] == : promote_account = () : () () (,) f: line_raw f: line = line_raw.strip().split() line[] == promote_account: line[-] = line_tmp = .join(line) line_new+=line_tmp+: line_new+=line_raw (,) f: f.write(line_new) @del_part(): CURRENT_USER line_new = (,) f: line_raw f: line = line_raw.strip().split() line[] == CURRENT_USER line[-] == : del_account = () : () () (,) f: line_raw f: line = line_raw.strip().split() line[] == del_account: () : line_new+=line_raw (,) f: f.write(line_new) search_part(): arg = () result=arg == : arg_key = () arg_key.isdigit() (arg_key) >: key_len = (arg_key) (,) f: line_raw f: line = line_raw.strip().split() line[][:key_len]==arg_key: result+=line_raw arg == : arg_key = () (arg_key) >: = (arg_key) (,) f: line_raw f: line = line_raw.strip().split() line1 = line[].split() line1[]==arg_key: result+=line_raw : () (%(result)) main(): LOGIN_FLAG CURRENT_USER : () arg = (()) arg == : login_part() arg == : register_part() arg == : change_part() arg == : list_part() arg == : promote_part() arg == : del_part() arg == : search_part() arg == : (%CURRENT_USER) LOGIN_FLAG = CURRENT_USER =arg == : () main()
时间: 2025-01-01 18:24:08