Posts

Showing posts with the label python

My journey to Rust

As most folks who know me already know, I've been in love with Rust language for a few years now and in the last year I've been actively coding in Rust. I wanted to document my journey to how I came to love this programming language, in hope that it will help people to see the value Rust brings to the world of software but if not, it would be nice to have my reason documented for my own sake. When I started my professional career as a programmer 16 years ago, I knew some C, C++, Java and a bit of x86 assembly but it didn't take long before I completely forgot most of what I knew of C++ and Java, and completely focused on C. There were a few difference reasons that contributed to that: Working with very limited embedded systems (I'm talking 8051 ) at that time, I quickly became obsessed with performance and C was my best bet if I didn't want to write all my code in assembly. Shortly before I graduated, I got involved in GStreamer project and beca

We can has Python too

Zachary Goldberg reports : As I've been mentioning lately I have been working on using PyGObject + GObject Introspection (recently forked, now called PyGI + PyGObject + Gobject Introspection) and have some exciting news! I have been working on fleshing out a whole bunch of unit tests which exercise the entire GUPnP API. I hate a major roadblock in that PyGI did not support native callbacks! So, after a week or two detour I have implemented PyGI callbacks (which now work rather nicely, but need a bunch of stylistic cleanups and error checking before its pushed back upstream.. priorities!) as well as some working GUPnP demos. My best demo so far is about 25 lines of python which: 1) Gets all devices on one network interface 2) Scans for all the services each device provides 3) If the device is GMediaRenderer and it provides an AVTransport Service (it does...) then it 3a) Stops whatever is currently playing 3b) Loads a new URI (hardcoded from my mediatomb server for now, h

Go Havoc

Since I totally agree with last two blog entries of Havoc, I originally started to write this entry to get them to the planets I am on and he is not (yes, there are some) but then I couldn't resist adding my own thoughts. :) Regarding "embeddable" scripting languages, I came-up with the exact same conclusion 4-5 year ago. When I looked around at that time, I realized that GNU had realized that long time ago and had a nice embeddable implementation of the easiest yet powerful language, Scheme. Guile was the name of that implementation. I soon became a firm believer of "Most of the implementation in C, while the highest-level (only) logic written in Scheme/Guile". While I was acting on my belief, I couldn't help but notice that the only other person in the whole GNOME community that had similar vision was Andy Wingo. Many (if not most) had been going for Python. Some of them even took this scripting language as far as coding complete frameworks in it. As

python strikes back

The joy of getting my python problems fixed on my debian testing were short lived. This time when i ran `apt-get dist-upgrade`, apt failed saying: ValueError: /usr/bin/python does not match the python default version. It must be reset to point to python2.4 dpkg: error while cleaning up: subprocess post-installation script returned error exit status 1 ... Errors were encountered while processing: /var/cache/apt/archives/python-uno_1%3a2.4.0-5_i386.deb /var/cache/apt/archives/deskbar-applet_2.22.1-1_i386.deb /var/cache/apt/archives/python-ctypes_1.0.2-4_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) So removed the link to python2.5 and recreated it but this time pointing to pythong2.4. It should fix the problem, right? No! here is what apt says now: ValueError: /usr/bin/python does not match the python default version. It must be reset to point to python2.5 ...

whats wrong with my python setup?

Can any python guru out there explain whats going on here: $ /usr/bin/gnome-about Traceback (most recent call last): File "/usr/bin/gnome-about", line 35, in ? import gtk ImportError: No module named gtk $ head -n 1 /usr/bin/gnome-about #!/usr/bin/python $ head -n 36 /usr/bin/gnome-about|tail -n +29 import pygtk pygtk.require ('2.0') import gobject from gobject.option import OptionParser, make_option import gtk $ /usr/bin/python Python 2.4.5 (#2, Mar 12 2008, 00:15:51) [GCC 4.2.3 (Debian 4.2.3-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pygtk >>> import gtk >>> $ /usr/bin/python Python 2.4.5 (#2, Mar 12 2008, 00:15:51) [GCC 4.2.3 (Debian 4.2.3-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pygtk >>> pygtk.require ('2.0') >>>