
使用
with,此工具可让您创建一个临时游标,一旦返回上一个缩进级别,该游标将关闭。
from contextlib import closingwith closing( connection.cursor() ) as cursor: (indented) use the cursor(non-indented) cursor is closed.connection.close()
欢迎分享,转载请注明来源:内存溢出

使用
with,此工具可让您创建一个临时游标,一旦返回上一个缩进级别,该游标将关闭。
from contextlib import closingwith closing( connection.cursor() ) as cursor: (indented) use the cursor(non-indented) cursor is closed.connection.close()
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)