IronPython

by Mandar Vaze on June 23, 2009
in Python, Review, windows

IronPython in Action
Image by Michael Foord via Flickr

After working on initial prototype using pylons, on ubuntu, my employer needed a standalone application (on windows) So I was looking for ways to reuse my python code to avoid double work.  had only heard about iron python but beyond that I did not know anything more.

A bit of research later, I downloaded IronPython from here and IronPython Studio. I was quite thrilled to find out that Microsoft, has created this shell, which allows developers to integrate new languages with Visual Studio Shell.

Installing IronPython Studio

Installing IronPython was very straight forward. Considering it is one of the Python implementation itself, you don’t have to have standard python installed. (But I did, more on that later)

Setting up IronPython Studio wasn’t so straight forward.  I had to download standalone version of Visual Studio shell. But the problem, and it is well documented, is that installing the redistributable package in itself is not the complete step, as you would believe from the website. I confirmed that the package was installed, and stil IronPython Studio would complain, and refuse to proceed. It turns out that you need to install the Visual Studio environment, which is inside this directory structure you just created.

This is NOT enough

This is NOT enough

This is what IronPython Studio needs

This is what IronPython Studio needs

Once I installed Visual Studio Shell, IronPython Studio installed easily.  Using IronPython has been nice experience in just a few hours I have been using it. The Code completion isn’t upto my liking yet, but it is helpful at times.

Using Standard Python Libraries

Since my original code was written on linux, it used only the standard python modules. In a manner of speaking, it was “pure” python code. Since IronPython is an implementation of the Python programming language running under .NET, it was obivious that my code may not work as is. But I’m glad that I did not have to make too many changes to get it working under IronPython.

As is well documented in IronPython Tutorial, it is not very difficult to use standard python libraries with IronPython (with a few exceptions – more about this a little later) 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

http://www.codeplex.com/IronPythonStudio

Related articles

Reblog this post [with Zemanta]

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.

  1. Firefox tabs would merge into each other, and visually I could not differentiate the boundaries.
  2. Firefox scrollbars didn’t work correctly either
  3. Gnome DO had weird problem, as is the drop-down list which allows me to select the theme went completely bonkers.
  4. 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.

Autokey in KDE - Default

The Edit Box is missing

Edit box visible after the dialog is resized

Edit box visible after the dialog is resized

moz_in_kde1

The tab boundaries merged

Follow these simple instructions to ensure that GTK apps “play well” with KDE

  1. Go to System Settings ->Appearance
  2. Click on “GTK Styles and fonts” from the left hand side panel
  3. The very first (at the top) option is GTK Styles. The Default is use KDE Style. Select USe Another Style.
  4. Select Clearlooks (For blue) or Human Clearlooks from the drop down.
  5. 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.

The Edit box visible clearlt - As designed

The Edit box visible clearly - As designed

Tab Boundaries Visible Clearly

Tab Boundaries Visible Clearly

Reblog this post [with Zemanta]

Works with Firefox !!

by Mandar Vaze on March 5, 2009
in Open Source

Mozilla Firefox
Image via Wikipedia

We keep hearing that lot of important sites do not work with Firefox e.g.

  1. Rohit Srivastava is Frustrated
  2. During the Breakfast with Mozilla event that took place in Pune on February 15th, Arun made a remark that several web developers still develop for IE 6 (which was released around 2000, eight years ago)

While that may have been correct a while ago, I’m sure that things are improving. Since I switched full time to Ubuntu few weeks ago, I had no choice but to use Firefox (considering there is no IE on Linux – Not sure if IE works under Wine) and I am glad to say that I had no issues what so ever. I’m using Firefox 3.0.5, as well as Firefox 3.1Beta 2 on Ubuntu 8.10 (if it matters)

I’m listing the websites that I know work with Firefox, in the hope that this would help more and more people to switch to Firefox.

Sure everyone knows Firefox is (relatively) secure compared to IE. But if folks can’t get their work done, they WILL continue to use IE. So in order to show them that indeed more and more websites work with Firefox without any issues, I started this list.  Obviously, this list is far from complete. But with your support, we can make this better, in the hopes that users do not have the option of not-using Firefox, just because their favorite website doesn’t work with firefox.

If you are not using Firefox yourself, please click on the button on the right to download Firefox right now !!

Please leave comments with URLs that you know work with Firefox.

Reblog this post [with Zemanta]

« Previous PageNext Page »