码迷,mamicode.com
首页 >  
搜索关键字:python objects all    ( 160304个结果)
4Sum
题目 Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: ...
分类:其他好文   时间:2014-06-18 12:17:57    阅读次数:179
数据类型
3 数据类型数据类型是一门语言里最基本的表达单元。如果数据类型越丰富,表达能力就越强,使用起来就越方便。当然,如果类型太多,就会导致难记,因此在类型丰富与记忆之间取得一个平衡点。Python内置了不少的数据类型,这样编写代码时,达到编写最少的代码,但需要记忆的时间就多一些了。Python语言在输入时并不需要指明变量的数据类型,它的类型是由编译器和运行时动态地识别出来,如果类型不能操作时,就会抛出异...
分类:其他好文   时间:2014-06-18 11:48:13    阅读次数:136
3Sum
题目 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: Elements in a tr...
分类:其他好文   时间:2014-06-17 22:04:49    阅读次数:292
Python hashlib模块 (主要记录md5加密)
python提供了一个进行hash加密的模块:hashlib下面主要记录下其中的md5加密方式(sha1加密一样把MD5换成sha1)[python]view plaincopyprint?>>>importhashlib>>>m=hashlib.md5()>>>m.update("Nobodyin...
分类:编程语言   时间:2014-06-17 20:26:49    阅读次数:233
{转}Python IDLE中文乱码
http://hi.baidu.com/yobin/item/166e3a46537781d3c1a59257乱码原因:因为你的文件声明为utf-8,并且也应该是用utf-8的编码保存的源文件。但是windows的本地默认编码是cp936,也就是gbk编码,所以在控制台直接打印utf-8的字符串当然...
分类:编程语言   时间:2014-06-17 19:55:59    阅读次数:273
chmod
权限范围的表示法如下:u:User,即文件或目录的拥有者。g:Group,即文件或目录的所属群组。o:Other,除了文件或目录拥有者或所属群组之外,其他用户皆属于这个范围。a:All,即全部的用户,包含拥有者,所属群组以及其他用户。有关权限代号的部分,列表于下:r:读取权限,数字代号为"4"。w:...
分类:其他好文   时间:2014-06-17 15:57:11    阅读次数:253
[转]mac下Python升级到指定的版本
以2.7升级到3.3为例1.删除原版本a)删除系统库中的版本sudo rm -R /System/Library/Frameworks/Python.framework/Versions/2.7b)删除Current版本sudo rm /System/Library/Frameworks/Pytho...
分类:编程语言   时间:2014-06-17 15:35:13    阅读次数:518
[数据结构与算法分析(Mark Allen Weiss)]不相交集 @ Python
最简单的不相交集的实现,来自MAW的《数据结构与算法分析》。代码:class DisjSet: def __init__(self, NumSets): self.S = [0 for i in range(NumSets+1)] def SetUnion(self, S,...
分类:编程语言   时间:2014-06-17 15:17:56    阅读次数:265
python异常处理
#!/usr/bin/pythonimport tracebacktry: 1/0#except Exception,e:# print traceback.format_exc() except Exception as e: print e#!/usr/bin/pythonimport tra....
分类:编程语言   时间:2014-06-17 15:07:08    阅读次数:329
vimgdb安装以及使用
vimgdb安装vim-7.3.tar.bz2http://www.vim.org/sources.phpvimgdb-for-vim7.3 (this patch)https://github.com/larrupingpig/vimgdb-for-vim7.3Untar all files, a...
分类:数据库   时间:2014-06-17 15:05:44    阅读次数:351
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!