会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
白杨
坚持努力和学习,从容对待,厚积薄发,相信自己,你想要的,终究会来!
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
12
下一页
2019年5月24日
04-爬取单个英雄联盟英雄的符文图片
摘要: 业务需求,需要爬取英雄联盟英雄的符文图片,然后在把它们拼接回去。 以下是爬取单个英雄katarina的符文图片到本地的代码,爬取地址为: http://www.op.gg/champion/katarina/statistics/mid 要爬取的图片内容为:
阅读全文
posted @ 2019-05-24 11:14 hejp
阅读(315)
评论(0)
推荐(0)
2019年5月23日
02-使用kubeadm安装K8S的1.13.1环境
摘要: K8S服务部署安装: # 三台主机分别修改hostname # 修改hosts文件 # 关闭防火墙: # 创建/etc/sysctl.d/k8s.conf文件 # 执行命令使修改生效 # 1.2kube-proxy开启ipvs的前置条件: #所有节点关闭 swap修改/etc/fstab文件注销:
阅读全文
posted @ 2019-05-23 10:28 hejp
阅读(311)
评论(0)
推荐(0)
2019年5月22日
50-Python字典的基础
摘要: 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
阅读(139)
评论(0)
推荐(0)
49-输出@从一行#中穿过
摘要: 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
阅读(118)
评论(0)
推荐(0)
47-使用列表进行模拟栈
摘要: 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
阅读(130)
评论(0)
推荐(0)
48-如何实现unix2dos功能
摘要: 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
阅读(184)
评论(0)
推荐(0)
46-使用传参输入用户名并自动生成随机密码
摘要: randpass模块参见 https://www.cnblogs.com/hejianping/p/10881293.html 脚本名字:adduser.py
阅读全文
posted @ 2019-05-22 10:50 hejp
阅读(390)
评论(0)
推荐(0)
45-合法标识符检查
摘要: 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
阅读(229)
评论(0)
推荐(0)
2019年5月21日
44-列表使用
摘要: 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
阅读(134)
评论(0)
推荐(0)
43-简单的文本文件生成
摘要: 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
阅读(244)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
12
下一页
公告