Hacker News new | ask | show | jobs
by cabalamat 4858 days ago
The approach i use is simply:

    $ cat run
    #!/bin/sh
    . venv/bin/activate
    python main.py
Is this wrong? If so, what would work better?
1 comments

Not wrong, but if you're just running a program under a virtualenv (as opposed to doing shell work), just:

/path/to/env/bin/python main.py

will suffice. No need to create a separate shell script, start a new shell, and activate. Great for cronjobs.