
python
大熊1997
这个作者很懒,什么都没留下…
展开
-
neutron callback system
In Neutron, core and service components may need to cooperate during the execution of certain operations, or they may need to react upon the occurrence of certain events. For instance, when a Neutron翻译 2016-12-27 15:23:45 · 729 阅读 · 0 评论 -
openstack配置项自动生成方法
This information was valid at the time this article was written (juno-2).UPDATE: Fixed Cinder, Heat and Ironic generate_sample.sh commands. Thanks Mike Spreitzer.Each OpenStack project is a bi翻译 2017-01-03 21:15:09 · 686 阅读 · 0 评论 -
paste.deploy程序示例
pastedeploylab.ini :[DEFAULT] key1=value1 key2=value2 key3=values [composite:pdl] use=egg:Paste#urlmap /:root /calc:calc [filter:logrequest] username = root password =原创 2015-03-26 16:00:15 · 490 阅读 · 0 评论 -
sqlalchemy orm使用指南
本教程只讲述sqlalchemy的ORM使用方式,手写sql的使用基本上和python-mysqldb没区别。使用环境:部署了openstack的虚拟机。否则请自行安装sqlalchemy所需的各种包。以下开始使用sqlalchemy来读取我们的nova数据库里面的数据。fromsqlalchemy import *fromsqlalchemy.orm import s原创 2014-06-26 15:55:21 · 971 阅读 · 0 评论 -
用openstack SDK -- pyrax 访问openstack服务例子
import pyraxhpcloud_auth_endpoint = "http://127.0.0.1:5000/v2.0/"#hpcloud_region = "region-b.geo-1"hpcloud_project_id = "68413f8f2da346c9a4492517485d493e" # (Numerical) ProjectIDhpcloud_us原创 2014-03-25 16:39:05 · 1022 阅读 · 0 评论 -
sqlalchemy-migrate 升级降级openstack数据库
参考 https://sqlalchemy-migrate.readthedocs.org/en/latest/versioning.html#writing-for-a-specific-database0.作用可对数据库进行版本升级/降级新版本的代码,数据库表结构发生变化。采用migrate可直接改变数据库的表结构而不影响原有的数据。一。 SQLALchemy翻译 2014-02-21 16:24:11 · 3401 阅读 · 0 评论 -
python和c性能比较,以及用dll优化python代码
python作为动态语言,开发效率相当高,但如我们所知,动态语言的执行效率往往是比较低的,请看下面简单的测试过程: 一、 C语言实现100万次打印: 代码:[cpp] view plaincopyprint?#include #include int main(int argc, char* argv[])原创 2013-10-30 17:01:14 · 1420 阅读 · 0 评论 -
python yield使用解析
您可能听说过,带有 yield 的函数在 Python 中被称之为 generator(生成器),何谓 generator ?我们先抛开 generator,以一个常见的编程题目来展示 yield 的概念。如何生成斐波那契數列斐波那契(Fibonacci)數列是一个非常简单的递归数列,除第一个和第二个数外,任意一个数都可由前两个数相加得到。用计算机程序输出斐波那契數列的前原创 2013-08-12 10:57:31 · 570 阅读 · 0 评论 -
python技巧26[python的egg包的安装和制作]
一 setuptools 和easy_install setuptools:setuptools 是一组由PEAK(Python Enterprise Application Kit)开发的 Python 的 distutils 工具的增强工具,可以让程序员更方便的创建和发布 Python的egg 包,特别是那些对其它包具有依赖性的状况。 由 setuptools 创建和发布的包看起来和基原创 2013-07-02 10:15:03 · 628 阅读 · 0 评论 -
python协程
前言:我一直在关注如何让开发变得更容易,效率更高,更不易出错。之前做过类似的努力,结合SOA和工作流引擎做的一个流程编辑:http://blog.youkuaiyun.com/chgaowei/article/category/597366。它有它自身的缺陷:脚本和程序之间的耦合太大,脚本限制太多。后来接触并且学习Python,它简洁而强大,应该是解决这类问题的一个思路。那天看到Python自带的生成转载 2013-07-14 15:54:44 · 676 阅读 · 0 评论 -
Python中的staticmethod和classmethod
class MethodTest(): var1 = "class var" def __init__(self, var2 = "object var"): self.var2 = var2 @staticmethod def staticFun(): print 'static method'原创 2013-07-13 14:21:24 · 872 阅读 · 0 评论 -
python装饰器
这是在Python学习小组上介绍的内容,现学现卖、多练习是好的学习方式。第一步:最简单的函数,准备附加额外功能?12345678# -*- coding:gbk -*-'''示例1: 最简单的函数,表示调用了两次''' def myfu转载 2013-07-13 13:53:39 · 521 阅读 · 0 评论 -
WSGI解析
WSGI不是框架不是模块,仅仅是一个规范协议,定义了一些接口,却影响着Python网络开发的方方面面。对于WSGI有这么一段定义:WSGI is the Web Server Gateway Interface. It is a specification for web servers and application servers to communicate with web appli转载 2013-06-16 15:45:59 · 614 阅读 · 0 评论 -
疑问:python单进程为何使用了380%的CPU?
python GIL原创 2017-09-22 20:01:33 · 821 阅读 · 2 评论