Tag Archives: python

python logging模块使用教程

简单使用 #!/usr/local/bin/python # -*- coding:utf-8 -*- import logging logging.debug('debug message') logging.info('info message') logging.warn('warn message') logging.error('error message') logging.critical('critical message')... Read More | Share it now!

RabbitMQ队列使用 Python

关于python的queue介绍 关于python的队列,内置的有两种,一种是线程queue,另一种是进程queue,但是这两种queue都是只能在同一个进程下的线程间或者父进程与子进程之间进行队列通讯,并不能进行程序与程序之间的信息交换,这时候我们就需要一个中间件,来实现程序之间的通讯。 RabbitMQ MQ并不是python内置的模块,而是一个需要你额外安装(ubunto可直接apt-get其余请自行百度。)的程序,安装完毕后可通过python中内置的pika模块来调用MQ发送或接收队列请求。接下来我们就看几种python调用MQ的模式(作者自定义中文形象的模式名称)与方法。  RabbitMQ设置远程链接账号密码 启动rabbitmq... Read More | Share it now!

request-python

迫不及待了吗?本页内容为如何入门 Requests 提供了很好的指引。其假设你已经安装了... Read More | Share it now!

APScheduler-Python定时任务

1 简介 APScheduler的全称是Advanced Python Scheduler。它是一个轻量级的 Python 定时任务调度框架。APScheduler 支持三种调度任务:固定时间间隔,固定时间点(日期),Linux 下的 Crontab... Read More | Share it now!

详解python调用redis lua内嵌脚本的高级用法

Lua 脚本功能是 Reids 2.6 版本开始提供的高级功能, 我们可以通过redis内嵌的 Lua 环境的进行搞复杂的需求。 使用内置的lua脚本环境可以解决Redis长久以来不能高效地处理 CAS... Read More | Share it now!

prometheus/client_python

Prometheus Python Client The official Python 2 and 3 client for Prometheus. https://github.com/prometheus/client_python Three Step Demo One: Install the client: pip install prometheus_client Two: Paste the following into a Python interpreter: from... Read More | Share it now!

Python实现redis的自增操作

在传统的数据库中, 如果实现一个计数器的操作, 需要先去数据库中读取该值, 再程序中加1, 再讲最新的值存入数据库. 用户操作的流程步骤多不说, 还容易出现数据安全性的问题,... Read More | Share it now!

How to Install Ruby 2.4 on CentOS/RHEL 7/6

Ruby 2.4.2 Released, Ruby is a dynamic, object-oriented programming language focused on simplicity and productivity. RVM (Ruby Version Manager) is a tool for installing and managing multiple Ruby versions on single operating systems. This tutorial will... Read More | Share it now!

Python单元测试unittest

Python中有一个自带的单元测试框架是unittest模块,用它来做单元测试,它里面封装好了一些校验返回的结果方法和一些用例执行前的初始化操作。 在说unittest之前,先说几个概念: TestCase... Read More | Share it now!