标签:style color io os 使用 ar for 文件 sp
try:
... except exception1:
... except exception2:
... except:
... else:
... finally:
...
如果没有异常,则执行else语句,如果没有对应的异常类型则会向上层抛出异常# with context manager
with open("new.txt", "w") as f: print(f.closed) f.write("Hello World!") print(f.closed)
def decorator(F):
def new_F(a, b):@decorator def square_sum(a, b): return a**2 + b**2
print("I‘m %(name)s. I‘m %(age)d year old" % {‘name‘:‘Vamei‘, ‘age‘:99})(使用字典传递真实值)
标签:style color io os 使用 ar for 文件 sp
原文地址:http://www.cnblogs.com/phenixyu/p/3967197.html