Hello:

I have been using CPython as a calculator, while I do all those number crunching in C. SO, 'import math' is a must.

This is what I did:

- Create a file: .pythonrc in my $HOME and place this line:

 <code>
   import math
</code>

- Now in your BASH, .bashrc or similar: export PYTHONSTARTUP= $HOME/.pythonrc

Everytime you start Python interactively, you should have the 'math' module already imported.

<code>

$ python
Python 2.6.4rc1 (r264rc1:75270, Oct 10 2009, 02:40:56)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> math.pi
3.1415926535897931

</code>

Hope this helps.


-Amit
--
Journal: http://amitksaha.wordpress.com
ยต-blog: http://twitter.com/amitsaha
IRC: cornucopic on #scheme, #lisp, #math, #linux
_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to