随着时间的推移,最近加班越来越多,现在整理的东西越来越少,前段时间不断学习python 可是今天因为一个需求差不多用到的是和冒泡排序用到的一样的算法,可是当写的时候发现尽然不会了,这个真的是需要长期写才行的。一步一步记录吧。 冒泡排序其实大家应该都知道,就是一个一个的去比较。下面贴出写的代码:...
分类:
编程语言 时间:
2014-08-05 18:43:29
阅读次数:
198
先安装环境sudo apt-get install python-paramikosudo apt-get install python-pysqlite2当然mysql要装好还要装sudo apt-get installlibmysqlclient-dev下载MySQL Workbenchwb@u...
分类:
其他好文 时间:
2014-08-05 18:32:09
阅读次数:
202
语言:python 1 # state[0] = 1 to represent a queen 2 # state = (1,3,0,2) 3 # * Q * * 4 # * * * Q 5 # Q * * * 6 # * * Q * 7 def conflict(state, nextX): 8....
分类:
其他好文 时间:
2014-08-05 18:21:09
阅读次数:
221
a = {"k1":"v1","A":1,"a":2,5:"i5"} a["A"] ="直接修改" a["aa"]="没有的键是新建" del a["a"] #删除一个元素 d.clear() #清空一个字典 1、字典是键值对,没有顺序, 2、键大小写敏感 3、键值可以是混合类型的 ...
分类:
编程语言 时间:
2014-08-05 16:04:00
阅读次数:
215
安装软件准备:
vs2012
cocos2d-x-2.2.1
adt-bundle-windows-x86_64-20121030
android-ndk-r9c-windows-x86_64
jdk-7u21-windows-x64
python-2.7.6.amd64
cygwin64 setup-x86_64
Step 1:安装visual studio 20...
分类:
其他好文 时间:
2014-08-05 15:50:19
阅读次数:
429
1:Python定义数组:a=[0,1,2,3,4] ; 打印数组list(a); 这时:a[0]=0, a[1]=1, a[[2]=2......1.1:如果想定义一个很长的数组可以用到python函数range a=range(1000)生成1000个元素的一维数组, list(a) 打印数组显...
分类:
编程语言 时间:
2014-08-05 15:39:29
阅读次数:
251
Python 2.x 上连接MySQL的库倒是不少的,其中比较著名就是MySQLdb(Django项目都使用它;我也在开发测试系统时也使用过),见:http://sourceforge.net/projects/mysql-python/不过,目前MySQLdb并不支持python3.x,网上找了一...
分类:
数据库 时间:
2014-08-05 15:33:09
阅读次数:
338
课后习题7–1. 字典方法。哪个字典方法可以用来把两个字典合并到一起?答:dict1 = {'1' :' python' }dict2 = {'2' :"hello" }dict1.update(dict2)dictAll = dict1print dictAllResult:{'1': ' pyt...
分类:
编程语言 时间:
2014-08-05 15:29:09
阅读次数:
414
pip - Python包管理工具https://pip.pypa.io/en/latest/installing.htmlwget https://bootstrap.pypa.io/get-pip.pypython get-pip.pyRedis (NoSQL)http://www.redis....
分类:
编程语言 时间:
2014-08-05 15:28:29
阅读次数:
303
def declare_consumer(self, consumer_cls, topic, callback): """Create a Consumer using the class that was passed in and add it to our...
分类:
编程语言 时间:
2014-08-05 15:26:59
阅读次数:
291