新式类和经典类得区别:###################################################class ClassicClass(): passclass NewStyleClass(object): passx1 = ClassicClass()x2 =...
分类:
编程语言 时间:
2014-09-30 14:56:39
阅读次数:
195
思路是把字典转为列表后再排序d={'z':1,'y':2,'x':3} # 字典s=d.items() # [('y', 2), ('x', 3), ('z', 1)] 列表s.sort() # [('x', 3), ('y', 2), ('z', 1)] 排序列表# 或者连起来写(sort是...
分类:
编程语言 时间:
2014-09-30 14:54:59
阅读次数:
208
Linux:1、nginx安装包,自行下载。2、nginx_mod_h264_streaming-2.2.7下载3、nginx-rtmp-module-master下载Windows:nginx-rtmp-32.exe下载
分类:
其他好文 时间:
2014-09-30 13:59:49
阅读次数:
162
string类型是不可变的,因此不能采用直接赋值的方式。比如一个字符串 helloworld,想把o替换成z,那么只有先替换,然后再迭代。strings="helloworld"hello=strings.replace('o','z')for index,string in enumerate(h...
分类:
编程语言 时间:
2014-09-30 13:26:19
阅读次数:
235
python idle 错误 subprocess didn't make connection...
分类:
编程语言 时间:
2014-09-30 13:21:59
阅读次数:
237
原文网站:http://www.iplaypython.com/jinjie/jj116.html同其它python内建数据类型一样,字典dict也是有一些实用的操作方法。这里我们要说的是字典删除方法:clear()、pop()和popitem(),这三种方法的作用不同,操作方法及返回值都不相同。接...
分类:
编程语言 时间:
2014-09-30 12:45:29
阅读次数:
301
原题地址:https://oj.leetcode.com/problems/largest-rectangle-in-histogram/题意:Givennnon-negative integers representing the histogram's bar height where the ...
分类:
编程语言 时间:
2014-09-30 12:39:02
阅读次数:
254
python自然语言处理包 NLTK 环境搭建...
分类:
编程语言 时间:
2014-09-30 11:52:19
阅读次数:
209
Selenium Webdriver百度搜索设置,代码参照虫师selenium_webdriver(python)第一版中百度搜索框设置的代码#coding:utf-8from selenium import webdriverimport timedr=webdriver.Ie()dr.get("...
分类:
其他好文 时间:
2014-09-30 11:49:22
阅读次数:
189
当函数的参数不确定时,可以使用*args 和**kwargs,*args 没有key值,**kwargs有key值。还是直接来代码吧,废话少说[python]def fun_var_args(farg, *args): print "arg:", farg for value in args: pr...
分类:
编程语言 时间:
2014-09-30 11:02:51
阅读次数:
173