Is it possible to run "paster shell blah.ini" (or a variant thereof) and have it automatically load certain libraries?
I hate having to always type "from foo.bar import mystuff" as the first command in every paster shell, and would like the computer to do it for me.
An option to try would be to create a sitecustomize.py script. If you have this in the same folder as your paster shell, the python interpreter should load it up on startup.
Let me clarify, sitecustomize.py, if found, is always loaded on startup of the interpreter. So if you put it where it can be found, ideally somewhere that is only found when the paster shell starts, then you should be able to add your imports to it and have them be ready.
This is probably your best bet. If the paster shell is a packaged app (a la py2exe) it should still work.
See also:
http://www.rexx.com/~dkuhlman/pylons_quick_site.html#using-an-ipython-embedded-shell http://pylonshq.com/project/pylonshq/ticket/428
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With