python 流行库、库的基本用法
进入github,输入python 点击see topic 进入python流行的库 链接 https://github.com/topics/python
1、QuantLib 金融衍生品数据库
2、schedule定时任务 https://github.com/dbader/schedule
3、Tenacity。Python重试从此无比简单 https://github.com/jd/tenacity/releases?after=v1.2.2
4、yagmail 发邮件的库 https://github.com/kootenpv/yagmail
5、Tornado web server Tornadois a Python web framework andasynchronous networking library, originally developed atFriendFeed. By using non-blocking network I/O, Tornadocan scale to tens of thousands of open connections, making it ideal forlong polling,WebSockets, and otherapplications that require a long-lived connection to each user.
tornado是一个Python Web框架的异步网络库,最初是在FriendFeed。通过使用非阻塞的网络I/O,tornadocan规模对打开的连接数以万计,使其成为理想的长轮询,WebSockets,和其他应用程序需要一个长连接到每个用户。 https://github.com/tornadoweb/tornado
6、
库的使用
3、defaultdict库:python中defaultdict方法的使用
https://blog.csdn.net/real_ray/article/details/17919289
2、abc模块 以后有需要再学习
资料:http://blog.csdn.net/taiyangdao/article/details/78199623
https://docs.python.org/3/library/abc.html
http://blog.csdn.net/grey_csdn/article/details/77110667
http://blog.csdn.net/qijiqiguai/article/details/77269839
1、Munch库
import munch
b=Munch()
Traceback (most recent call last):
File "D:\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2862, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-7-fa393e434470>", line 1, in <module>
b=Munch()
NameError: name 'Munch' is not defined
from munch import *
b=Munch()
b.hello='world'
b['hello']
Out[11]: 'world'
b['hello']+='!'
b.hello
Out[13]: 'world!'
b.foo=Munch(lol=True)
b.foo.lol
Out[15]: True
b.foo is b['foo']
Out[16]: True
b
Out[17]: Munch({'hello': 'world!', 'foo': Munch({'lol': True})})
b['yang']='qie'
b
Out[19]: Munch({'hello': 'world!', 'foo': Munch({'lol': True}), 'yang': 'qie'})
b.keys()
Out[20]: dict_keys(['hello', 'foo', 'yang'])
b.update({'ponies':'are pretty!'},hello=43)
b
Out[22]: Munch({'hello': 43, 'foo': Munch({'lol': True}), 'yang': 'qie', 'ponies': 'are pretty!'})
[(k,b[k]) for k in b]
Out[23]:
[('hello', 43),
('foo', Munch({'lol': True})),
('yang', 'qie'),
('ponies', 'are pretty!')]
'The {knights} who say {ni}'.format(**Munch(knights='lolcats',ni='can haz'))
Out[24]: 'The lolcats who say can haz'
b=Munch(foo=Munch(lol=True),hello=42,ponies='are pretty!')
b
Out[26]: Munch({'foo': Munch({'lol': True}), 'hello': 42, 'ponies': 'are pretty!'})
import json
json.dumps(b)
Out[28]: '{"foo": {"lol": true}, "hello": 42, "ponies": "are pretty!"}'
undefined=object()
b=DefaultMunch(undefined,{'hello':'world'})
b
Out[32]: DefaultMunch(<object object at 0x00000167253C5430>, {'hello': 'world'})
b()
Traceback (most recent call last):
File "D:\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2862, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-33-9c619ddbd09b>", line 1, in <module>
b()
TypeError: 'DefaultMunch' object is not callable
b.hello
Out[34]: 'world'
b.foo
Out[35]: <object at 0x167253c5430>
b.foo()
Traceback (most recent call last):
File "D:\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2862, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-36-e1521d9f21b2>", line 1, in <module>
b.foo()
TypeError: 'object' object is not callable
b.foo is undefined
Out[37]: True
undefined=object()
b=DefaultMunch.fromDict({'recursively':{'nested':'value'}},undefined)
b.recursively
Out[40]: DefaultMunch(<object object at 0x00000167253C5420>, {'nested': 'value'})
b.recursively.nested
Out[41]: 'value'
b.recursively.foo
Out[42]: <object at 0x167253c5420>
python 流行库、库的基本用法的更多相关文章
- python爬虫---selenium库的用法
python爬虫---selenium库的用法 selenium是一个自动化测试工具,支持Firefox,Chrome等众多浏览器 在爬虫中的应用主要是用来解决JS渲染的问题. 1.使用前需要安装这个 ...
- python beautiful soup库的超详细用法
原文地址https://blog.csdn.net/love666666shen/article/details/77512353 参考文章https://cuiqingcai.com/1319.ht ...
- Python爬虫Urllib库的高级用法
Python爬虫Urllib库的高级用法 设置Headers 有些网站不会同意程序直接用上面的方式进行访问,如果识别有问题,那么站点根本不会响应,所以为了完全模拟浏览器的工作,我们需要设置一些Head ...
- Python 中拼音库 PyPinyin 的用法【华为云技术分享】
[摘要] 最近碰到了一个问题,项目中很多文件都是接手过来的中文命名的一些素材,结果在部署的时候文件名全都乱码了,导致项目无法正常运行. 后来请教了一位大佬怎么解决文件名乱码的问题,他说这个需要正面解决 ...
- Python中第三方库Requests库的高级用法详解
Python中第三方库Requests库的高级用法详解 虽然Python的标准库中urllib2模块已经包含了平常我们使用的大多数功能,但是它的API使用起来让人实在感觉不好.它已经不适合现在的时代, ...
- 【python库模块】Python subprocess模块功能与常见用法实例详解
前言 这篇文章主要介绍了Python subprocess模块功能与常见用法,结合实例形式详细分析了subprocess模块功能.常用函数相关使用技巧. 参考 1. Python subprocess ...
- python 各种开源库
测试开发 来源:https://www.jianshu.com/p/ea6f7fb69501 Web UI测试自动化 splinter - web UI测试工具,基于selnium封装. 链接 sel ...
- 怎样用Python的Scikit-Learn库实现线性回归?
来源商业新知号网,原标题:用Python的Scikit-Learn库实现线性回归 回归和分类是两种 监督 机器 学习算法, 前者预测连续值输出,而后者预测离散输出. 例如,用美元预测房屋的价格是回归问 ...
- Python 爬虫 解析库的使用 --- XPath
一.使用XPath XPath ,全称XML Path Language,即XML路径语言,它是一门在XML文档中查找信息的语言.它最初是用来搜寻XML文档的,但是它同样适用于HTML文档的搜索. 所 ...
随机推荐
- 清北学堂例题 LUOGU2519 【HAOI2011】PROBLEM A
题目描述 一次考试共有n个人参加,第i个人说:“有ai个人分数比我高,bi个人分数比我低.”问最少有几个人没有说真话(可能有相同的分数) 输入格式 第一行一个整数n,接下来n行每行两个整数,第i+1行 ...
- 002. 使用IDEA创建MyBatis的JAVAWEB项目 ,每一步都有详细过程,完美绕过各种坑能正常运行
001. 我们新建一个Module,相当于一个工程里面的一个项目 002.选择空白的JAVA程序 003.输入项目的名字为mybatis001 004.我们对这个项目添加Support,各种框架依赖 ...
- C++用sqlite3_open连接打开指定数据库的小问题
一开始我也纳闷,我以为是我数据库没弄好,但是当我仔细检查,才发现 原来我少了分号 写少了分号,可能会导致 database 和 table 找不到... 所以用的时候需要注意... 代 ...
- SpringBoot配置介绍
SpringBoot配置介绍 SpringBoot如何进行配置 在SpringBoot中默认使用Servlet3.0可以没有web.xml,没有任何的xml,我们想要做一些自定义配置,比u数据库相关信 ...
- 谈谈函数式编程curry
Curry概念 The concept is simple: You can call a function with fewer arguments than it expects. It retu ...
- HDU - 3724 Encoded Barcodes (字典树)
题意:给定n个字符串和m个经过处理得到的字符串,问对于m个字符串中的每个字符串,n个字符串中以该字符串为前缀的个数.分析:1.误差在[0.95x, 1.05x],因此求8个数的平均数,大于平均数为1, ...
- C#与unity中base64string和图片互转
C#: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Syst ...
- Nachos-Lab3-同步与互斥机制模块实现
源码获取 https://github.com/icoty/nachos-3.4-Lab 内容一:总体概述 本实习希望通过修改Nachos系统平台的底层源代码,达到"扩展同步机制,实现同步互 ...
- python 小数相加报错 invalid literal for int() with base 10
for i in column1: x = int(i) s += xprint "sum:",s,"count:",len(column1)# round ( ...
- 056-for循环中continue的使用
<?php ; $i <= ; $i++) { //for循环输出数值 == ) //判断变量是否为3的整数倍 { continue;//跳过本次循环剩余语句 } echo "$ ...