Мне нужно сделать результат, типо такого:
User ID [_̅_̅_̅_̅_̅_̅_̅_̅_̅]
Message [_̅_̅_̅_̅_̅_̅_̅_̅_̅]
[O̲̅K̲̅]
Вот мой код:
#TelePY - a new Telegram CLI (command line interface)
from telethon import* #import moodule
from tkinter import*
teleid = '@none'
text = 'none'
box1 = 'ID of user'
box2 = 'Message'
def send():
async def main():
# Now you can use all client methods listed below, like for example...
await client.send_message(teleid, text)
root=Tk()
root.title("Tele")
send = Button(root, text="SEND", command=send) #---
idbox = Entry(textvariable=teleid) # -
textbox = Entry(textvariable=text) # --gui objects
idtxt = Label(textvariable=box1) # -
mtxt = Label(textvariable=box2) #---
textbox.pack()
idbox.pack()
idtxt.pack()
mtxt.pack()
send.pack()
idtxt.grid(row=0, column=0, sticky="w")
mtxt.grid(row=1, column=0, sticky="w")
idbox.grid(row=0,column=1, padx=5, pady=5)
textbox.grid(row=1,column=1, padx=5, pady=5)
root.mainloop()#dont close window
# paste api_id and api_hash
api_id = 2291983
api_hash = 'eb1da05aa7b364b78c687e918b4e7227'
client = TelegramClient('anon', api_id, api_hash)
with client:
client.loop.run_until_complete(main())
Ошибка:
Traceback (most recent call last):
File "/home/kostya/TelePY/main.py", line 29, in <module>
idtxt.grid(row=0, column=0, sticky="w")
File "/usr/lib/python3.8/tkinter/__init__.py", line 2484, in grid_configure
self.tk.call(
_tkinter.TclError: cannot use geometry manager grid inside . which already has slaves managed by pack