For my django projects, I wanted to write a simple replacement for manage.py shell
to take advantage of bpython. Essentially all it does is run setup_environ(settings)
and then import some common models (User, etc.)
in any case, everything works fine when I run bpython -i bshell.py
(my script is named bshell.py). Then I thought I'd get clever and set the hashbang line to #!/usr/bin/env bpython -i
to make it even simpler, and this worked on the OSX but is not working now in Ubuntu (10.10).
#!/usr/bin/env python -i
also does not work, but #!/usr/bin/env bpython
works (but obviously doesn't drop into the interactive prompt).
It's a small point, but over the course of my life it will save me hundreds of "bpython -i"s if I can just run my script as ./bshell.py
(really I'm just curious). Any ideas why it's not working on Ubuntu?
I should note I'm in a virtualenv, and I already double checked that line endings are *nix style.