Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.roellig-ltd.de!open-news-network.org!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '[1]:': 0.09; '[2]:': 0.09; '[3]:': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '(without': 0.16; '9.0': 0.16; '[4]:': 0.16; 'contents:': 0.16; 'created.': 0.16; 'execute,': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'wrote:': 0.18; 'print': 0.22; 'header:User-Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'there': 0.35; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'commands': 0.60; 'name': 0.63; 'abc': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: ipython Date: Sat, 15 Feb 2014 15:50:34 +0100 Organization: None References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p57bdacce.dip0.t-ipconnect.de User-Agent: KNode/4.7.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392475842 news.xs4all.nl 2840 [2001:888:2000:d::a6]:35877 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66445 greymausg wrote: > using IPython, is there any way of recording the commands I have entered? Did you ever enter ? in ipython? In [1]: a = float(raw_input("a? ")) a? 1 In [2]: b = float(raw_input("b? ")) b? 2 In [3]: ab = a + b In [4]: c = ab*ab In [5]: print c 9.0 In [6]: In[1:3] Out[6]: u'a = float(raw_input("a? "))\nb = float(raw_input("b? "))\n' In [7]: %macro abc 1:6 Macro `abc` created. To execute, type its name (without quotes). Macro contents: a = float(raw_input("a? ")) b = float(raw_input("b? ")) ab = a + b c = ab*ab print c In [8]: abc ------> abc() a? 2 b? 2 16.0 In [14]: