摘要:
adict = dict() # {} dict(['ab', 'cd']) bdict = dict([('name', 'bob'),('age', 25)]) {}.fromkeys(['zhangsan', 'lisi', 'wangwu'], 11) for key in bdict: print('%s: %s' % (key, bdict[key])) print("%... 阅读全文
摘要:
import time length = 19 count = 0 while True: print('\r%s@%s' % ('#' * count, '#' * (length - count)), end='') try: time.sleep(0.3) except KeyboardInt 阅读全文
摘要:
stack = [] def push_it(): item = input('item to push: ') stack.append(item) def pop_it(): if stack: print("from stack popped %s" % stack.pop()) def vi 阅读全文
摘要:
import sys def unix2dos(fname): dst_fname = fname + '.txt' with open(fname) as src_fobj: with open(dst_fname, 'w') as dst_fobj: for line in src_fobj: 阅读全文
摘要:
randpass模块参见 https://www.cnblogs.com/hejianping/p/10881293.html 脚本名字:adduser.py 阅读全文
摘要:
import sys import keyword import string first_chs = string.ascii_letters + '_' all_chs = first_chs + string.digits def check_id(idt): if keyword.iskey 阅读全文