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


Groups > comp.lang.python > #55481

Re: ipy %run noob confusion

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <jshrager@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'context': 0.07; 'worked.': 0.09; 'cc:addr:python-list': 0.11; '"real"': 0.16; '.py': 0.16; 'buffer.': 0.16; 'cc:name:python list': 0.16; 'emacs,': 0.16; 'expecting': 0.16; 'magic': 0.16; 'means.': 0.16; 'opposite': 0.16; 'somehow,': 0.16; 'sorts': 0.16; 'shell': 0.22; 'cc:addr:python.org': 0.22; 'commands,': 0.24; 'rid': 0.24; 'sends': 0.24; 'cc:2**0': 0.24; 'script': 0.25; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'generally': 0.29; 'mode': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; '(my': 0.31; 'concern': 0.31; 'context.': 0.31; 'helpful.': 0.31; 'allows': 0.31; 'this.': 0.32; 'probably': 0.32; 'regular': 0.32; 'running': 0.33; 'editor': 0.35; 'but': 0.35; 'received:google.com': 0.35; "didn't": 0.36; 'useful': 0.36; 'thanks': 0.36; 'should': 0.36; 'skip:& 10': 0.38; 'thank': 0.38; 'skip:& 20': 0.39; 'does': 0.39; 'bad': 0.39; 'extremely': 0.39; 'guidance': 0.39; 'you.': 0.62; 'more': 0.64; 'fire': 0.65; 'to:addr:gmail.com': 0.65; 'discovered': 0.83; 'again!': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=a7d9DpyiiUOspvwd0ltLfP6eXQUgBpR6hTpGF9d22iU=; b=Hr571s8S4G1UtKVEk9idM93f3TEf07dgOVSPNbA6SrHthJtFs4CaIHz7l0M3EGckiw ndvx+XHwJIYENPym6NQE5fI7lhuNA0aqNi7HG2IKRgBndme/ucrVdAtK74wE7H/qwpqT MZ48AD8Of4+vIysLfdiX91jnWWcYbobLcIcDA6BJiPY49hM/7t30rIMxK9YPPns3WjlE Yp8Geb0tgHA2YB029mQnCfFiVvYDzyDUCAQHAW222yEGa/zPXgGDqKKH3M3/Iw7jdSTH dRGOfTN6gmE6WpxaCa+psE6UXyHLcXHuYyD33QaMP5Z3Xbz0sZ9xkGtaoNZ4sscYMPmM hjEw==
MIME-Version 1.0
X-Received by 10.49.37.193 with SMTP id a1mr17704834qek.56.1380896208166; Fri, 04 Oct 2013 07:16:48 -0700 (PDT)
In-Reply-To <CAHVvXxTnF+spc7Q5arvu54UF28yoZsPnvz_RJEgyjQ=wJ94_tg@mail.gmail.com>
References <fa461da1-19d9-41e5-8af2-de6c73540023@googlegroups.com> <CAHVvXxTnF+spc7Q5arvu54UF28yoZsPnvz_RJEgyjQ=wJ94_tg@mail.gmail.com>
Date Fri, 4 Oct 2013 07:16:48 -0700
Subject Re: ipy %run noob confusion
From Jeff Shrager <jshrager@gmail.com>
To Oscar Benjamin <oscar.j.benjamin@gmail.com>
Content-Type multipart/alternative; boundary=047d7bb04252f5a4d204e7eaf37d
Cc Python List <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.723.1380896217.18130.python-list@python.org> (permalink)
Lines 51
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1380896217 news.xs4all.nl 15959 [2001:888:2000:d::a6]:32816
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:55481

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Thank you. This is extremely helpful. The key that I was missing is that
it's running them outside of the ipy context. I also discovered that if you
call the script .ipy instead of .py, it actually does more or less what I
was expecting -- that is, it allows magic commands, and I got the thing
working as desired through this means.

I do appreciate the concern that my script should be "real" python, and I
would aim for that eventually, but while I'm experimenting, it's useful to
be able to have the interactive and script work the same way. I'm happy to
"real-ify" it later.

BTW, I generally work the opposite way than %edit: I code in emacs, and
have a shell that's running ipy. Actually ipy is bad at this because it
sends all sorts of terminal crap that I can probably get rid of somehow,
but working this way has many advantages, not the least of which is that
you don't have to fire up editors over and over (my editor context is
primary), and I get an automatic log of my whole session in the shell
buffer. This mode has served me well using regular python, because I didn't
have the .ipy v. .py problem, but when I started into ipyton, things no
longer worked. But your guidance (and others) have help deconfuse me on
this. Thanks again!

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


Thread

ipy %run noob confusion jshrager@gmail.com - 2013-10-03 10:42 -0700
  Re: ipy %run noob confusion Terry Reedy <tjreedy@udel.edu> - 2013-10-03 15:26 -0400
  Re: ipy %run noob confusion Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-03 20:34 +0100
  Re: ipy %run noob confusion Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-10-04 10:36 +0100
  Re: ipy %run noob confusion Jeff Shrager <jshrager@gmail.com> - 2013-10-04 07:16 -0700

csiph-web