python
文章平均质量分 73
snowseabye
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Beginning Python - Chapter4 : Dictionaries
# chapter4: dictionaries # Question: why can not use dict function to init seq like dict(seq) # dicts have no order #1 init dict={'lili':'01','lucy':'02'} print dict['lili'] #2 basic dictionay o原创 2012-08-29 14:16:25 · 739 阅读 · 0 评论 -
chapter9: python 类的方法,属性,迭代器(new[old]-type class,[un]bound method,super,protocol,property,iterators)
chapter 9:Magic Methods, Properties, and Iterators 1 new-type class & old-type class 参考:http://ebkk.blog.163.com/blog/static/194135085200972692621216/ 从python 2.2 起,如果一个类继承自object 对象(或者它是任何内建类型原创 2012-09-12 17:41:30 · 1465 阅读 · 0 评论 -
chapter1:python 基础(数据类型,运算符,常用内置函数,模型,strings等)
第一章:python基础 1 运算符 >>1+2*3 >>7 整除 >>1/2 >>0 浮点数除,任何一方浮点即可 >>1/2.0 >>0.5 取余 >>7%5 >>2 求幂 >>2**3 >>8 注意:幂结合度比负号大 >>-2**2 >>-4 扩充:__future__用于导入python未来支持的语言特征原创 2012-09-12 14:51:50 · 1175 阅读 · 0 评论 -
git revert 撤销提交
Git的一些常用的撤销提交版本的的命令: git revert HEAD 撤销前一次 commit git revert HEAD^ 撤销前前一次 commit git revert commit (比如:fa042ce57ebbe5bb9c8db709f719cec2c58ee7ff)撤销指定的版本,撤销也会作为一次提交进行原创 2012-09-27 13:59:50 · 12802 阅读 · 0 评论 -
Beginning Python - Chapter10 : Batteries included
#Chapter10:Batteries included # Question :regular expression #1 simple example about module import sys sys.path.append('E:\pycode') import hello #excute hello.py and a new file appears (h原创 2012-09-05 16:47:33 · 848 阅读 · 0 评论 -
Beginning Python - Chapter7 : Exceptions
#Chapter8:Exceptions #Question:Warning? #1 The raise statement # raise Exception('test') import exceptions print dir(exceptions) # built-in exceptions in the module exceptions(as well as in the b原创 2012-09-03 14:05:22 · 710 阅读 · 0 评论 -
Beginning Python - Chapter6 : More Abstraction
#Chapter5:more abstraction #1 The magic of objects # polymorphism means having multiple forms. # encapsulation # inheritance #2 making your own classes class Person: def setName(self,name):原创 2012-08-31 18:08:12 · 554 阅读 · 0 评论 -
Beginning Python - Chapter6 : Abstraction
#Chapter5:abstraction #1 Creating Your Own Functions # -1.1- Documenting Functions def hello(name): 'this is comments' #docstring:comment of this fuc, can be show using .__doc__ 'this is原创 2012-08-31 14:07:05 · 566 阅读 · 0 评论 -
Beginning Python - Chapter5 : conditinals,loops,and some other statements
#Chapter5:conditinals,loops,and some other statements # Questions:about namespace with exec #1 more about print & import # -1.1- print print 'hello', \ 'world' #same with print 'hello', p原创 2012-08-29 18:00:39 · 1207 阅读 · 0 评论 -
Beginning Python - Chapter2 : Lists and Tuples
------------chapter2: ----------1 six built-in types of sequences list tuples strings unicode strings buffer objects xrange objects ----------2 list VS tuples list can be changed tuples can原创 2012-08-29 14:22:06 · 691 阅读 · 0 评论 -
Beginning Python - Chapter3 : Strings
------------chapter3: Strings ----------basic string operations all sequences' operations ; but cannot be changed ----------string formatting:the short version --------generic formatting Note:If原创 2012-08-29 14:19:23 · 580 阅读 · 0 评论 -
chapter6:python 抽象
1 Fibonacci 斐波那契序列 & callable() & __doc__ & help() #note:如果使用raw_input,则返回的是plain string,需要进行int转换 def fib(): num = input('how many numbers you want to get? ') fibs = [0,1] for i in range原创 2012-09-14 18:06:32 · 711 阅读 · 0 评论
分享