for() { }
$date = date('H:i')
if($date < "8:00"){
echo 'Нельзя';
}
if($date > "23:00"){
echo 'Нельзя';
}
print(cookies)
Traceback (most recent call last):
File "C:\Users\-\AppData\Local\Programs\Thonny\lib\ast.py", line 35, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "C:\Users\-\Downloads\code .py", line 17
print(cookies)
%
IndentationError: unexpected indent
#TelePY - a new Telegram CLI (command line interface)
from telethon import* #import moodule
from tkinter import*
teleid = StringVar()
teleid.set('@none')
text = StringVar()
text.set('none')
box1 = 'ID of user'
box2 = 'Message'
api_id = 2291983 #---
api_hash = 'eb1da05aa7b364b78c687e918b4e7227' # -telegram init
client = TelegramClient('anon', api_id, api_hash)#---
def send(): #---
async def main(): # - function to send
await client.send_message(teleid, text)#---
root=Tk()
root.title("TelePY")
send = Button(root, text="SEND", command=send) #---
idbox = Entry(root, textvariable=teleid) # -
textbox = Entry(root, textvariable=text) # --gui objects
idtxt = Label(root, text=box1) # -
mtxt = Label(root, text=box2) #---
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) # --set position of objects
textbox.grid(row=1,column=1, padx=5, pady=5)# -
send.grid(row=2, column=1, padx=5, pady=5) #---
root.mainloop()#dont close window
with client:
client.loop.run_until_complete(main())
Traceback (most recent call last):
File "C:\Users\-\telepy.py", line 4, in <module>
teleid = StringVar()
File "C:\Users\-\AppData\Local\Programs\Thonny\lib\tkinter\__init__.py", line 480, in __init__
Variable.__init__(self, master, value, name)
File "C:\Users\-\AppData\Local\Programs\Thonny\lib\tkinter\__init__.py", line 317, in __init__
self._root = master._root()
AttributeError: 'NoneType' object has no attribute '_root'