Thursday, September 24, 2009

Run python inside python and capture output

This is taken from http://techkr.blogspot.com/2007/02/python-how-to-get-output-from-ossystem.html:

How to execute python inside python and capture output:

A quick solution using popen :

import os
result=os.popen('command').read()
print result

where command is your command (expl. on windows: dir,ipconfig,...)

If you expect more than a line and want each word in a list:

import os,string
result=string.split(os.popen('dir/w').read())

Friday, September 11, 2009

Labspotting

I found this poster on a the Scientist Creative Quartely page at UBC, I thought it was funny ! That's a remix of the trainspotting poster.





Tuesday, September 8, 2009

Songbird - Ubuntu Jaunty

I had some error while trying to launch songbird on ubuntu jaunty 32 bit.

I found on a website that this package needs to be removed

sudo apt-get remove libvisual-0.4-plugins

libvisual is the plugin that displays some images while playing music in some music players like totem...

I removed it from the system and I can now launch Songbird.

Here is the error I was getting when running songbird:

./songbird
*** glibc detected *** ././songbird-bin: double free or corruption (out): 0xb199ed60 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7e55604]
/lib/tls/i686/cmov/libc.so.6(cfree+0x96)[0xb7e575b6]
/usr/lib/libvisual-0.4.so.0(visual_mem_free+0x21)[0xb1a7c141]
/usr/lib/libvisual-0.4.so.0[0xb1a73407]
/usr/lib/libvisual-0.4.so.0(visual_plugin_get_list+0x73)[0xb1a735e3]
/usr/lib/libvisual-0.4.so.0(visual_init+0x291)[0xb1a82ec1]
/usr/lib/gstreamer-0.10/libgstlibvisual.so[0xb267a273]
/home/alchemist/apps/Songbird/lib/libgstreamer-0.10.so[0xb3556b2a]
/home/alchemist/apps/Songbird/lib/libgstreamer-0.10.so(gst_plugin_load_file+0x93f)[0xb35576f1]
/home/alchemist/apps/Songbird/lib/libgstreamer-0.10.so[0xb3563ab6]
/home/alchemist/apps/Songbird/lib/libgstreamer-0.10.so(gst_registry_scan_path+0x135)[0xb3563c5b]
/home/alchemist/apps/Songbird/lib/libgstreamer-0.10.so[0xb350f34f]
/home/alchemist/apps/Songbird/lib/libgstreamer-0.10.so[0xb350f83b]
/home/alchemist/apps/Songbird/lib/libgstreamer-0.10.so[0xb350fea6]
/home/alchemist/apps/Songbird/lib/libgstreamer-0.10.so[0xb351046e]
/usr/lib/libglib-2.0.so.0(g_option_context_parse+0x5ab)[0xb6c34dcb]
/home/alchemist/apps/Songbird/lib/libgstreamer-0.10.so(gst_init_check+0xf1)[0xb350e60b]
/home/alchemist/apps/Songbird/lib/libgstreamer-0.10.so(gst_init+0x32)[0xb350e715]
/home/alchemist/apps/Songbird/lib/sbGStreamerMediacore.so(_ZN18sbGStreamerService4InitEv+0x9ff)[0xb33e89e7]
/home/alchemist/apps/Songbird/lib/sbGStreamerMediacore.so[0xb33f1a01]
/home/alchemist/apps/Songbird/lib/sbGStreamerMediacore.so[0xb3405a56]
/home/alchemist/apps/Songbird/xulrunner/libxul.so[0xb7702b89]
/home/alchemist/apps/Songbird/xulrunner/libxul.so[0xb770204b]
/home/alchemist/apps/Songbird/lib/sbGStreamerMediacore.so[0xb3402a3f]
/home/alchemist/apps/Songbird/lib/sbGStreamerMediacore.so[0xb3402a69]
/home/alchemist/apps/Songbird/lib/sbGStreamerMediacore.so[0xb3402215]
/home/alchemist/apps/Songbird/lib/sbGStreamerMediacore.so[0xb33f0071]
/home/alchemist/apps/Songbird/lib/sbGStreamerMediacore.so(_ZN27sbGStreamerMediacoreFactory4InitEv+0x46)[0xb33f08e0]
/home/alchemist/apps/Songbird/lib/sbGStreamerMediacore.so[0xb33f1961]
/home/alchemist/apps/Songbird/lib/sbGStreamerMediacore.so[0xb3405a56]
/home/alchemist/apps/Songbird/xulrunner/libxul.so[0xb7702b89]
/home/alchemist/apps/Songbird/components/sbMediacoreManager.so[0xb45761c5]
/home/alchemist/apps/Songbird/components/sbMediacoreManager.so[0xb45761f2]
/home/alchemist/apps/Songbird/components/sbMediacoreManager.so[0xb4575a8d]
/home/alchemist/apps/Songbird/components/sbMediacoreManager.so(_ZN8nsCOMPtrI19sbIMediacoreFactoryEC1ERK15nsCOMPtr_helper+0x2d)[0xb455d159]
/home/alchemist/apps/Songbird/components/sbMediacoreManager.so(_ZN18sbMediacoreManager4InitEv+0x1b9)[0xb455a15b]
/home/alchemist/apps/Songbird/components/sbMediacoreManager.so[0xb455a4f4]
/home/alchemist/apps/Songbird/xulrunner/libxul.so[0xb76df877]
/home/alchemist/apps/Songbird/xulrunner/libxul.so[0xb76dfe1c]
/home/alchemist/apps/Songbird/xulrunner/libxul.so[0xb6f6f7a0]
/home/alchemist/apps/Songbird/xulrunner/libxul.so(XRE_main+0x19af)[0xb6f6d481]
././songbird-bin[0x8048f40]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0xb7dfc775]
././songbird-bin[0x8048bb1]
======= Memory map: ========
08048000-0804e000 r-xp 00000000 08:05 184263 /home/alchemist/apps/Songbird/songbird-bin
0804e000-0804f000 rw-p 00006000 08:05 184263 /home/alchemist/apps/Songbird/songbird-bin
095fb000-0961c000 rw-p 095fb000 00:00 0 [heap]
b1900000-b1a00000 rw-p b1900000 00:00 0
b1a62000-b1a9e000 r-xp 00000000 08:05 10294 /usr/lib/libvisual-0.4.so.0.0.0
b1a9e000-b1a9f000 r--p 0003b000 08:05 10294 /usr/lib/libvisual-0.4.so.0.0.0
b1a9f000-b1aa0000 rw-p 0003c000 08:05 10294 /usr/lib/libvisual-0.4.so.0.0.0
b1aab000-b1ab1000 rw-p b1aab000 00:00 0
b1ab1000-b1b00000 r-xp 00000000 08:05 10259 /usr/lib/libtheora.so.0.3.4
b1b00000-b1b01000 r--p 0004e000 08:05 10259 /usr/lib/libtheora.so.0.3.4
b1b01000-b1b02000 rw-p 0004f000 08:05 10259 /usr/lib/libtheora.so.0.3.4
b1b02000-b1b1d000 r-xp 00000000 08:05 22386 /usr/lib/sse2/libspeex.so.1.5.0
b1b1d000-b1b1e000 r--p 0001a000 08:05 22386 /usr/lib/sse2/libspeex.so.1.5.0
b1b1e000-b1b1f000 rw-p 0001b000 08:05 22386 /usr/lib/sse2/libspeex.so.1.5.0
b1b1f000-b1b8c000 r-xp 00000000 08:05 10190 /usr/lib/libschroedinger-1.0.so.0.1.0
b1b8c000-b1b8d000 r--p 0006d000 08:05 10190 /usr/lib/libschroedinger-1.0.so.0.1.0
b1b8d000-b1b8e000 rw-p 0006e000 08:05 10190 /usr/lib/libschroedinger-1.0.so.0.1.0
b1b8e000-b1b8f000 rw-p b1b8e000 00:00 0
b1b8f000-b1c3a000 r-xp 00000000 08:05 157729 /usr/lib/i686/cmov/libavformat.so.52.31.0
b1c3a000-b1c3b000 r--p 000ab000 08:05 157729 /usr/lib/i686/cmov/libavformat.so.52.31.0
b1c3b000-b1c41000 rw-p 000ac000 08:05 157729 /usr/lib/i686/cmov/libavformat.so.52.31.0
b1c41000-b1c8d000 rw-p b1c41000 00:00 0
b1c8d000-b214b000 r-xp 00000000 08:05 157707 /usr/lib/i686/cmov/libavcodec.so.52.20.0
b214b000-b214c000 r--p 004be000 08:05 157707 /usr/lib/i686/cmov/libavcodec.so.52.20.0
b214c000-b2155000 rw-p 004bf000 08:05 157707 /usr/lib/i686/cmov/libavcodec.so.52.20.0
b2155000-b2462000 rw-p b2155000 00:00 0
b2462000-b246f000 r-xp 00000000 08:05 157686 /usr/lib/i686/cmov/libavutil.so.49.15.0
b246f000-b2470000 r--p 0000c000 08:05 157686 /usr/lib/i686/cmov/libavutil.so.49.15.0
b2470000-b2471000 rw-p 0000d000 08:05 157686 /usr/lib/i686/cmov/libavutil.so.49.15.0
b2471000-b2474000 rw-p b2471000 00:00 0
b2474000-b24a6000 r-xp 00000000 08:05 157788 /usr/lib/gstreamer-0.10/libgstffmpeg.so
b24a6000-b24a7000 r--p 00031000 08:05 157788 /usr/lib/gstreamer-0.10/libgstffmpeg.so
b24a7000-b24a8000 rw-p 00032000 08:05 157788 /usr/lib/gstreamer-0.10/libgstffmpeg.so
b24a8000-b24e2000 r-xp 00000000 08:05 2616 /lib/libncursesw.so.5.7
b24e2000-b24e3000 ---p 0003a000 08:05 2616 /lib/libncursesw.so.5.7
b24e3000-b24e5000 r--p 0003a000 08:05 2616 /lib/libncursesw.so.5.7
b24e5000-b24e6000 rw-p 0003c000 08:05 2616 /lib/libncursesw.so.5.7
b24e6000-b2581000 r-xp 00000000 08:05 2666 /lib/libslang.so.2.1.3
b2581000-b2584000 r--p 0009a000 08:05 2666 /lib/libslang.so.2.1.3
b2584000-b2591000 rw-p 0009d000 08:05 2666 /lib/libslang.so.2.1.3
b2591000-b25c7000 rw-p b2591000 00:00 0
b25c7000-b25e3000 r-xp 00000000 08:05 9484 /usr/lib/libcaca.so.0.99.16
b25e3000-b25e4000 r--p 0001b000 08:05 9484 /usr/lib/libcaca.so.0.99.16
b25e4000-b266b000 rw-p 0001c000 08:05 9484 /usr/lib/libcaca.so.0.99.16
b266b000-b266f000 rw-p b266b000 00:00 0
b2678000-b267e000 r-xp 00000000 08:05 12597 /usr/lib/gstreamer-0.10/libgstlibvisual.so
b267e000-b267f000 r--p 00005000 08:05 12597 /usr/lib/gstreamer-0.10/libgstlibvisual.so
b267f000-b2680000 rw-p 00006000 08:05 12597 /usr/lib/gstreamer-0.10/libgstlibvisual.so
b2680000-b2683000 r-xp 00000000 08:05 108366 /usr/lib/gstreamer-0.10/libgstcacasink.so
b2683000-b2684000 r--p 00002000 08:05 108366 /usr/lib/gstreamer-0.10/libgstcacasink.so
b2684000-b2685000 rw-p 00003000 08:05 108366 /usr/lib/gstreamer-0.10/libgstcacasink.so
b2685000-b268e000 r-xp 00000000 08:05 186259 /usr/lib/gstreamer-0.10/libgstdccp.so
b268e000-b268f000 r--p 00008000 08:05 186259 /usr/lib/gstreamer-0.10/libgstdccp.so
b268f000-b2690000 rw-p 00009000 08:05 186259 /usr/lib/gstreamer-0.10/libgstdccp.so
b2690000-b26a1000 r-xp 00000000 08:05 186295 /usr/lib/gstreamer-0.10/libgstqtmux.so
b26a1000-b26a2000 r--p 00010000 08:05 186295 /usr/lib/gstreamer-0.10/libgstqtmux.so
b26a2000-b26a3000 rw-p 00011000 08:05 186295 /usr/lib/gstreamer-0.10/libgstqtmux.so
b26a3000-b26ab000 r-xp 00000000 08:05 133723 /usr/lib/gstreamer-0.10/libgstgdkpixbuf.so
b26ab000-b26ac000 r--p 00007000 08:05 133723 /usr/lib/gstreamer-0.10/libgstgdkpixbuf.so
b26ac000-b26ad000 rw-p 00008000 08:05 133723 /usr/lib/gstreamer-0.10/libgstgdkpixbuf.so
b26ad000-b26b6000 r-xp 00000000 08:05 186266 /usr/lib/gstreamer-0.10/libgstdvdspu.so
b26b6000-b26b7000 r--p 00008000 08:05 186266 /usr/lib/gstreamer-0.10/libgstdvdspu.so
b26b7000-b26b8000 rw-p 00009000 08:05 186266 /usr/lib/gstreamer-0.10/libgstdvdspu.so
b26b8000-b26c1000 r-xp 00000000 08:05 186299 /usr/lib/gstreamer-0.10/libgstrfbsrc.so