I have a Python script that I run which needs to execute under a special environment, so I would run the program like so from my working directory (
python manage.py shell
This opens up an interactive shell for me to start typing my own commands.
I have another set of administrative activities that I would like to house in another directory (
~/project/admin). The manage.py is really finicky about running from the working directory. So, to make this whole thing work, I made a script which starts off like so:
#!/usr/bin/python ../src/manage.py shell
There are a couple problems with this. The first is that it doesn't work:
/usr/bin/python: can't open file '"/../src/manage.py" shell': [Errno 2] No such file or directory
- How do you specify multiple parameters to the interpreter?
- How do I change the working directory?