常用的python库

cup的Python项目详细描述


plz有关详细信息,请访问http://cup.iobusy.com

35831}

快速启动

一。下载

- git clone CUP or download the released tar balls

2.安装

从PIP安装,最新版本(2.0.3):

pip install cup

从源代码安装:

    python setup.py install

三。文档和维基

访问Wiki查看更多详细信息:https://github.com/Baidu/CUP/wiki

访问文档站点查看py文档:http://cupdoc.iobusy.com/

# Examples:# 1. Get system infoimportcup# count cpu usage in interval, by default 60 secondsfromcup.resimportlinuxcpuinfo=linux.get_cpu_usage(intvl_in_sec=60)printcpuinfo.usr# total, available, percent, used, free, active, inactive, buffers, cachedfromcup.resimportlinuxmeminfo=linux.get_meminfo()printmeminfo.totalprintmeminfo.available

测试

- Install python-nose before running the tests
- run `cd ./cup_tests; nosetests -s`

为CUP贡献

- Commit code to GITHUB, https://github.com/baidu/CUP
- Need to check pep8 and pylint rules before you start a pull request

讨论

- Github Issues

参考

  * Pexpect http://pexpect.sourceforge.net/ (under MIT license)
  * Httplib2 http://code.google.com/p/httplib2/ (under MIT license)
  * requests https://github.com/kennethreitz/requests (under Apache V2 license)
  * pymysql https://github.com/PyMySQL/PyMySQL (under MIT license)

维基

https://github.com/Baidu/CUP/wiki

代码目录树:

cup
    |-- cache.py                module              Memory cache related module
    |-- decorators.py           module              Decorators of python
    |-- err.py                  module              Exception classes for CUP
    |-- __init__.py             module              Default __init__.py
    |-- log.py                  module              CUP logging
    |-- mail.py                 module              CUP Email module (send emails)
    |-- net                     package             Network operations, such as net handler parameter tuning
    |-- oper.py                 module              Mixin operations
    |-- platforms.py            module              Cross-platform operations
    |-- res                     package             Resource usage queries (in /proc)、Process query、etc
    |-- shell                   package             Shell Operations、cross-hosts execution
    |-- services                package             Heartbeat、Threadpool based executors、file service、etc
    |-- thirdp                  package             Third-party modules: pexpect、httplib2
    |-- timeplus.py             module              Time related module
    |-- unittest.py             module              Unittest、assert、noseClass
    |-- util                    package             ThreadPool、Interruptable-Thread、Rich configuration、etc
    |-- version.py              module              CUP Version

慢性病

一。下载

- 克隆git代码或者下载已发布的tar包

2.

- run `python setup.py install`

三。使

举例说明:

# Examples:# 1. Get system infoimportcup# count cpu usage in interval, by default 60 secondsfromcup.resimportlinuxcpuinfo=linux.get_cpu_usage(intvl_in_sec=60)printcpuinfo.usr# total, available, percent, used, free, active, inactive, buffers, cachedfromcup.resimportlinuxmeminfo=linux.get_meminfo()printmeminfo.totalprintmeminfo.available

测试

- Install python-nose before running the tests
- run `cd ./cup_tests; nosetests -s`

向杯贡献代码

github公司 -将代码提交到github,https://github.com/baidu/CUP -在开始拉取请求之前,需要检查PEP8和Pylint规则

讨论

- Github Issues

参考

  * Pexpect http://pexpect.sourceforge.net/ (under MIT license)
  * Httplib2 http://code.google.com/p/httplib2/ (under MIT license)
  * requests https://github.com/kennethreitz/requests (under Apache V2 license)
  * pymysql https://github.com/PyMySQL/PyMySQL (under MIT license)

代码树结:

cup
    |-- cache.py                module              缓存相关模块 (Memory cache related module)
    |-- decorators.py           module              python修饰符,比如@Singleton单例模式 (Decorators of python)
    |-- err.py                  module              异常exception类, Exception classes for CUP
    |-- __init__.py             module              默认__init__.py, Default __init__.py
    |-- log.py                  module              打印日志类,CUP的打印日志比较简洁、规范,设置统一、简单(cup logging module)
    |-- mail.py                 module              发送邮件 (CUP Email module (send emails))
    |-- net                     package             网络相关操作(Network operations, such as net handler parameter tuning)
    |-- oper.py                 module              一些混杂操作(Mixin operations)
    |-- platforms.py            module              跨平台、平台相关操作函数(Cross-platform operations)
    |-- res                     package             资源获取、实时用量统计等,所有在/proc可获得的系统资源、进程、设备等信息 (Resource usage queries (in /proc)、Process query、etc)
    |-- shell                   package             命令Shell操作pakcage(Shell Operations、cross-hosts execution)
    |-- services                package             构建服务支持的类(比如心跳、线程池based执行器等等)Heartbeat、Threadpool based executors、file service、etc
    |-- thirdp                  package             第三方依赖纯Py模块(Third-party modules: pexpect、httplib2)
    |-- timeplus.py             module              时间相关的模块(Time related module)
    |-- unittest.py             module              单元测试支持模块(Unittest、assert、noseClass)
    |-- util                    package             线程池、可打断线程、语义丰富的配置文件支持(ThreadPool、Interruptable-Thread、Rich configuration、etc)
    |-- version.py              module              内部版本文件,CUP Version

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java接口中的每个方法都是抽象的,但在抽象类中,我们也只能使用抽象方法   初始化Java中声明的、未初始化的变量会发生什么情况?   java BouncyCastle openPGP将字节[]数组加密为csv文件   在Java中将类A(和所有子类)映射到类B的实例的字典   RSA公钥编码,在Java和Android中,代码相同,结果不同   java在安卓中实现数字检测语音识别   java取消选择复选框   java如何在其他配置中重用Maven配置XML片段   java有没有一种有效的方法来检查HashMap是否包含映射到相同值的键?   spring处理程序调度失败;嵌套的例外是java。lang.NoClassDefFoundError:org/apache/http/client/HttpClient   带有ehcache的java多层缓存   java如何访问chromium(或任何其他浏览器)cookie   java通过将两个集合与spring data mongodb data中的条件合并来获取计数   安卓中R.java的语法错误