Is it possible to run a Paster shell with pre-imported modules?

Is it possible to run "paster shell blah.ini" (or its variant) and download certain libraries?

I donโ€™t like always typing โ€œfrom foo.bar import mystuffโ€ as the first command in every pasteur shell and would like the computer to do this for me.

+5
source share
2 answers

You can try creating a sitecustomize.py script file. If you have this in the same folder as your pasteur shell, the python interpreter should load it at startup.

, sitecustomize.py, , . , , , , -, , .

, , . (a la py2exe), .

. :

http://www.rexx.com/~dkuhlman/pylons_quick_site.html#using-an-ipython-embedded-shell http://pylonshq.com/project/pylonshq/ticket/428

+2

PYTHONSTARTUP , .

, , .

iPython, ( readline). ,% run script , .

Edit:

. , , script ipython, %run myscript.py

Edit:

, ( . ), Pylons iPython, iPython . , , , iPython ( python).

0

All Articles