Reckoner | 4 Dec 20:40
Picon

non-interactive ipython for script


I  need to be able to run certain ipython magic commands using the plain vanilla python interpreter.

In other words, I have an ipython script that I can certainly invoke using ipython on the command line, but I need to  run the script using python on the command line.

I know it has  something to do with importing IPython, but I can't do the IPython.Shell.start().mainloop() part since I need non-interactive running.

I hope that made some sense.

Any help appreciated.



_______________________________________________
IPython-user mailing list
IPython-user <at> scipy.org
http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
wang frank | 6 Dec 07:11
Picon

ipython in emacs

Hi,
 
Even though I could not make ipython work with emacs 23.2 in window xp. It is very easy to make it work in Linux. However, the most important feature of ipython is missing inside emacs. That is retreiving the previouse command from command history.
 
In ipython running from normal shell, press up and down arrow key will bring back the previouse or next command. If you type some character of previous command and press the up and down arrow key, ipython will automatic search backward for the command starting with the character. If it is not the command you want, you can press the up arrow key again. However, inside emacs, the up and down arrow keys will more the cursor up and down. It cannot retrieve the previous command. If you type the character of the previouse command, up arrow key will not search the command. The tab key will not complete the command inside emacs.
 
Does anyone know how to fix this?
 
Thanks
 
Frank

10月のキーワード月間ランキング1位は「初音ミク」、2位は家族ぐるみの・・・ http://keyword.jp.msn.com/default.aspx
_______________________________________________
IPython-user mailing list
IPython-user <at> scipy.org
http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
Fernando Perez | 6 Dec 07:22
Picon
Gravatar

Re: ipython in emacs

On Dec 5, 2007 11:11 PM, wang frank <fw3 <at> hotmail.co.jp> wrote:
>
>  Hi,
>
>  Even though I could not make ipython work with emacs 23.2 in window xp. It
> is very easy to make it work in Linux. However, the most important feature
> of ipython is missing inside emacs. That is retreiving the previouse command
> from command history.
>
>  In ipython running from normal shell, press up and down arrow key will
> bring back the previouse or next command. If you type some character of
> previous command and press the up and down arrow key, ipython will automatic
> search backward for the command starting with the character. If it is not
> the command you want, you can press the up arrow key again. However, inside
> emacs, the up and down arrow keys will more the cursor up and down. It
> cannot retrieve the previous command. If you type the character of the
> previouse command, up arrow key will not search the command. The tab key
> will not complete the command inside emacs.
>
>  Does anyone know how to fix this?

C-up instead of just up.  Since Emacs implements its own cursor
functionality, it overrides readline.  So the keystrokes aren't quite
the same, but you can get pretty much the same functionality (at some
cost in muscle memory).

cheers,

f
Alexander Schmolck | 6 Dec 11:06
Picon

Re: ipython in emacs

"Fernando Perez" <fperez.net <at> gmail.com> writes:

> On Dec 5, 2007 11:11 PM, wang frank <fw3 <at> hotmail.co.jp> wrote:
>>
>>  Hi,
>>
>>  Even though I could not make ipython work with emacs 23.2 in window xp. It
>> is very easy to make it work in Linux. However, the most important feature
>> of ipython is missing inside emacs. That is retreiving the previouse command
>> from command history.
>>
>>  In ipython running from normal shell, press up and down arrow key will
>> bring back the previouse or next command. If you type some character of
>> previous command and press the up and down arrow key, ipython will automatic
>> search backward for the command starting with the character. If it is not
>> the command you want, you can press the up arrow key again. However, inside
>> emacs, the up and down arrow keys will more the cursor up and down. It
>> cannot retrieve the previous command. If you type the character of the
>> previouse command, up arrow key will not search the command. The tab key
>> will not complete the command inside emacs.
>>
>>  Does anyone know how to fix this?
>
> C-up instead of just up.  Since Emacs implements its own cursor
> functionality, it overrides readline.  So the keystrokes aren't quite
> the same, but you can get pretty much the same functionality (at some
> cost in muscle memory).

No need to strain your poor muscles' limited mental ressources :) 

