s12-20160130-day06 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160130-day05 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160109-day02 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
*:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin: 15px 0; } /* HEAD…
一.模块 1. 模块(Module):以.py结尾的文件,包含python对象定义和python语句.使代码段更容易理解和使用. 模块分为两种:标准库(直接导入的库)和第三方库(需要下载安装的库). 2. 模块的引入 a. import语句:当解释器遇到import语句,如果模块在当前的搜索路径就会被导入.搜索路径是一个解释器会先进行搜索的所有目录的列表. 如果想要导入模块support.py,需要把命令放在脚本的顶端. import module例如:import sys b.from...i…
s12-20160227-day07 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160312-day09 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
第一阶段:Python 语言基础 数据类型 流程控制 常用模块 函数.迭代器.装饰器 递归.迭代.反射 面向对象编程 购物车程序 计算器程序开发 模拟人生游戏开发 第二阶段:网络编程 Socket c/s 编程.Twisted 异步网络框架.网络爬虫开发 多线程.多进程.携程 gevent .select\poll\epoll 生产者消费者模型 审计堡垒机系统开发 FTP 服务器开发 批量命令.文件分布工具 RabbitMQ 消息队列.SqlAlchemy ORM 类 SaltStack 配置管…
s12-20160319-day10 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
自定义模块 我们今天来学习一下自定义模块(也就是私人订制),我们要自定义模块,首先就要知道什么是模块啊 一个函数封装一个功能,比如现在有一个软件,不可能将所有程序都写入一个文件,所以咱们应该分文件,组织结构要好,代码不冗余,所以要分文件,但是分文件,分了5个文件,每个文件里面可能都有相同的功能(函数),怎么办?所以将这些相同的功能封装到一个文件中.模块就是文件,存放一堆函数,谁用谁拿.怎么拿?比如:我要策马奔腾共享人世繁华,应该怎么样?我应该骑马,你也要去浪,你是不是也要骑马.模块是一系列常用功…
s12-20160507-day16 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160305-day08 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160123-day04 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160116-day03 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
一,concurent.furtrue进程池和线程池 1.1 concurent.furtrue 开启进程,多进程&线程,多线程 # concurrent.futures创建并行的任务 # 进程池 ProcessPoolExecutor,ThreadPoolExecutor # 下面例子是Io密集型,所以时间上比叫多 from concurrent.futures import ProcessPoolExecutor import os,time,random def task(n): prin…
一.threading模块 1.threading类的两种创建方法 (1)直接创建 import time import threading def Hi(num): print("hello,%d"%num) time.sleep(3) if __name__ == "__main__": t1 = threading.Thread(target=Hi,args=(10,)) t2 = threading.Thread(target=Hi,args=(9,)) t…
s12-20160430-day15 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160409-day13 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
模块概念 在Python中,一个.py文件就称之为一个模块(Module).使用模块组织代码,最大的好处是大大提高了代码的可维护性 模块一共三种:python标准库.第三方模块.应用程序自定义模块. 相同名字的函数和变量完全可以分别存在不同的模块中,因此,我们自己在编写模块时,不必考虑名字会与其他模块冲突.但是也要注意,尽量不要与内置函数名字冲突. 模块导入 import语句 import module1[, module2[,... moduleN] 使用import语句时候,Python解释…
sys模块 sys模块提供了一系列有关Python运行环境的变量和函数. #重点记忆 sys.argv #命令行参数List,第一个元素是程序本身路径 sys.exit(n) #退出执行的程序未见,正常退出时exit(0),不同于循环用的break跳出循环 sys.path #返回模块的搜索路径,初始化时使用PYTHONPATH环境变量的值 #一般 sys.platform #返回操作系统平台名称 sys.version #获取Python解释程序的版本信息 sys.maxint #最大的Int…
time模块 在Python中,通常有这三种方式来表示时间:时间戳.元组(struct_time).格式化的时间字符串: (1)时间戳(timestamp) :通常来说,时间戳表示的是从1970年1月1日00:00:00开始按秒计算的偏移量.我们运行“type(time.time())”,返回的是float类型. (2)格式化的时间字符串(Format String): ‘1988-03-16’ (3)元组(struct_time) :struct_time元组共有9个元素共九个元素:(年,月,…
安装的版本ansible版本<=2.7,<=2.8是不行的哦 安装模块 pip install ansible==2.7 先导出环境变量 我们自定义模块的目录. 我存放的目录 export ANSIBLE_LIBRARY=/home/makeit/mylib/ 把自己写的模块放到这个目录中,ansible在执行的时候会读取ANSIBLE_LIBRARY这个环境变量来查找对应的模块文件. 例 我们新写的模块文件名 mydownload.py 那么我们的模块名就是mydownload 这样使用自定…
https://www.cnblogs.com/songqingbo/p/5129116.html(转载学习)…
s12-20160421-day14 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
pymysql模块的使用 #1 基本使用 # import pymysql # conn=pymysql.connect(host='localhost',user='root',password='123',database='db4') # 链接 # cursor=conn.cursor() #拿到游标,即mysql >,接收命令 # sql='select * from userinfo where id>1;' # rows=cursor.execute(sql) #提交命令,拿到受影…
install.packages('模块包名称') 或者 install.packages('模块包名称',repos='http://cran.us.r-project.org')…
安装相关依赖包. 在终端下输入命令:sudo yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel 使用wget从官网下载安装包.在终端下输入命令: wget https://www.python.org/ftp/python/3.6.5/Python-3.6…
import numpy as np import matplotlib.pyplot as plt x = np.random.randint(0,20,10) y = np.random.randint(0,20,10) print(x) print(y) plt.title("散点图") plt.scatter(x,y,edgecolors="red") plt.plot(x,y) plt.show() 解决绘图中文乱码,打开python的安装路径,找到“E:…
https://www.cnblogs.com/wj-1314/p/8476197.html…
. 下载: basemap-1.1.0-cp36-cp36m-win_amd64.whl和pyproj-1.9.5.1-cp36-cp36m-win_amd64.whl这两个文件 先运行: 再运行:…