ccnsanime_ffmpeg_pool's People
Forkers
a20034294ccnsanime_ffmpeg_pool's Issues
[style] Isolate the settings for the logics
[design] Error handling for external operation
用 os.system
直接跑 script 可能會出錯,建議做一下 error handling,也在 flask 的 handler 做一下,方便使用者知道出了什麼錯
[style] Avoid using import * while importing modules
盡量避免用 import *
,原因是
- Python 精神之一:Explicit is better than implicit
- import 一堆不必要的東西浪費資源
- 你不知道 import 進來的東西會不會撞到 identifier,比如兩個 module 都有
env
這個 object,當你 import * 的時候可能就會被 re-assign 了,但你沒注意到
Ref
[style] use multiple line fstring instead of string concat
別一直用 += 串 string,用 fstring 會比較好,原因是:
- Python 的 string 是 immutable object,
+=
的操作等同於創造新的 object 比較消耗資源,可以在每次 concat 後用id()
看,可以發現每次都是不同 object - fstring 在 CPython 中明顯比較快
Ref
[design] Environment variables should be read only once
環境變數應該只被單一 module 讀取一次,存成變數後提供給其他 module 讀取,原因是:
- 每次都 call 函數讀 env 浪費資源
- Python 每個 Module 執行的時間點不同,沒做好隔離的話可能同個 env variable 讀到不同的 value
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.