Problem with Leo+iPython

4 views
Skip to first unread message

William Strømsvold

unread,
Nov 19, 2009, 2:55:38 AM11/19/09
to leo-e...@googlegroups.com
I'm trying to get Leo to run from the iPython console (python(x,y), console2). I've done as described in the manual, and the printout of the macro embleo is:

import IPython.Shell
IPython.Shell.hijack_qt4()
_ip.magic(r"cd E:\leo-editor\_"[:-1])
_ip.magic("run launchLeo.py")

The output from this command is:

 <function dummy_mainloop at 0x037A28F0>
E:\leo-editor
reading settings in E:\leo-editor\leo\config\leoSettings.leo
using menus from: leoSettings.leo
reading settings in E:\workspace\.leo\myLeoSettings.leo
reading E:\workspace\.leo\.leoRecentFiles.txt

I've tried both IPython.Shell.hijack_qt4() and IPython.Shell.hijack_tk(), but nothing seems to work.. Nothing happens except for the output from the console..

Any tips? I have windows XP, so I suspect that there maybe is a problem with escape character \ in paths or something... I've also tried to start leo directly from the console but only this happens:

In [14]: %run "launchLeo.py --ipython"
ERROR: File `launchLeo.py --ipython.py` not found.

It adds the .py suffix to the --ipython argument, which I don't understand why it does...


-William S.

William Strømsvold

unread,
Nov 23, 2009, 4:30:31 AM11/23/09
to leo-e...@googlegroups.com
Anyone have a tips?

-William S.


2009/11/19 William Strømsvold <william.s...@gmail.com>

tfer

unread,
Nov 23, 2009, 9:44:55 AM11/23/09
to leo-editor
Hmm, I've got things torn apart from putting down laminate flooring in
the computer room, so this is from memory.

I'm on XP and run things via the sourceforge project "Console". One
thing that you might be missing is that it works best if you start Leo
from console and then let it start and attach to a Ipython instance in
that console. Console is great for automating this as it lets you
store start-up cmd-lines and starting directories as a title tab-type
that you can then just invoke via "New Tab => <tab_type>.

I don't have this machine set up quite right, but I've a "tab-type"
with a command:
cmd /k E:\Python26\Lib\site-packages\Leo-4.7-beta-1\launchLeo.py

just put in your path and add the "-- ipython switch.

Thinking back I did have problems using run from ipython.

Tom

Ville M. Vainio

unread,
Nov 23, 2009, 10:41:48 AM11/23/09
to leo-e...@googlegroups.com
On Thu, Nov 19, 2009 at 9:55 AM, William Strømsvold
<william.s...@gmail.com> wrote:

> I'm trying to get Leo to run from the iPython console (python(x,y),
> console2). I've done as described in the manual, and the printout of the
> macro embleo is:

I think launching an "embedded" leo from ipython is only working on tk
now. I could get it working in qt as well, but too busy right now.

--
Ville M. Vainio
http://tinyurl.com/vainio

William Strømsvold

unread,
Nov 24, 2009, 3:26:54 AM11/24/09
to leo-e...@googlegroups.com
Starting Leo from console worked perfectly, thanks to the tips from tfer. No need to run in embedded mode, from my point of view..

Just created a new tab with the following "shell":

cmd.exe /k C:\Python26\python.exe E:\leo-editor\launchLeo.py --ipython

-William S.


2009/11/23 Ville M. Vainio <viva...@gmail.com>

--

You received this message because you are subscribed to the Google Groups "leo-editor" group.
To post to this group, send email to leo-e...@googlegroups.com.
To unsubscribe from this group, send email to leo-editor+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/leo-editor?hl=.



Edward K. Ream

unread,
Nov 26, 2009, 12:20:15 PM11/26/09
to leo-e...@googlegroups.com
On Tue, Nov 24, 2009 at 2:26 AM, William Strømsvold <william.s...@gmail.com> wrote:
Starting Leo from console worked perfectly, thanks to the tips from tfer. No need to run in embedded mode, from my point of view..

Thanks, Tom, in helping William.  Leo is getting busy enough that such help is becoming essential.

Edward
Reply all
Reply to author
Forward
0 new messages