473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Interactive session, alternating prompt. readline? curses?


Hi all,

I'm looking at building an interactive session in front of some
rdfobj instances. I've used cmd and just found code.Interactive*.

Protocol doesn't matter, I'm looking at the UI possibilities.
History is nice to have and my intention is to write output of
the session to stdin/stderr.

However, my question, can I change the "prompt" string in respond
to user input using readline? AFAIK I'll need curses to do this?
And colored prompts?

Example: the prompt, say '>>>', would change depending on wether
I type '<', '@' or ':' (and autocompletion libraries change too) .

I sometimes see some fancy shell output ('percentage loaded'-bars,
etc) and I'm wondering how to do this with python and what it does
to stdout. Any pointers?
regards, Berend

PS: please cc, I'm not on list
--
web, http://dotmpe.com () ASCII Ribbon
email, berend:dotmpe:com /\
irc, berend/mpe at irc.oftc.net

Mar 25 '07 #1
0 1105

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

Similar topics

12
by: Mike Maxwell | last post by:
When I invoke readline() in a for loop, why does it return a series of one-char strings, rather than the full line? >>> for sL in sys.stdin.readline(): print sL .... abc a b c
3
by: Tomas | last post by:
Hi! I'm looking for a replacement for the standard interactive python shell. So far I've tried IPython and PyCrust. I liked both, but I'm not 100% happy with any of them. My main complaint about...
15
by: Ashot | last post by:
This is sort of both Python and Vim related (which is why I've posted to both newsgroups). Python related: ---------------------- I have been frustrated for quite some time with a lack of a...
20
by: Joe | last post by:
When you run "python -i scriptname.py" after the script completes you left at the interactive command prompt. Is there a way to have this occur from a running program? In other words can I...
3
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...
7
by: Bo Peng | last post by:
Dear list, I have a long list of commands in the form of a script and would like to obtain a log file as if I enter the commands one by one. (The output will be used in a tutorial.) What would...
5
by: Stephan Steiner | last post by:
Hi I'm trying to write a program that interacts with an interactive cli program, that is a program that does some processing but every now and then requires some user input. My problem is that...
3
by: Nikhil | last post by:
Hi, I am using python -i, and I find it hard typing/pasting the commands from the previous interactive shell. Basically, is there anyway that I can preserve the history in the shell? I guess...
8
by: james.kirin39 | last post by:
Hi everyone, After having used Python on Linux for some time, I now have to do Python coding on Windows. I am big fan of the interactive Python shell to test, eg, regexps. Is there an...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...

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.