[python-win32] C# Vs Python

Bob Gailer bgailer at alum.rpi.edu
Mon Apr 2 21:32:00 CEST 2007

James Matthews wrote:
> I am not asking for a very detailed comparison that i know no one will 
> give i am just wondering for windows development which language would 
> be better? What i mean is GUI apps, interfacing with excel,word and 
> outlook etc..
Well, for one, Python requires a lot less code to accomplish the same task:

The following is a very simple C# program, a version of the classic 
"Hello, world!" example:

class ExampleClass
    static void Main()
        System.Console.WriteLine("Hello, world!");

Th Python equivalent is:

print "Hello, world!"

With the assistance of Mark Hammond's excellent pywin package, COM 
interfacing is at least as easy as in other languages:
import win32com.client
xl = win32com.client.Dispatch("excel.application")
xl.visible = True
wb = xl.WorkBooks.Open(filename)
sh = wb.Sheets(1)

There are various GUI toolkits available. I've not done much with them.

Bob Gailer

More information about the Python-win32 mailing list