Traceback (most recent call last):
File "/home/khan/Desktop/hello.py", line 23, in
with TelegramClient('test', api_id, api_hash) as client:
File "/home/khan/.local/lib/python3.8/site-packages/telethon/client/telegrambaseclient.py", line 294, in __init__
session.set_dc(
File "/home/khan/.local/lib/python3.8/site-packages/telethon/sessions/sqlite.py", line 168, in set_dc
self._update_session_table()
File "/home/khan/.local/lib/python3.8/site-packages/telethon/sessions/sqlite.py", line 194, in _update_session_table
c.execute('delete from sessions')
sqlite3.OperationalError: database is locked
for chat in chats: with TelegramClient('test', api_id, api_hash) as client: for message in client.iter_messages(chat, offset_date=datetime.date.today() , reverse=True): print(message) data = { "group" : chat, "sender" : message.sender_id, "text" : message.text, "date" : message.date}
df.to_excel("C:\\crypto\\data_{}.xlsx".format(datetime.date.today()), index=False) [/code] Результат приведенного выше кода: [code]Traceback (most recent call last): File "/home/khan/Desktop/hello.py", line 23, in with TelegramClient('test', api_id, api_hash) as client: File "/home/khan/.local/lib/python3.8/site-packages/telethon/client/telegrambaseclient.py", line 294, in __init__ session.set_dc( File "/home/khan/.local/lib/python3.8/site-packages/telethon/sessions/sqlite.py", line 168, in set_dc self._update_session_table() File "/home/khan/.local/lib/python3.8/site-packages/telethon/sessions/sqlite.py", line 194, in _update_session_table c.execute('delete from sessions') sqlite3.OperationalError: database is locked [/code] Как это решить?