Reading CSV files in IronPython

- Image via Wikipedia
This is in continuation with my previous blog post :
To get IronPython to use Standard Python Modules, one needs to add the following two lines to C:\IronPython-2.0.1\Lib\site.py :
import sys sys.path.append(r"C:\Python25\Lib")While this works for most part, it doesn’t help if you are using Python extensions written in C. More about my specific problems in another post. But there is an open source project IronClad to deal specifically with this issue. In the meantime, you can check the differences between IronPython and CPython
Reading (and writing to) CSV file is critical part of my program, while in stadard python it was as easy as “import csv”, the same thing took some efforts to get it working in IronPython. I got the following error for my import statement
Error on line 7 in csv.py from functools import reduce
I also tried using ActiveState Python 2.5.2.2 (which I already had from few months ago, didn’t feel like downloading the latest version till the problem was fixed) But that didn’t help either. With ActiveState, I got the same error on the same line, except this time it was for _csv.
To Quote from IronPython Cookbook :
For some reason the Python standard library csv module is written in C, which means that it isn’t available to IronPython.
The cookbook points to a third party library called A Fast Csv Reader . The cookbook has a nice example of how to use the said DLL with your IronPython Program.
It wasn’t clear to me as to why I had to register at Code Project to download this binary since it is provided under MIT Open Source License. But whom am I gonna complain to ? Beggars can’t be choosers
How to Fix the look ‘n feel of GTK Apps in KDE
by Mandar Vaze on April 14, 2009
in Linux, Tutorials, Ubuntu
As all the Ubuntu users know, the default Ubuntu comes with Gnome. Kubuntu is a separate download, focused around K-apps. But I wanted best of both the worlds. It was easy to have both. I just followed the instructions from this page.
Personally, I think KDE 4.x is pretty nice. It comes with host of applications. I think KDE is cool (.. and acknowledge that cool is subjective – personal.)
Since I moved to KDE from Gnome, I have become dependent on several GTK apps. (GTK is the cross platform widget library used to write the Gnome applications) But by default they don’t look good in KDE.
- Firefox tabs would merge into each other, and visually I could not differentiate the boundaries.
- Firefox scrollbars didn’t work correctly either
- Gnome DO had weird problem, as is the drop-down list which allows me to select the theme went completely bonkers.
- The Edit box in Autokey is completely Hidden (See the image Above)
Something had to be done. See the images below. Click on the images to see the details.
Follow these simple instructions to ensure that GTK apps “play well” with KDE
- Go to System Settings ->Appearance
- Click on “GTK Styles and fonts” from the left hand side panel
- The very first (at the top) option is GTK Styles. The Default is use KDE Style. Select USe Another Style.
- Select Clearlooks (For blue) or Human Clearlooks from the drop down.
- You need to restart the GTK Apps.
Now all your KDE/QT apps as well as GTK apps would work well (in terms of display)
See the screen shots after the above fix is applied. Click on the images to see the details.
Related articles by Zemanta
- Chrome for Linux To Use GTK (ostatic.com)
- Google Chrome on KDE4.2 – Why not? (internetling.com)
Installing latest Gnome Do on Ubuntu 8.10
by Mandar Vaze on February 10, 2009
in Linux, Productivity, Tutorials, Ubuntu
If you are not sure what is Gnome Do, read my previous post on this topic. Ubuntu 8.10 repositories has older version 0.6.0.1 of Gnome-DO. This was probably released around October 2008 time frame when Ubuntu 8.10 was released. It has been several months since then, and Gnome DO has progressed nicely.
If you want to try the latest version of Gnome DO, which now comes with Docky, then read on How to upgrade to latest version.
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_b.png?x-id=97b6f3b5-f068-4b14-accd-9a79a802c586)



![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_b.png?x-id=34096604-83cd-4c9d-b1d7-0e7034674877)

