Home
Sign Up
Sign In
推荐学习书目
›
Learn Python the Hard Way
Python Sites
›
PyPI
- Python Package Index
›
http://diveintopython.org/toc/index.html
›
Pocoo
值得关注的项目
›
PyPy
›
Celery
›
Jinja2
›
Read the Docs
›
gevent
›
pyenv
›
virtualenv
›
Stackless Python
›
Beautiful Soup
›
结巴中文分词
›
Green Unicorn
›
Sentry
›
Shovel
›
Pyflakes
›
pytest
Python 编程
›
pep8 Checker
Styles
›
PEP 8
›
Google Python Style Guide
›
Code Style from The Hitchhiker's Guide
V2EX
›
Python
求姿势_类的批量实例化
itlynn
·
Jun 14, 2016
· 2690 views
This topic created in 3645 days ago, the information mentioned may be changed or developed.
Python 中可以用 getattr()来实现工厂函数 那么问题来了,能否批量实现生成类的实例?
实例
Python
getattr
函数
4 replies
•
2016-06-15 17:34:49 +08:00
1
aisk
Jun 14, 2016
循环里生成。。。
2
knightdf
Jun 15, 2016
批量生成类都可以
3
sleshep
Jun 15, 2016
exec 'a%d=Class()'%i
4
itlynn
OP
Jun 15, 2016 via iPhone
@
sleshep
这个我知道,有没有更 pythonic 的方式
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
3748 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 55ms ·
UTC 04:33
·
PVG 12:33
·
LAX 21:33
·
JFK 00:33
♥ Do have faith in what you're doing.
❯