Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #66445

Re: ipython

From Peter Otten <__peter__@web.de>
Subject Re: ipython
Date 2014-02-15 15:50 +0100
Organization None
References <slrnlfulce.1hm.greymaus@gmaus.org>
Newsgroups comp.lang.python
Message-ID <mailman.7003.1392475842.18130.python-list@python.org> (permalink)

Show all headers | View raw


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]: 


Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

ipython greymausg <greymaus@mail.com> - 2014-02-15 11:55 +0000
  Re: ipython Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-15 12:25 +0000
    Re: ipython greymausg <greymaus@mail.com> - 2014-02-15 13:55 +0000
      Re: ipython greymausg <greymaus@mail.com> - 2014-02-15 14:55 +0000
  Re:ipython Dave Angel <davea@davea.name> - 2014-02-15 08:14 -0500
  Re: ipython Peter Otten <__peter__@web.de> - 2014-02-15 15:50 +0100

csiph-web