差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 | |||
public:it:python [2018/02/28 13:48] – 外部编辑 127.0.0.1 | public:it:python [2024/01/15 15:33] (当前版本) – [Tips] oakfire | ||
---|---|---|---|
行 6: | 行 6: | ||
* In Terminal, type '' | * In Terminal, type '' | ||
* python为动态语言, | * python为动态语言, | ||
+ | * python 变快的 9 个技巧:[[https:// | ||
+ | * 拼接字符串的速度, | ||
+ | * Faster List Creation: Use “[]” Over “list()” 用 '' | ||
+ | * Faster Membership Testing: Use a Set Over a List | ||
+ | * Faster Data Generation: Use Comprehensions Over For Loops 用内包代替循环 | ||
+ | * Faster Loops: Prioritize Local Variables 优先使用局部变量 | ||
+ | * Faster Execution: Prioritize Built-In Modules and Libraries 优先用内置模块和库 | ||
+ | * Faster Function Calls: Leverage Cache Decorator for Easy Memoization | ||
+ | * Faster Infinite Loop: Prefer “while 1” Over “while True” 但是现代解释器基本都优化过, '' | ||
+ | * Faster Start-Up: Import Python Modules Smartly | ||
===== 从零开始 ===== | ===== 从零开始 ===== | ||
* [[http:// | * [[http:// |