Suppressing banner on interactive startup?

T

Tim Chase

A couple of hopefully short (interrelated) questions:

1) is there a way to suppress the banner when starting Python
interactively? Something like a "--quiet" that would just drop
you straight to a prompt? I like to use Python as a
nuclear-powered calculator, and am working on a couple little
projects where it would be quite handy to suppress the banner
version/help information (namely, if it gets piped to a
text-to-speech front end, the less noise the better)

2) is there a way to change the two prompts from ">>>" and "..."
to other options? Namely, again with the TTS option, something
that is more TTS friendly than hearing "greater-than greater-than
greater-than". The "dot dot dot" isn't nearly as bad.

I'm not sure what sorts of queries to google for to find this
out. I've tried things like

site:python.org changing interactive interpreter prompt -idle

and

site:python.org suppress start-up banner
site:python.org banner interactive

along with a few such variants, and had no results that seemed to
be what I wanted.

Short of editing CPython source, is there something I've
overlooked? Some command-line option that doesn't get listed in
"python -h" or an environment variable?

Thanks,

-tkc
 
E

Eric

A couple of hopefully short (interrelated) questions:

1) is there a way to suppress the banner when starting Python
interactively? [...]

2) is there a way to change the two prompts from ">>>" and "..."
to other options? [...]

I noticed that the first part of your query was never answered.
To combine both of these, try the following (modified to taste):

python -ic 'import sys; sys.ps1="$ "; sys.ps2="> "'

- Eric
 
T

Tim Chase

1) is there a way to suppress the banner when starting Python
interactively? [...]

2) is there a way to change the two prompts from ">>>" and "..."
to other options? [...]

I noticed that the first part of your query was never answered.
To combine both of these, try the following (modified to taste):

python -ic 'import sys; sys.ps1="$ "; sys.ps2="> "'

Yes, you are correct...while I got an answer to the second half,
I never heard anything about the first half, so I just assumed
there was no way as simple as this. Your answer worked like a
charm, and makes my Text-To-Speech tool all the better. Thanks!

-tkc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top