
Dec. 29, 2014
1:31 p.m.
On Mon, Dec 29, 2014 at 07:46:02AM +0000, Mark Lawrence wrote:
+1 from me as I'm always forgetting the "obvious" imports such as sys and os when trying things interactively.
This is why I have a startup.py file that contains (among other things): import sys, os I'm not sure how you set environment variables under Windows, but under Linux I put this in my .bashrc file: export PYTHONSTARTUP=/home/steve/python/utilities/startup.py and whenever I start an interactive session, I get the common imports that I want, a custom prompt (I use 'py>' rather than '>>>') and assorted other goodies. -- Steven