Answer the question
In order to leave comments, you need to log in
Could you rate my Python code?
Could you rate the code of my project, which I did for the final qualifying work.
I would like to hear what things you should pay attention to, how to improve your code.
GitHub: https://github.com/ApXNTekToP/MerchTelegramBot
You can test the bot here: https://t.me/testmerchant_bot
Thank you for your attention!
Answer the question
In order to leave comments, you need to log in
Looked out of the corner of my eye
1. routing.py: replace the regular expression with something more readable, for example:
2.main.py: class Register: move the compilation of the regular expression to the beginning of the code:if 'some' in text:
import re
MY_RE = re.compile(f'some pattern')
class Register:
user_response = MY_RE.findall(self.text)
# Keep main program running while bot runs threaded
if __name__ == "__main__":
while True:
try:
sleep(120)
except KeyboardInterrupt:
break
class InterfaceInteraction(classmethod):
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question