Answer the question
In order to leave comments, you need to log in
Why is the Python version being downgraded?
From the hoster I have
a virtual environment in python 3.8
, not a VPS, so I
didn’t have enough rights
and earned a bot
session through putty
closed the session - the bot stopped working
created the session again and decided to check the python version
changed by itself from 3.8 to 2.75 to the most old from hoster
1 Hoster has a problem? Silent for now
2 Is there a problem in the current code?
import telebot
token = '5045270686:AAEOxCH'
bot = telebot.TeleBot(token)
GROUP_ID = "@buest"
inputfile = '1.txt'
f = open(inputfile, mode='r', encoding='utf-8')
blacklist = list(map(str.strip, f.readlines()))
@bot.message_handler(content_types=["text"])
def handle_text(message):
for x in blacklist:
if (x in message.text):
bot.delete_message(message.chat.id, message.message_id)
else:
pass
if __name__ == "__main__":
bot.infinity_polling()
Answer the question
In order to leave comments, you need to log in
You need to turn your head a little and read about how SSH and the Unix shell of the system work. Googling like "SSH keep program running" would quickly lead you to the right place.
1. When you connect via SSH, the server runs a copy of bash or sh (or whatever shell you use) as your user.
<br>
sshd<br>
- bash<br>
<br>
sshd<br>
- bash<br>
- activate <br>
- bash<br>
<br>
sshd<br>
- bash<br>
- activate<br>
- bash<br>
- python3 your_script.py<br>
<br>
sshd "sshd: эй, bash, завершайся"<br>
- bash "bash: эй, activate, завершайся. А теперь я сам завершусь."<br>
- activate "activate: эй, bash, завершайся. А теперь я сам завершусь"<br>
- bash "bash: эй, python3, завершайся. А теперь я сам завершусь"<br>
- python3 your_script.py "python3: хорошо, завершаюсь."<br>
sshd
nohup python3 your_script.py &
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question