Run python code from your telegram chat!
UPDATE I am no longer running this bot on my server. Please deploy your own instance to use.
- Tweet by Dev Community
- Tweet by The Python Dev
- Dor Moshe's Newsletter
- My YouTube Video Chatting with Python
You may use pythonic expressions to easily calculate any complex problem. Or you may test your algorithms on the go.
You can easily run your own instance of the bot.
You can run on any OS (windows/mac/linux). For better reliability, you may deploy to a VPS like Digital Ocean Droplet. You can even run on Android, using the Termux app.
Open your terminal and follow the instructions to run the bot.
Note: Use python 3.8
-
Make sure you have
git
,python
andpip
.# the following commands should not produce error git --version python --version # 3.8 is recommended pip --version
Note: In some systems
python
version 3 is availaible aspython3
-
First of all, clone the repository and move into the
run-py-bot
directory.git clone https://github.com/aahnik/run-py-bot.git && cd run-py-bot
-
Create a python virtual enviroment and activate it.
python -m venv .venv # create source .venv/bin/activate # activate (unix) # the command to activate virtual environment is different for Windows, google search
-
Install the requirements.
pip install -r requirements.txt
-
Set
API_TOKEN
environment variable. Write the following into a file named.env
.API_TOKEN=1234fsjksjfls23r4 # use your own real token
You can create a new bot and get token from @BotFather.
-
Run the
start.py
, and you are good to go.python start.py
You can click this button to deploy to Heroku.
For more details read the guide about Heroku deployment.
See the Releases tab for more info.
Issues and PRs welcome!
If planning to contribute code, Read the docstrings in the code for details. You will find lots of helpful links to stack overflow and documentation of libraries used.
Here are some useful links: