Logging in to Telegram using Telethon
Hi, I am trying to access my telegram account through Python using telethon. However, my code runs and does nothing happens, only 2 documents (called .session) get created on my desktop. Whenever I run the code again while these 2 documents are on my desktop, I get an error: OperationalError: database is locked. However, if I delete these documents, then my code runs, but again nothing happens. I seem to understand how the library works, but it literally has almost no explanation about how to log in to my account before starting to use all of the methods they have in the library. Here is the code I am running (on Anaconda Spyder): api_id = ******** api_hash = "*********************************" phone = "************" #obviously I have the correct values instead of the * signs client = TelegramClient('some_name', api_id, api_hash) client.connect() if not client.is_user_authorized(): client.send_code_request(phone) client.sign_in(phone, input("Verification code: ")) me = client.get_me() print(me) Thanks for any help, I seem to be very stuck here.