世界只因有你2017-05-16 13:01:38
Yes, you can use the context manager to complete your needs. This is what I did. I have written relevant code. You can refer to it. You need to pay attention to the exception assistant. If you want exception handling to be more elegant, you can use decoration at the same time. device
Metadata operation code db_execute()
Specific example of save() function, pay attention to the with statement block
You can also read this blog