473,805 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Suppressing banner on interactive startup?

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

Jul 28 '06 #1
2 2059
On 27 July 2006, Tim Chase wrote:
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
Aug 5 '06 #2
>1) is there a way to suppress the banner when starting Python
>interactivel y? [...]

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
Aug 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6314
by: Christoph Becker-Freyseng | last post by:
Hello, is there a way to dump (and save) the command-history of the python interactive mode. Thanks, Christoph Becker-Freyseng
0
1305
by: Steve Menard | last post by:
I have a strange problem with Python command-line interactive mode. Problem has been observed on every 2.3 version where it was tested, from 2.3 alpha to 2.3.4 Test is run on windows XP and 2000 I have written a ptyhon extension module called jpype, and run the following code D:\>python
0
1480
by: flat_ross | last post by:
I have a service running under SYSTEM in XP that needs to notify the interactive user. From all of my newsgroup reading it looks like it is no longer acceptable to set the service as "Interact with Desktop". I have no problem with that because I actually want to notify certain interactive users. So under Terminal Services or Fast User Switching, I only want to notify a particular interactive user. I could run a second service or exe...
3
1701
by: qwweeeit | last post by:
Hi all, is it possible to enter an interactive session and automatically do some initialization? I explain better: I want that when I start interactive Python on a console (I use Linux) two command lines be executed automatically: Python 2.3.4 (#2, Aug 19 2004, 15:49:40) on linux2 Type "help", "copyright", "credits" or "license" for more information.
4
1966
by: Patrick Rouse | last post by:
Please point me to the correct newsgroup if this is the wrong place to post this question. My website is written in simple HTML and hosted on a windows server at secureserver.net (via GoDaddy). I use an ASP Web Stats program called Power-Stats to track my website traffic, search keywords... The data is stored in an Access Database hosted on my website. I'd like to be able to track how many clicks I get on each of my banner ads,...
3
4615
by: Lubomir | last post by:
Hi, I read that interactive windows services will not be allowed to run under Wista. I would like to ask what exactly is the interactive service. It is supposed to be a service that communicates with desktop. What about the following scenario: A service will create a thread. This thread will create and run an UI Windows application that manages task bar and so on on a desktop. This application will communicate with the service: a/ by...
13
2400
Death Slaught
by: Death Slaught | last post by:
I have my entire page in my "main" div. div.main { width: 100%; height: 100%; border: 1px solid gray; } on the left of the page I have a banner.
0
736
by: Paul Moore | last post by:
How can I suppress a Python warning globally (i.e., for all instances of Python I run)? I have a test suite that runs Python via sys.executable, so the -W flag won't work. A wrapper script doesn't work, as sys.executable doesn't point to that. And PYTHONSTARTUP is only for interactive use, so that's no good... Is there an obvious way I've missed? Surely this is a common issue? Paul.
0
774
by: Jean-Paul Calderone | last post by:
On Thu, 2 Oct 2008 23:39:29 +0100, Paul Moore <p.f.moore@gmail.comwrote: Site-wide configuration is what site customization modules are for. Check out sitecustomize.py in /usr/lib/python<version>/ or the equivalent for your platform/installation. Jean-Paul
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10607
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10104
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7645
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5541
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4317
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3843
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.