3 ms·
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?
by cabalamat 14y 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?
- ibejoeb 14y agoNot 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.