I think the following should do (added somehwere at the front of your .emacs),
either without prefix matching:

    (define-key comint-mode-map (kbd "<up>")
       'comint-previous-input)
    (define-key comint-mode-map (kbd "<down>")
       'comint-next-input)

or, I think handier, with:

    (define-key comint-mode-map (kbd "<up>") ; (I bind that to M-p)
      'comint-previous-matching-input-from-input)

    (define-key comint-mode-map (kbd "<next>")
      'comint-next-matching-input-from-input)

cheers,

'as
Fernando Perez | 6 Dec 19:17
Picon
Gravatar

Re: Ipython inside Crunchy

Hi all,

here's another ipython-related video from the popular ShowMeDo series!
 I've played with Crunchy briefly in the past and it looked really
cool; I haven't had time to use the new one with ipython but I'd love
to test it soon.

Thanks to Ian for the tip and André for the work (as well as Crunchy!).

Cheers,

f

On Dec 2, 2007 9:26 AM, Ian Ozsvald <ian <at> showmedo.com> wrote:
> Hi Fernando - this is just a quick ping to say that André demonstrates a work-in-progress version of
IPython embedded inside his Crunchy in his latest screencast (at about the 10minute point):
> http://showmedo.com/videos/video?name=1430010&fromSeriesID=143
>
> I ping it to you just out of interest, I figure you (and others on your lists?) would enjoy seeing André's
use of the great IPython :-)
>
> There's an earlier video and more to come too:
> http://showmedo.com/videos/series?name=jBz4yv8Xg
>
> Cheers,
> Ian.
>
> Fernando Perez wrote:
> > Hi everyone,
> >
> > Jeff Rush, the Python foundation advocacy lead, has just finished a
> > new series of ShowMeDo videos about ipython:
> >
> > http://showmedo.com/videos/series?name=CnluURUTV
> >
> > I have to admit that I (re)learned a few tricks watching it :)
> >
> > I'd like to thank Jeff for the great work as well as Ian for ShowMeDo.
> >  And Ian has mentioned that there's a lot of interest in IPython
> > videos, so if any of you has a bit of time, this would be a great
> > little project with a guaranteed audience.
> >
> > Here's more info about the process:
> >
> > http://ipython.scipy.org/moin/ShowMeDo
> >
> > feel free to edit that page with new ideas of a topic you'd either
> > want to see covered or would like to cover yourself (related to
> > ipython, I'm not trying to hijack the showmedo system :)
> >
> > Cheers,
> >
> > f
>
> --
> http://Services.ShowMeDo.com
> http://ShowMeDo.com
> Ian <at> ShowMeDo.com
>
wang frank | 7 Dec 04:00
Picon

Re: ipython in emacs

Thank you very much for the solution. It is what I am searching for. 
 
Frank

> To: fperez.net <at> gmail.com
> CC: fw3 <at> hotmail.co.jp; ipython-user <at> scipy.net
> Subject: Re: [IPython-user] ipython in emacs
> From: a.schmolck <at> gmx.net
> Date: Thu, 6 Dec 2007 10:06:46 +0000
>
> "Fernando Perez" <fperez.net <at> gmail.com> writes:
>
> > On Dec 5, 2007 11:11 PM, wang frank <fw3 <at> hotmail.co.jp> wrote:
> >>
> >> Hi,
> >>
> >> Even though I could not make ipython work with emacs 23.2 in window xp. It
> >> is very easy to make it work in Linux. However, the most important feature
> >> of ipython is missing inside emacs. That is retreiving the previouse command
> >> from command history.
> >>
> >> In i python running from normal shell, press up and down arrow key will
> >> bring back the previouse or next command. If you type some character of
> >> previous command and press the up and down arrow key, ipython will automatic
> >> search backward for the command starting with the character. If it is not
> >> the command you want, you can press the up arrow key again. However, inside
> >> emacs, the up and down arrow keys will more the cursor up and down. It
> >> cannot retrieve the previous command. If you type the character of the
> >> previouse command, up arrow key will not search the command. The tab key
> >> will not complete the command inside emacs.
> >>
> >> Does anyone know how to fix this?
> >
> > C-up instead of just up. Since Emacs implements its own cursor
> > functionality, it overrides readline. So the keystrokes ar en't quite
> > the same, but you can get pretty much the same functionality (at some
> > cost in muscle memory).
>
> No need to strain your poor muscles' limit ed mental ressources :)
>
> I think the following should do (added somehwere at the front of your .emacs),
> either without prefix matching:
>
> (define-key comint-mode-map (kbd "<up>")
> 'comint-previous-input)
> (define-key comint-mode-map (kbd "<down>")
> 'comint-next-input)
>
> or, I think handier, with:
>
> (define-key comint-mode-map (kbd "<up>") ; (I bind that to M-p)
> 'comint-previous-matching-input-from-input)
>
> (define-key comint-mode-map (kbd "<next>")
> 'comint-next-matching-input-from-input)
>
> cheers,
>
> 'as


Hotmailがお届けする、幸せになるためのメールマガジン「ビジネス幸福論」実施中 http://go.windowslive.jp/
_______________________________________________
IPython-user mailing list
IPython-user <at> scipy.org
http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
sunqiang | 7 Dec 17:42
Picon

problem of "!start ." with -q4thread

ipython 0.8.2 and python2.5.1 on windows xp sp2
If I start ipython without -q4thread, cd some bookmarked directory.
and "!start ." will pop up a explorer of current directory without
blocking.
if i stat ipython with -q4thread, then  i can run some pyqt4 script
without blocking. but "!start ." will block ipython until i press
"ctrl + break"..., it kills ipython shell, and show the explorer...
Darren Dale | 7 Dec 18:03
Picon
Favicon

Re: problem of "!start ." with -q4thread

On Friday 07 December 2007 11:42:14 am sunqiang wrote:
> ipython 0.8.2 and python2.5.1 on windows xp sp2
> If I start ipython without -q4thread, cd some bookmarked directory.
> and "!start ." will pop up a explorer of current directory without
> blocking.
> if i stat ipython with -q4thread, then  i can run some pyqt4 script
> without blocking. but "!start ." will block ipython until i press
> "ctrl + break"..., it kills ipython shell, and show the explorer...

Do you have the same problem with -gthread or -wthread?
sunqiang | 7 Dec 18:12
Picon

Re: problem of "!start ." with -q4thread

o, didn't install pyqtk and wxpython. i am blind to pyqtk, so only
download wxpython 2.8.7.1 (unicode  version for python2.5)
now, -wthread blocking "!start ." same as "-q4thread"...

On Dec 8, 2007 1:03 AM, Darren Dale <darren.dale <at> cornell.edu> wrote:
>
> On Friday 07 December 2007 11:42:14 am sunqiang wrote:
> > ipython 0.8.2 and python2.5.1 on windows xp sp2
> > If I start ipython without -q4thread, cd some bookmarked directory.
> > and "!start ." will pop up a explorer of current directory without
> > blocking.
> > if i stat ipython with -q4thread, then  i can run some pyqt4 script
> > without blocking. but "!start ." will block ipython until i press
> > "ctrl + break"..., it kills ipython shell, and show the explorer...
>
> Do you have the same problem with -gthread or -wthread?
>
sunqiang | 7 Dec 18:38
Picon

Re: problem of "!start ." with -q4thread

oops, the blocking will disappear after about one minute with -wthread
or -q4thread.

On Dec 8, 2007 1:12 AM, sunqiang <sunqiang <at> gmail.com> wrote:
> o, didn't install pyqtk and wxpython. i am blind to pyqtk, so only
> download wxpython 2.8.7.1 (unicode  version for python2.5)
> now, -wthread blocking "!start ." same as "-q4thread"...
>
>
>
> On Dec 8, 2007 1:03 AM, Darren Dale <darren.dale <at> cornell.edu> wrote:
> >
> > On Friday 07 December 2007 11:42:14 am sunqiang wrote:
> > > ipython 0.8.2 and python2.5.1 on windows xp sp2
> > > If I start ipython without -q4thread, cd some bookmarked directory.
> > > and "!start ." will pop up a explorer of current directory without
> > > blocking.
> > > if i stat ipython with -q4thread, then  i can run some pyqt4 script
> > > without blocking. but "!start ." will block ipython until i press
> > > "ctrl + break"..., it kills ipython shell, and show the explorer...
> >
> > Do you have the same problem with -gthread or -wthread?
> >
>

Gmane