David Strozzi | 3 Jul 07:51
Picon

ipython emacs pylab?

Hi,

Is there a way to make ipython play nicely w/ matplotlib (namely,
pylab) from within emacs?  In a plain terminal, you can do ipython
-pylab.  Then, when you plot something, you don't have to type show()
to see it, or kill the figure to get to the prompt.

I'm almost certain there's a way.  But I re-installed linux and a
bunch of stuff got lost...  Perusal of the web hasn't helped so far.

Whatever the answer, perhaps it should be added to the comments in
ipython.el, or to:

http://ipython.scipy.org/doc/manual/index.html#x-emacs-configuration

Thanks much,
David Strozzi
Fernando Perez | 3 Jul 08:05
Picon
Gravatar

Re: ipython emacs pylab?

On Wed, Jul 2, 2008 at 10:51 PM, David Strozzi <david.strozzi <at> gmail.com> wrote:
> Hi,
>
> Is there a way to make ipython play nicely w/ matplotlib (namely,
> pylab) from within emacs?  In a plain terminal, you can do ipython
> -pylab.  Then, when you plot something, you don't have to type show()
> to see it, or kill the figure to get to the prompt.
>
> I'm almost certain there's a way.  But I re-installed linux and a
> bunch of stuff got lost...  Perusal of the web hasn't helped so far.

Yup, just use this in your .emacs file

