PDA

View Full Version : How to make scientific notation the default in the Python interpreter?


andresordonez
Oct27-10, 10:19 PM
Hi, I'm tired of reading numbers like 695500000, and using %e all the time is not a practical solution.

Thanks.

Coin
Oct30-10, 05:26 PM
The Python "interactive mode" is just a REPL loop. You can write your own REPL loop in python pretty easily, and then you will have full control over how output is printed.

Here's someone who wrote their own REPL with complicated command history abilities and stuff. (http://blog.hackthology.com/writing-an-interactive-repl-in-python)

andresordonez
Dec22-10, 11:33 AM
Thanks, though I thought it could be easier than that. I guess I could modify somehow some code of the interpreter.