PythonBiglove 2009-08-28
代码如下:
import os
while True:
dynamic = input('输入计算表达式:')
if dynamic != 'cls':
try:
result = eval(dynamic)
print('计算结果:'+str(result))
except:
print('计算表达式输入有误!')
else:
command = 'cls'
os.system(command) class Singleton: def __new__: # 关键在于这,每一次实例化的时候,我们都只会返回这同一个instance对象 if not hasattr: cls.instance =