How to make scientific notation the default in the Python interpreter?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 5K views
andresordonez
Messages
65
Reaction score
0
Hi, I'm tired of reading numbers like 695500000, and using %e all the time is not a practical solution.

Thanks.
 
Physics news on Phys.org
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.

http://blog.hackthology.com/writing-an-interactive-repl-in-python
 
Last edited by a moderator:
Thanks, though I thought it could be easier than that. I guess I could modify somehow some code of the interpreter.