上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 22 下一页
摘要: 在Python中被双下划线包围的方法,__init__、__str__、__doc__、__new__等,被称为"魔术方法"(Magic methods)#更严谨的说法是内建方法。魔术方法在类或对象的某些事件出发后会自动执行,如果希望根据自己的程序定制自己特殊功能的类,那么就需要对这些方法进行重写。 阅读全文
posted @ 2019-08-19 17:01 Augustone 阅读(388) 评论(0) 推荐(0)
摘要: sudo dpkg-reconfigure locales dpkg即debian的package软件管理程序 dpkg -l/-r/-i都很有用 阅读全文
posted @ 2019-08-18 10:02 Augustone 阅读(338) 评论(0) 推荐(0)
摘要: 一, 1. 类的声明和创建对于 Python 函数来说,声明与定义类没什么区别,因为他们是同时进行的,定义(类体)紧跟在声明(含 class 关键字的头行[header line])和可选(但总是推荐使用)的文档字符串后面。同时,所有的方法也必须同时被定义。请注意 Python 并不支持纯虚函数(像 阅读全文
posted @ 2019-08-16 15:54 Augustone 阅读(268) 评论(0) 推荐(0)
摘要: 概论: oop方法将世界看作一个有结构、有组织、有层次、有普遍联系,有属性特征、有行为方法的有机体、生命体,在oop当中对象不仅有数据和结构,而且有控制代码、行为、函数、方法,自身特征与自身行为封装到类中,实例化到具体事务当中,每个层面均有自身意义,下层可以继承上层,乃至多个上层,下层可以传承、繁衍 阅读全文
posted @ 2019-08-15 18:57 Augustone 阅读(1231) 评论(0) 推荐(0)
摘要: 一,简介 Author Info Adapter Augustone Zhang Updated: August 8, 2019 Explore this Article Using the from-import instruction Using the import instruction A 阅读全文
posted @ 2019-08-15 09:06 Augustone 阅读(370) 评论(0) 推荐(0)
摘要: python -m compileall 目录 # 存放python源代码的目录 在目录下生成__pycache__目录,该目录中包含源代码对应的预编译文件.pyc python 文件.pyc 此时执行速度更快(实际上是编译更快,或者说省去了编译的步骤(但如果源程序修改则须重新编译)) 即时速度更快 阅读全文
posted @ 2019-08-14 10:10 Augustone 阅读(3116) 评论(0) 推荐(0)
摘要: 总结:(源文件名为loops.c) 可以转换到不同阶段。阶段1,将头文件加进来。阶段2,转换成汇编程序,与机器类型相关。阶段3,转换成机器码,但不完整。阶段4,链接其他系统文件,形成最终可执行文件 cc -E -o loops-firststep.e loops.ccc -S -o loops-se 阅读全文
posted @ 2019-08-14 08:45 Augustone 阅读(3208) 评论(0) 推荐(1)
摘要: Table of Contents Defining a Set Set Size and Membership Operating on a Set Operators vs. Methods Available Operators and Methods Modifying a Set Augm 阅读全文
posted @ 2019-08-13 23:59 Augustone 阅读(341) 评论(0) 推荐(0)
摘要: Table of Contents Defining a Dictionary#定义一个字典 Accessing Dictionary Values#访问字典的值 Dictionary Keys vs. List Indices#字典的键与列表的索引 Building a Dictionary In 阅读全文
posted @ 2019-08-13 23:56 Augustone 阅读(256) 评论(0) 推荐(0)
摘要: Python iterators and generators In this part of the Python tutorial, we work with interators and generators. Iterator is an object which allows a prog 阅读全文
posted @ 2019-08-12 23:50 Augustone 阅读(329) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 22 下一页