Thursday, September 8, 2016

Customise Komode IDE command with python environment

Komodo is a lightweight and great programming IDE. Recently, I use the IDE to work on python. However, I got problem because I need to run the python from some virtual environments. To make it happen, this is what I did:

1. Create a shell script to run the virtual environment. For example we name the shell script runpyenv.sh, we may run the script with runpyenv.sh mycode.py. The code $1 will take the first input argument after the shell script name.

source ~/arwanenv/bin/activate
python $1

2. Now make the shell script to be executable

sudo chmod +x runpyenv.sh

3. Now you put the shell script inside the command of your Komodo. It will be better if you make the file parameter to be automatic. Here is the command in your Komodo