概述
http://bugs.python.org/issue16058
有人可以提出一个优雅的解决方案来手动构建ConfigParser实例的深度复制/复制吗?
非常感谢,-Pete
import StringIO import ConfigParser # Create a deep copy of the configuration object config_string = StringIO.StringIO() base_config.write(config_string) # We must reset the buffer to make it ready for reading. config_string.seek(0) new_config = ConfigParser.ConfigParser() new_config.readfp(config_string)
总结
以上是编程之家为你收集整理的python-2.7 – 在Python 2.7中手动构建ConfigParser的深层副本全部内容,希望文章能够帮你解决python-2.7 – 在Python 2.7中手动构建ConfigParser的深层副本所遇到的程序开发问题。
如果您也喜欢它,动动您的小指点个赞吧