473,770 Members | 6,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make command history persistent?

Hello,

My question is:
Is there an easy mean to make Python "command history"
persistent across interpreter invokations?

PS:
In the case the question above is not clear, I rephrase
it below verbosely...
When I work from the Python prompt, I enjoy features
like command line editing and searching/recalling
previous lines of code from the history.
(This is similar to working from a Unix shell prompt.)
But I would like, in addition, be able to keep the history
from one session to another (when I quit Python, the history
is lost, but I would like to retrieve it each time In
invoke again Python interactively).

Thanks

Oct 18 '05 #1
2 2341

If using unix, you should have readline available.
See the tutotial appendix:-

http://www.python.org/doc/current/tut/node15.html

Regards, Paul Clinch

Oct 18 '05 #2
Great! The indicated "history save" works!
Thanks

Oct 18 '05 #3

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

Similar topics

8
1333
by: Siemel Naran | last post by:
Hi. I'm writing a command shell that reads commands from standard input. At this point I have the command in a std::string. Now I want to execute this command in the shell. From the Borland newsgroups I learned that there is a function in stdlib.h called system. int system(const char *command); First question, is the system command ANSI compliant. Because I include <cstdlib> and write std::system(command.c_str()); it looks like an...
0
1388
by: Herb Green | last post by:
We have just recently went from V7 to V8.1 fixpack 3. I do most of my work using the Command Center gui and use the "Log command in history file" option as an audit trail of the commands that I have issued. The problem I have noticed is that with V8 this file does not work the same as it did in V7. It does not specify the date and time the command was executed nor does it indicate whether it excecuted successfully or not. Both of these...
2
3399
by: bwmiller16 | last post by:
Guys - Does the PRUNE logfile command do anything other than just do a simple delete of the files? Or is there more to it internally in DB2? Thanks in Advance, -B
7
2701
by: Steven Bethard | last post by:
I've updated PEP 359 with a bunch of the recent suggestions. The patch is available at: http://bugs.python.org/1472459 and I've pasted the full text below. I've tried to be more explicit about the goals -- the make statement is mostly syntactic sugar for:: class <name> <tuple>: __metaclass__ = <callable>
0
3394
by: namanhvu | last post by:
I've installed MySQL v4.1 onto my WinXP and unfortunately now need to reinstall my OS. I need to access my mysql command line history but don't know how. I know there's a .mysql_history file but that's just on Unix. Is there a similar file in Windows? If not, how does mysql remember all the commands? Where is it's buffer? Also, the doskey /history command only gives a history of the cmd.exe prompt so that's not what I want either.
6
9699
by: John Grandy | last post by:
Does how to delete all of IE's browing history from the command line ? Same as Tools Internet Options Browsing History Delete Delete all... What I'd like is a .bat file.
38
5078
by: ted | last post by:
I have an old link that was widely distributed. I would now like to put a link on that old page that will go to a new page without displaying anything.
1
1593
by: flanker9876 | last post by:
Hello Everyone, I have Windows XP. I hope that someone can assist me with the command prompt. Does anyone know if the commands I enter into the command prompt are automatically saved to a session/history file on the C drive and/or in the registry? For example, I would like to open this "file" and view the commands I have entered (e.g. ls –l, CD.., ipconfig /all). I am not looking to manually forward the commands or output to a text file; I...
12
2491
by: raylopez99 | last post by:
I have an array that I wish to preserve as "read only". The array holds references to variables myObjects instantiated by new that change all the time. The variables are part of a class that I used ICloneable on, namely "Clone();" (deep and/or shallow copies worked the same for this particular class). Using ICloneable, I am able to successfully make a copy of the variables like so:
0
9591
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
9425
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
9867
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...
0
8880
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
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
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
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...
1
3969
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
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.