0
Как решить эту ошибку?
/storage/emulated/0 $ python test.py File "/storage/emulated/0/test.py", line 4 TOKEN= ''5265488332:AAFd-Ga-ZJECYFuv0WfVspWyJ4593O8wekk"" ^ SyntaxError: invalid syntax /storage/emulated/0 $ Это мне выдаёт pydroid 3 при нажатие на кнопку "Terminal" (Создаю телеграмм-бота)
7 odpowiedzi
+ 1
Do you speak english?
There seems to be a syntax error.
In test.py there shouldn't be a second double quote in the end:
TOKEN="52654...8wekk"➡️"⬅️
❗
Maybe removing the extra double quote it will solve the problem:
TOKEN="5265488332:AAFd-Ga-ZJECYFuv0WfVspWyJ4593O8wekk"
✔️
+ 1
I guess you have to replace the quotes with == operator:
if __name__ == '__#ain__':
0
Here is the whole code:
from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.utils import executor
TOKEN="5265488332:AAFd-Ga-ZJECYFuv0WfVspWyJ4593O8wekk"
bot =Bot(token=TOKEN)
dp=Dispatcher(bot)
@dp.message_handler (conten_types=['text'])
async def telegram (msg: type.Message):
await msg.answer(msg.text.lower())
if __name__"" '__#ain__':
executor.start_polling(dp)
as you can see, everything is fine with the signs, there are no repetitions "
What to do?
0
There is a weird pair of double quotes in:
if __name__➡️""⬅️ '__#ain__':
0
I copied the code from one video, there were these quotes and everything worked...
What should I do with them?
0
Yes, thank
...but it is written that the error is in line 4, quotes, but everything is fine with them
0
Roman Osipov I don't really understand why it says the error would be on line 4, to me line 4 looks fine.
Did fixing line 10 fix the problem?