Record some trick of python3
reference
- Fluent Python https://evanli.github.io/programming-book-3/Python/Fluent%20Python.pdf
- python3-cookbook https://python3-cookbook.readthedocs.io/zh_CN/latest/preface.html
Building Lists of Lists
1 | '_'] * 3 for i in range(3)] board = [[ |
A += Assignment Puzzler
1 | 1, 2, [10, 20]) t = ( |
difference between dir and dict in python
- https://stackoverflow.com/questions/14361256/whats-the-biggest-difference-between-dir-and-dict-in-python
The same applies to many built-in types; lists do not have a dict attribute, but you can still list all the attributes using dir()
PyCharm
The Python IDE for Professional Developers https://www.jetbrains.com/pycharm/
- wechat article https://mp.weixin.qq.com/s/dc2vR8mcVsXJirIcRpsLYg
issue
Record issue that I cannot find in google
.DS_Store
after operation in some one folder, there is .DS_Store. Then I run following code
1 | for fn in os.listdir("migrations/versions"): |
after deleting .DS_Store, all is good.
pycharm stuck
If you open PyCharm is always stuck, you can try delete this .idea folder