首页
学习
活动
专区
工具
TVP
发布

sktj

专栏作者
1542
文章
1895531
阅读量
34
订阅数
Ansible-playbook 并发运行async、poll(
ansible默认只会创建5个进程,所以一次任务只能同时控制5台机器执行.那如果你有大量的机器需要控制,或者你希望减少进程数,那你可以采取异步执行.ansible的模块可以把task放进后台,然后轮询它.这使得在一定进程数下能让大量需要的机器同时运作起来.
用户5760343
2022-05-24
1.1K0
python学习手册(第四版)(基础类型)
python如何运行、类型与运算、控制语句、函数与参数、模块与类、异常 programming python /python pocket reference/python in a nutshell/python essential reference/python cookbook 1、编译器:cpython、jpython、ironpython 2、将字节码和PVM混合起来,形成冻结二进制文件的工具:py2exe、PyInstaller 3、input() 等待输入,避免自动关闭CMD 4、import math;math.pi; math.sqrt(111); import random; random.random(); ramdom.choice([1,2,3,4]) s="abc" len(s) s[0] s[-1] last one s[-2] the second to last s[1:3] 1,2 不包括3 s.find('aa') s.replace('pa','xy') s.split(',') s.upper() s.isalpha() s.rstrip() '{0},egs,{1}'.format('a','b') //help(s.replace) import re
用户5760343
2022-05-14
3210
python docx
https://blog.csdn.net/sinat_37005367/article/details/77855359
用户5760343
2022-05-14
4950
python more的一部分功能 脚本
split and interactively page a string or file of text
用户5760343
2022-05-13
2770
python json
s=""" { "error_code": 0, "stu_info": [ { "id": 309, "name": "小白", "sex": "男", "age": 28, "addr": "河南省济源市北海大道32号", "grade": "天蝎座", "phone": "18512572946", "gold": 100 }, { "id": 310, "name": "小白", "sex": "男", "age": 28, "addr": "河南省济源市北海大道32号", "grade": "天蝎座", "phone": "18516572946", "gold": 100 } ] } """ 1、用json.loads载入j'son格式的字符串,转成字典 import json#引用json模块 res=json.loads(s) print(res)#打印字典 print(type(res))#打印res类型 print(res.keys())#打印字典的所有Key 2、json.load从文件中读入json格式字符串 import json f=open('stus.json',encoding='utf-8') user_dic=json.load(f) print(user_dic) 3、json.dumps 将字典转成json格式字符串 stus={'xiaojun':'123456','xiaohei':'7891','abc':'11111'}
用户5760343
2022-05-13
7040
python 查找文件脚本 find.py
""" ################################################################################ Return all files matching a filename pattern at and below a root directory;
用户5760343
2022-05-13
3980
python 文件合并 脚本
""" ################################################################################ join all part files in a dir created by split.py, to re-create file. This is roughly like a 'cat fromdir/* > tofile' command on unix, but is more portable and configurable, and exports the join operation as a reusable function. Relies on sort order of filenames: must be same length. Could extend split/join to pop up Tkinter file selectors. ################################################################################ """
用户5760343
2022-05-13
9660
python 文件分割 脚本
""" ################################################################################ split a file into a set of parts; join.py puts them back together; this is a customizable version of the standard Unix split command-line utility; because it is written in Python, it also works on Windows and can be easily modified; because it exports a function, its logic can also be imported and reused in other applications; ################################################################################ """
用户5760343
2022-05-13
8080
python 编辑框 text
print('PP4E scrolledtext') from tkinter import *
用户5760343
2022-05-13
8540
python scroll listbox 例子
"a simple customizable scrolled listbox component"
用户5760343
2022-05-13
7790
python guimixin 消息调用 工具dialog封装
""" ############################################################################### a "mixin" class for other frames: common methods for canned dialogs, spawning programs, simple text viewers, etc; this class must be mixed with a Frame (or a subclass derived from Frame) for its quit method ############################################################################### """
用户5760343
2022-05-13
2710
python scoll canvas
"a simple vertically-scrollable canvas component and demo"
用户5760343
2022-05-13
2630
python 简易编辑器 text
print('PP4E scrolledtext') from tkinter import *
用户5760343
2022-05-13
4040
python pyphoto图片查看器
""" ############################################################################ PyPhoto 1.1: thumbnail image viewer with resizing and saves.
用户5760343
2022-05-13
1.2K0
python swig 调用C/C++接口
当你觉得python慢的时候,当你的c/c++代码难以用在python上的时候,你可能会注意这篇文章。swig是一个可以把c/c++代码封装为python库的工具。(本文封装为python3的库)
用户5760343
2022-05-13
5900
bootstrap menu常用样式 1
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Bootstrap 实例 - 默认的导航栏</title> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body>
用户5760343
2022-01-10
6500
bootstrap 响应式工具
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Bootstrap 实例 - 响应式实用工具</title> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body>
用户5760343
2022-01-10
5960
python scrapy 模拟登录(手动登录保存cookie)
先登录网页,获取cookie,然后转化为字典,保存在settings.py中的COOKIES池中,使用中间件用cookie登录。
用户5760343
2022-01-10
1.5K0
python 协程 future 回调
cancel(): 取消future的执行,调度回调函数 result(): 返回future代表的结果 exception(): 返回future中的Exception add_done_callback(fn): 添加一个回调函数,当future执行的时候会调用这个回调函数 remove_done_callback(fn): 从“call whten done”列表中移除所有callback的实例 set_result(result): 将future标为执行完成,并且设置result的值 set_exception(exception): 将future标为执行完成,并设置Exception
用户5760343
2022-01-09
7070
python 协程 下一步执行 常用
import asyncio import time from random import randint
用户5760343
2022-01-09
1830
点击加载更多
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
Python精品学习库
代码在线跑,知识轻松学
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档