;; Configure the ipython call for pylab use
(setq py-python-command-args '("-pylab" "-colors" "LightBG"))

(obviously adjust to taste).

> Whatever the answer, perhaps it should be added to the comments in
> ipython.el, or to:
>
> http://ipython.scipy.org/doc/manual/index.html#x-emacs-configuration

Will do.

Cheers,

f
Ville M. Vainio | 4 Jul 18:55
Picon
Gravatar

Feature: string list 'sort()' method added

Typically, you can't be bothered to remember the flags all the system
commands use for sorting the output. SList.sort() helps here (field 4
is the fifth field, the numeric size):

[docs/howto]|41> a = !ls -l
[docs/howto]|42> a
            <42> SList (.p, .n, .l, .s, .grep(), .fields(), sort() ava
ilable):
0: total 52
1: -rw-r--r-- 1 ville ville  2702 2008-05-15 14:07 html-stylesheets.tx
t
2: -rw-r--r-- 1 ville ville  7301 2008-05-15 14:07 i18n.txt
3: -rw-r--r-- 1 ville ville 16428 2008-05-15 14:07 rst-directives.txt
4: -rw-r--r-- 1 ville ville  8662 2008-05-15 14:07 rst-roles.txt
5: -rw-r--r-- 1 ville ville  5800 2008-05-15 14:07 security.txt
[docs/howto]|43> a.sort(4, nums = True)
            <43> SList (.p, .n, .l, .s, .grep(), .fields(), sort() available):
0: total 52
1: -rw-r--r-- 1 ville ville  2702 2008-05-15 14:07 html-stylesheets.tx
               t
2: -rw-r--r-- 1 ville ville  5800 2008-05-15 14:07 security.txt
3: -rw-r--r-- 1 ville ville  7301 2008-05-15 14:07 i18n.txt
4: -rw-r--r-- 1 ville ville  8662 2008-05-15 14:07 rst-roles.txt
5: -rw-r--r-- 1 ville ville 16428 2008-05-15 14:07 rst-directives.txt
[docs/howto]|44>

I also changed '%cpaste foo' to assign the pasted block to foo as
string list (which is much more useful than just assigning as string).

--

-- 
(Continue reading)

Fernando Perez | 4 Jul 20:55
Picon
Gravatar

Re: Feature: string list 'sort()' method added

On Fri, Jul 4, 2008 at 9:55 AM, Ville M. Vainio <vivainio <at> gmail.com> wrote:
> Typically, you can't be bothered to remember the flags all the system
> commands use for sorting the output. SList.sort() helps here (field 4
> is the fifth field, the numeric size):

Nice, thanks!

I'm going to commit some of the testing changes today, let's try to
start putting in tests for all new such features in docstrings.  I'll
work on this now and will ping back later once it's in.

Cheers,

f
Fernando Perez | 5 Jul 00:15
Picon
Gravatar

Re: ipython emacs pylab?

On Wed, Jul 2, 2008 at 11:05 PM, Fernando Perez <fperez.net <at> gmail.com> wrote:

>> Whatever the answer, perhaps it should be added to the comments in
>> ipython.el, or to:
>>
>> http://ipython.scipy.org/doc/manual/index.html#x-emacs-configuration
>
> Will do.

Done in both places, will be pushed upstream later.

Cheers,

f
David Strozzi | 5 Jul 00:24
Picon

Re: ipython emacs pylab?

Thanks a lot!  I can now happily use ipython, pylab, numpy, emacs, all
at once.  -dave

On Fri, Jul 4, 2008 at 3:15 PM, Fernando Perez <fperez.net <at> gmail.com> wrote:
> On Wed, Jul 2, 2008 at 11:05 PM, Fernando Perez <fperez.net <at> gmail.com> wrote:
>
>>> Whatever the answer, perhaps it should be added to the comments in
>>> ipython.el, or to:
>>>
>>> http://ipython.scipy.org/doc/manual/index.html#x-emacs-configuration
>>
>> Will do.
>
> Done in both places, will be pushed upstream later.
>
> Cheers,
>
>
> f
>
Fernando Perez | 7 Jul 03:34
Picon
Gravatar

Wiki edit policy change

Hi all,

for a very long time, Ryan James has tirelessly been cleaning up spam
on the wiki, but that's neither fun nor fair nor a wise use of
resources (his time in this case).  We recently realized, with Jarrod
Millman's help, what  the problem was: all the recommended techniques
for disabling Moin account creation (at least the publicly listed
ones) fail hopelessly,  because from any existing logged in user, it
is trivial to trick Moin into auto-generating new user accounts that
it  recognizes.

So instead of the ineffective account creation block, I've changed
things to openly allow new accounts, but without write privileges.
Only users listed here:

http://ipython.scipy.org/moin/WritersGroup

can edit pages.   I went through all the logs I could find to add
everyone I could find that seemed like a valid user, please just let
us know and we'll add you if I missed you.  Please note that anyone in

http://ipython.scipy.org/moin/EditorsGroup

can edit the WritersGroup page and add new names, so it should be
trivial to get added if you want to contribute, just ask here on the
list or email an editor (or me) and we'll add you right away.

Hopefully this will now work, since ACLs in Moin seem to be more
robust than their Gruyère cheese security model for user creation.

(Continue reading)

skip | 7 Jul 19:37
Picon
Favicon

Re: Wiki edit policy change


    Fernando> Please note that anyone in

    Fernando> http://ipython.scipy.org/moin/EditorsGroup

    Fernando> can edit the WritersGroup page and add new names, so it should
    Fernando> be trivial to get added if you want to contribute, just ask
    Fernando> here on the list or email an editor (or me) and we'll add you
    Fernando> right away.

FWIW, that page appears to be unreadable, even when logged in, so it won't
work as a way to discover an editor to contact for write privileges.  (No,
I'm not asking for write privileges.  Just checking the setup.)

Skip
Fernando Perez | 7 Jul 20:10
Picon
Gravatar

Re: Wiki edit policy change

On Mon, Jul 7, 2008 at 10:37 AM,  <skip <at> pobox.com> wrote:
>
>    Fernando> Please note that anyone in
>
>    Fernando> http://ipython.scipy.org/moin/EditorsGroup
>
>    Fernando> can edit the WritersGroup page and add new names, so it should
>    Fernando> be trivial to get added if you want to contribute, just ask
>    Fernando> here on the list or email an editor (or me) and we'll add you
>    Fernando> right away.
>
> FWIW, that page appears to be unreadable, even when logged in, so it won't
> work as a way to discover an editor to contact for write privileges.  (No,
> I'm not asking for write privileges.  Just checking the setup.)

Thanks, fixed.  It turns out ACLs in Moin are super-picky about whitespace:

#acl EditorsGroup:read, write, revert, admin All:read

turned out to be (silently) invalid, it should be:

#acl EditorsGroup:read,write,revert,admin All:read

(no spaces after the commas).

Cheers,

f
David M. Kaplan | 8 Jul 17:31
Favicon

help with embedding

Hi,

I am starting to use ipython as a replacement for matlab.  I have been
trying to use IPShellEmbed to create a "keyboard-like" command for
ipython and have some problems/questions.  keyboard is a command in
matlab that you stick in a script that allows you to drop out of the
script and into a manual entry state where you have access to the same
namespace as the script and can look at and modify variables.  As I
understand, this is the purpose of IPShellEmbed (except for modifying
variables, which I don't think it allows - correct me if I am wrong).
However, I can't seem to get it quite right.  I think I have also found
some bugs, or at the very least some very strange behavior.

First I generate an IPShellEmbed instance:

from IPython.Shell import IPShellEmbed
keyboard = IPShellEmbed(['-pi1','keyboard <\\#>'], \
	'Entering Keyboard','Exiting Keyboard')

Then I use it with keyboard().  This basically works, but I have the
following questions:

1) Calling keyboard() from ipython itself seems to drop me into a new
namespace that doesn't know anything about the variables in the original
ipython namespace.  I can fix this by setting the local or global
namespace to _ip.user_ns.  Can someone explain why this is necessary?
Naively, I would expect to end up in the ipython namespace just as
calling keyboard() from a script does.    

2) The restriction to not being able to modify variables is a bit of a
(Continue reading)


Gmane