码迷,mamicode.com
首页 >  
搜索关键字:python objects all    ( 160304个结果)
【python】sys.argv[]的用法
在学python的过程中,一直弄不明白sys.argv[]的意思,虽知道是表示命令行参数,但还是有些稀里糊涂的感觉。今天又好好学习了一把,总算是大彻大悟了。Sys.argv[]是用来获取命令行参数的,sys.argv[0]表示代码本身文件路径,所以参数从1开始,以下两个例子说明:1、使用sys.ar...
分类:编程语言   时间:2014-08-05 15:26:19    阅读次数:227
python报错
报错1UnboundLocalError: local variable 'x' referenced before assignment定义了一个全局参数,但是在函数中直接改变参数值,就会报这个错误。例如x=0def my_test(): print x x=1修改方案1x=0def my_tes...
分类:编程语言   时间:2014-08-05 15:23:39    阅读次数:240
java.sizeOf
IntroductionWith java.SizeOf you can measure the real memory size of your Java objects.Download it hereThe project is a little java agent what use the...
分类:编程语言   时间:2014-08-05 15:19:29    阅读次数:200
Combinations C++
Question: Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.要产生全部的combinations,我们需要一种有序的方式产生combination以达到既产生全部又没有重复的...
分类:编程语言   时间:2014-08-05 15:17:59    阅读次数:263
理解Python命名机制
理解Python命名机制 本文最初发表于恋花蝶的博客(http://blog.csdn.net/lanphaday),欢迎转载,但必须保留此声明且不得用于商业目的。谢谢。 引子 我热情地邀请大家猜测下面这段程序的输出: class A(object):...
分类:编程语言   时间:2014-08-05 14:31:59    阅读次数:248
pip 和 easy_install 区别,以及使用python 的虚拟环境
安装 east_install :? https://pypi.python.org/pypi/setuptools/5.4.2 ? 下载ez_setup.py 脚本后执行,就完成了安装 安装pip 可以通过 east_install ?pip 安装 区别 ?pip 官網的說法,pip 改善了不少 easy_i...
分类:编程语言   时间:2014-08-05 14:31:29    阅读次数:412
关于Window的Dos Batch 文件编写的常识
Redirect "all" output to a single file: Run: test.bat?>?test.txt?2>&1 and you‘ll get this text on screen (we‘ll never get rid of this line on screen, as it is sent to the Console and cannot be r...
分类:Windows程序   时间:2014-08-05 14:30:10    阅读次数:296
Python 生成账号密码算法
有个需求,需要伪造跟用户行为非常类似的账号密码,而且需要一个阀值控制伪造的数量。在这需求上,还有一个就是需要控制生成的比率、跳出率不能过高或者太低。对此就随手用python写了一个,bug不知道有木有,没有测,具体有兴趣可以去改改。#coding:utf-8import randomclass cr...
分类:编程语言   时间:2014-08-05 13:56:39    阅读次数:407
windows下Python shell代码自动补全
Unix下实现如题功能用下面的代码:import rlcompleter, readlinereadline.parse_and_bind('tab: complete')但readline不能在win中用,需要为windows编译好的pyreadlinepip install pyreadline...
分类:编程语言   时间:2014-08-05 13:41:09    阅读次数:439
(yii学习笔记)控制器权限控制
public function filters(){ return array( 'accessControl', // per 'postOnly + delete', // );}public function accessRules(){ return array( array('all...
分类:其他好文   时间:2014-08-05 13:34:39    阅读次数:213
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!