The Python Handbook
7.0.1. Assignment operator 7.0.2. Arithmetic operator 7.0.3. Comparison operator 7.0.4. Boolean operator 7.0.5. Bitwise operator 7.0.6. is and in 8. The Ternary Operator 9. Strings 10. Booleans statement 40. Installing 3rd party packages using pip 41. List comprehensions 42. Polymorphism 43. Operator Overloading 44. Virtual Environments 1. Introduction to Python 5 Python is literally eating We can create a new Python variable by assigning a value to a label, using the = assignment operator. In this example we assign a string with the value "Roger" to the name label: name = "Roger"0 码力 | 93 页 | 7.31 MB | 1 年前3Jinja2 Documentation Release 2.10
caught. call_binop(context, operator, left, right) For intercepted binary operator calls (intercepted_binops()) this function 39 is executed instead of the builtin operator. This can be used to fine tune in version 2.6. call_unop(context, operator, arg) For intercepted unary operator calls (intercepted_unops()) this function is executed instead of the builtin operator. This can be used to fine tune the should be intercepted. Each operator that is added to this set (empty by default) is delegated to the call_binop() method that will perform the operator. The default operator callback is specified by binop_table0 码力 | 148 页 | 475.08 KB | 1 年前3Python 标准库参考指南 2.7.18
254 9.8 functools —高阶函数和可调用对象上的操作 . . . . . . . . . . . . . . . . . . . . . . . . . . 267 9.9 operator —标准运算符替代函数 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 10 文件和目录访问 279 methods described in the 字 符串的方法 section. To output formatted strings use template strings or the % operator described in the String Formatting Operations section. In addition see the String Services section methods de- scribed in the 字符串的方法 section. To output formatted strings use template strings or the % operator described in the String Formatting Operations section. In addition see the String Services section0 码力 | 1552 页 | 7.42 MB | 9 月前3Python 标准库参考指南 2.7.18
254 9.8 functools —高阶函数和可调用对象上的操作 . . . . . . . . . . . . . . . . . . . . . . . . . . 267 9.9 operator —标准运算符替代函数 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 10 文件和目录访问 279 methods described in the 字 符串的方法 section. To output formatted strings use template strings or the % operator described in the String Formatting Operations section. In addition see the String Services section methods de- scribed in the 字符串的方法 section. To output formatted strings use template strings or the % operator described in the String Formatting Operations section. In addition see the String Services section0 码力 | 1552 页 | 7.42 MB | 9 月前3Python 标准库参考指南 2.7.18
254 9.8 functools —高阶函数和可调用对象上的操作 . . . . . . . . . . . . . . . . . . . . . . . . . . 267 9.9 operator —标准运算符替代函数 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 10 文件和目录访问 279 methods described in the 字 符串的方法 section. To output formatted strings use template strings or the % operator described in the String Formatting Operations section. In addition see the String Services section methods de- scribed in the 字符串的方法 section. To output formatted strings use template strings or the % operator described in the String Formatting Operations section. In addition see the String Services section0 码力 | 1552 页 | 7.42 MB | 9 月前3python3学习手册
Condi�on()方法创建一个条件对象, 条件对象能让一个进程A暂停下来,等待另一个进程B的通知,当进程B 满足某个条件后通知进程A继续运行 import multiprocessing def operator_func(cond, name): cond.acquire() print(name + ": 我可以变更了吗?") cond.notify() # 发消息给Manager,唤醒一个挂起的线程 变更方案有问题,先不变更,先改方案") cond.notify() # 发消息给Operator,唤醒一个挂起的线程 cond.wait() # 等待Operator的回复 print(name + ": 好,可以变更了") cond.notify() # 发消息给Operator,唤醒一个挂起的线程 cond.release() def main(): cond = multiprocessing.Condition() opuser = multiprocessing.Process(target=operator_func, args=(cond, "cof-lee",)) mgmt = multiprocessing.Process(target=manager_func, args=(cond, "boss",))0 码力 | 213 页 | 3.53 MB | 1 年前3Python 标准库参考指南 3.6.15
309 10.2 functools —高阶函数和可调用对象上的操作 . . . . . . . . . . . . . . . . . . . . . . . . . . 323 10.3 operator —标准运算符替代函数 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 11 文件和目录访问 337 会生成虚数(实部为零的复数),你可以将其与整数或浮点数相加来得到具有实部和虚部的复数。 Python fully supports mixed arithmetic: when a binary arithmetic operator has operands of different numeric types, the operand with the “narrower”type is widened to that token_specification = [ ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number ('ASSIGN', r':='), # Assignment operator ('END', r';'), # Statement terminator ('ID', r'[A-Za-z]+'), # Identifiers ('OP', r'[+\-*/]')0 码力 | 1886 页 | 8.95 MB | 9 月前3Python 标准库参考指南 3.6.15
309 10.2 functools —高阶函数和可调用对象上的操作 . . . . . . . . . . . . . . . . . . . . . . . . . . 323 10.3 operator —标准运算符替代函数 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 11 文件和目录访问 337 会生成虚数(实部为零的复数),你可以将其与整数或浮点数相加来得到具有实部和虚部的复数。 Python fully supports mixed arithmetic: when a binary arithmetic operator has operands of different numeric types, the operand with the “narrower”type is widened to that token_specification = [ ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number ('ASSIGN', r':='), # Assignment operator ('END', r';'), # Statement terminator ('ID', r'[A-Za-z]+'), # Identifiers ('OP', r'[+\-*/]')0 码力 | 1886 页 | 8.95 MB | 9 月前3Python 标准库参考指南 3.7.13
301 10.2 functools --- 高阶函数和可调用对象上的操作 . . . . . . . . . . . . . . . . . . . . . . . . 314 10.3 operator --- 标准运算符替代函数 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 11 文件和目录访问 327 同 比较这些数字的精确值一样。 2 构造函数int()、float() 和complex() 可以用来构造特定类型的数字。 所有数字类型(复数除外)都支持下列运算(有关运算优先级,请参阅:operator-summary): 运算 结果: 注释 完整文档 x + y x 和 y 的和 x - y x 和 y 的差 x * y x 和 y 的乘积 x / y x 和 y 的商 x // token_specification = [ ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number ('ASSIGN', r':='), # Assignment operator ('END', r';'), # Statement terminator ('ID', r'[A-Za-z]+'), # Identifiers ('OP', r'[+\-*/]')0 码力 | 1846 页 | 9.09 MB | 9 月前3Python 标准库参考指南 3.7.13
10.2 functools --- 高阶函数和可调用对象上的操作 . . . . . . . . . . . . . . . . . . . . . . . . . . 329 10.3 operator --- 标准运算符替代函数 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 11 文件和目录访问 同比较这 些数字的精确值一样。 2 构造函数int()、float() 和complex() 可以用来构造特定类型的数字。 所有数字类型(复数除外)都支持下列运算(有关运算优先级,请参阅:operator-summary): 运算 结果: 注释 完整文档 x + y x 和 y 的和 x - y x 和 y 的差 x * y x 和 y 的乘积 x / y x 和 y 的商 x // token_specification = [ ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number ('ASSIGN', r':='), # Assignment operator ('END', r';'), # Statement terminator ('ID', r'[A-Za-z]+'), # Identifiers ('OP', r'[+\-*/]')0 码力 | 1961 页 | 9.14 MB | 9 月前3
共 275 条
- 1
- 2
- 3
- 4
- 5
- 6
- 28