![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
《Python基础教程》
文章平均质量分 51
stu-cs
这个作者很懒,什么都没留下…
展开
-
Python基础教程(第五章)
序列解包多个赋值操作可以同时进行 x, y, z = 1, 2, 3也可以x, y = y, x上述的赋值实际上进行了序列解包——将多个值的序列展开,然后放到变量的序列中。如下所示>>>values = 1, 2, 3>>> values(1, 2, 3)>>>x, y, z = values>>>x1当函数或方法返回转载 2014-09-19 20:21:00 · 386 阅读 · 0 评论 -
python中的requests使用
python的requests初步使用 | 杨彦星转载 2014-10-31 11:50:05 · 878 阅读 · 0 评论 -
python基础教程 (第十四章)
一个简单的服务器import sockets = socket.sock转载 2014-09-26 22:36:26 · 365 阅读 · 0 评论 -
Python基础教程(第十章)
模块主要用于定义,如变量,函数和类等。所以转载 2014-09-26 08:45:52 · 530 阅读 · 0 评论 -
Python基础教程(第九章)
新型类: class NewStyle(object) : 或者 class Sty转载 2014-09-23 09:34:42 · 476 阅读 · 0 评论 -
Python 基础教程(第七章)
在方法或者变量前加上双下划线—转载 2014-09-21 18:41:34 · 431 阅读 · 0 评论 -
Python基础教程(第六章)
文档字符串:定义为函数开头的字符转载 2014-09-20 16:09:40 · 463 阅读 · 0 评论 -
Python基础教程(第三章)
字符串格式化: format = "hello %s,%s enough for ya" // format称为格式化字符串 value = ('world', 'hot') print format % value 模板字符串:from string import Templates = Template('$x, gl转载 2014-09-19 20:21:08 · 361 阅读 · 0 评论 -
Python基础教程(第四章)
dict()函数可通过其它映射或者(键,值)这样的序列建立字典 // dict 并不属于函数,它是像list tuple str一样的类型items = [('name', 'gumy'), ('age', 20)]d = dict(items)或者 d = dict(name = 'gumy', age = 20) 基本字典操作len(d) 翻译字转载 2014-09-19 20:22:11 · 370 阅读 · 0 评论 -
python类中函数调用要加self
对象调用方法时, 实际上是通过类调用的a = muffedcalculator()a.calc(expr)实际上是这样调用的 muffledcalculator.calc(a, expr)这样self 就是 a, python隐含地把a 传进方法 替代了self, 就成了绑定的方法, 就可以执行了. 否则就是非绑定方法原创 2014-10-15 14:41:41 · 15678 阅读 · 3 评论