上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
摘要: 业务需求,需要爬取英雄联盟英雄的符文图片,然后在把它们拼接回去。 以下是爬取单个英雄katarina的符文图片到本地的代码,爬取地址为: http://www.op.gg/champion/katarina/statistics/mid 要爬取的图片内容为: 阅读全文
posted @ 2019-05-24 11:14 hejp 阅读(309) 评论(0) 推荐(0) 编辑
摘要: K8S服务部署安装: # 三台主机分别修改hostname # 修改hosts文件 # 关闭防火墙: # 创建/etc/sysctl.d/k8s.conf文件 # 执行命令使修改生效 # 1.2kube-proxy开启ipvs的前置条件: #所有节点关闭 swap修改/etc/fstab文件注销: 阅读全文
posted @ 2019-05-23 10:28 hejp 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 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("%... 阅读全文
posted @ 2019-05-22 17:16 hejp 阅读(137) 评论(0) 推荐(0) 编辑
摘要: import time length = 19 count = 0 while True: print('\r%s@%s' % ('#' * count, '#' * (length - count)), end='') try: time.sleep(0.3) except KeyboardInt 阅读全文
posted @ 2019-05-22 17:15 hejp 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 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: 阅读全文
posted @ 2019-05-22 17:14 hejp 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2019-05-22 17:14 hejp 阅读(124) 评论(0) 推荐(0) 编辑
摘要: randpass模块参见 https://www.cnblogs.com/hejianping/p/10881293.html 脚本名字:adduser.py 阅读全文
posted @ 2019-05-22 10:50 hejp 阅读(376) 评论(0) 推荐(0) 编辑
摘要: import sys import keyword import string first_chs = string.ascii_letters + '_' all_chs = first_chs + string.digits def check_id(idt): if keyword.iskey 阅读全文
posted @ 2019-05-22 09:46 hejp 阅读(223) 评论(0) 推荐(0) 编辑
摘要: alist = [1,2,3,'bob','alice'] print(alist) alist[0] = 10 print(alist) alist[1:3] = [20,30] print(alist) alist[2:2] = [22,24,26,28] print(alist) alist.append(100) print(alist) alist.remove(24) pr... 阅读全文
posted @ 2019-05-21 11:21 hejp 阅读(132) 评论(0) 推荐(0) 编辑
摘要: import os def get_fname(): while True: fname = input('filename: ') if not os.path.exists(fname): break print('%s already exists. Try again' % fname) ... 阅读全文
posted @ 2019-05-21 11:01 hejp 阅读(239) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页