文件名称:pyexperiment:使用 Python 运行实验 - 快速而干净
文件大小:123KB
文件格式:ZIP
更新时间:2024-08-24 20:50:52
Python
实验 Pyexperiment 使用最少的样板代码促进了小型、可重复的实验的开发。 考虑下面的例子,实现一个简单的程序来存储数字并计算它们的总和: from pyexperiment import experiment , state , conf , log conf [ 'pyexperiment.save_state' ] = True conf [ 'pyexperiment.load_state' ] = True conf [ 'message' ] = "The stored numbers are: " def store ( number ): """Store a number""" if 'numbers' not in state : log . debug ( "Initialize state['numbers'] to e