May 23, 2008 by vivainio
(* fanfare_for_first_offtopic_post *)
Since this blog is not strictly restricted to IPython subject matter, here’s a good tip: firefox 3 beta on Ubuntu 8.04 LTS is quite slow, at least on nvidia cards. Especially scrolling around gmail can be a pain. A good solution is installing firefox 2 (sudo apt-get install firefox-2). Then, you can set firefox 2 as your default browser from System -> Preferences -> Preferred applications, select “Custom” web browser and enter “firefox-2 %s” as the command.
Problem solved. Otherwise, 8.04 LTS pretty much rocks on all departments, at least for desktop use.
To navigate back to on-topic realm, IPython 0.8.3 is pretty much ready; release candidate 1 has been built, and there should be no more bugfixes, provided that the installers (that have seen some changes) work correctly. Try them out at launchpad
Tags: ubuntu
Posted in Uncategorized | 4 Comments »
May 15, 2008 by vivainio
Here is a little known secret: IPython can be trivially embedded to GUI apps with event loops. This is verified to work with Tk and Qt4, at least.
What you need to do is this:
def embed_ipython(w):
from IPython.Shell import IPShellEmbed
ipshell = IPShellEmbed(user_ns = dict(w = w))
ipshell()
Here ‘w’ is a central object of some kind that you want to expose to IPython (to manipulate, test various methods, etc).
My GUI app initialization is like this:
if __name__ == "__main__":
app = QApplication(sys.argv)
window = Window()
window.show()
embed_ipython(window)
sys.exit(app.exec_())
What may be nonobvious here is that embed_ipython() call never returns. There is “secret sauce” in at least Qt4 and Tk that allows the GUI event loop to proceed while IPython read-eval-print loop is being handled (the same sauce that allows you to operate GUIs in standard interactive python prompt). One would intuitively guess that surely the REPL should be running in a separate thread, but this is not the case. While the UI event loop (or IPython) is doing something time-consuming, the other party will be blocked for that time - but there is the huge benefit that everything occurs in the same thread, that of the GUI event loop.
Tags: gui, qt4, threading
Posted in Uncategorized | No Comments »
May 14, 2008 by vivainio
Every now and again, we at IPython0 get complaints about the strict criteria that we use for tab completing python attributes; basically, we only tab complete expressions where side effects are not likely when calling ‘eval’, as in expression foo.bar.ba<TAB> (we eval foo.bar, then get attributes from the resulting object). An expression we do not eval is foo(12).bar.ba + TAB, because calling foo(12) may do something nasty that the innocent ipythoneer may not be aware of.
Until now, that is. Sometimes all you care about is convenience - maybe your interactive work is not so side-effect-sensitive, maybe you trust yourself enough to not press tab after a dangerous command, or maybe you just enjoy living on the edge. I just added ipy_greedycompleter.py IPython extension to the trunk, which does not really care about what it evaluates - pressing TAB is enough, and if something breaks, the user gets to keep both pieces.
Activate it by typing “import ipy_greedycompleter” (or “import ipy_gr” + TAB for completion savvy), or add it to you ipy_user_conf.py.
I should probably also mention that you can get IPython trunk (it’s probably stabler than 0.8.2 at this point) from launchpad by doing:
bzr branch lp:ipython
– Ville
Tags: extensions
Posted in Uncategorized | 2 Comments »
April 25, 2008 by laurentdufrechou
The wx Ipython widget now get supports for options. Two options are available right now:
- Autocompletion representation style: Scintilla mode or Ipython legacy one.
-Background color switch: Black or White.
I’ve added a hook so you can define what to do when an option is changed.
Want to try this? Run wxIpython demo app in Ipython/gui/wx and report any bug!
Tags: wx;backend;gui
Posted in Uncategorized | No Comments »
April 25, 2008 by laurentdufrechou
Editra ( http://editra.org/ ) is a programmer’s source editor that is now bundled with wxpython distribution.
It has a plugin architecture so external can connect to it to provide added functionality.
I’m currently working on integrating wx IpythonView widget inside it. So user will have a new ipython based alternative to classical wx pyshell.
Current version of the plugin is 0.3beta and bundle ipython/readline/and wx ipython widget into one egg. It supports infinite loop breaking, multiline copy/paste, options save/restore.
Thanks to cody precord, author of editra, it also works for MacOSX.
There still lot of work so… stay tuned for more news!
Tags: wx;backend;editra
Posted in Uncategorized | No Comments »
April 25, 2008 by vivainio
This is a test for planet python visibility.
The idea of this blog: get wider publicity for stuff that is happening in the IPython 0.x (”stable”) series world.
This is a blog shared by interested IPython developers, with the idea of advertising various features to wider audience than what would be reachable through ipython mailing list.
– Ville
Posted in Uncategorized | No Comments »
April 21, 2008 by vivainio
Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!
def f():
print "hello world"
Posted in Uncategorized | 1 Comment »