The error "no operations allowed after statement closed" typically occurs when trying to execute a database query on a closed statement object. Make sure that you're not calling any methods on a statement after it has been closed. Check your code and make sure to properly handle the lifecycle of your statement objects, including opening, executing, and closing them in the correct order.
no operations allowed after statement closed.
相关代码参考
- 'nonetype' object has no attribute 'find_all'30
- traceback (most recent call last): file "c:\users\fanyuanmin\appdata\local\programs\python\python310\lib\tkinter\__init__.py", line 1921, in __call__ return self.func(*args) file "e:\python\ui5.py", line 21, in update_lunar_date lunar_date_str48
- 这个报错的原因是 `lunardate` 对象没有 `strftime` 方法。你可以使用 `lunar_date.format()` 方法来格式化时间,代码应该修改为: ```python lunar_date_str = lunar_date.format('y年m月d日') ``` 按要求修改后报错 traceback (most recent call last): file "c:\users\fanyuanmin\appdata\local\programs\python\python356