How to create a python desktop application with Sharp Develop (aka # Develop)

When it comes to develop python desktop application we will think of using the tkinter or wxpython to generate the UI for the application but do you know that there is a open source IDE which can make our programming work a lot more easier than before with ready made button, menu and so on which we can use to create our python’s desktop application?

After I have created the first desktop application with this IDE I would like to recommend it to you all, it is called sharp develop (aka # develop) and you can download it through this link. Before we start to create our first application with # develop make sure you have downloaded the version 4.4 of this IDE instead of version 5 because it seems like python application development environment is not yet been included in the version 5.

With the tool we need let get started…

Step 1 :

open up sharp develop and click on the New solution button then select Python under the Categories panel to the left and Windows Application under Templates panel to the right
open up sharp develop and click on the New solution button then select Python under the Categories panel to the left and Windows Application under Templates panel to the right, don’t forget to give your new project a name and then click “Create”

Step 2 :

under main window switch to Design tab, under left side panel switch to Tools tab, under Windows Forms grab a Button and drop it on the UI panel on the main window, under the Text field under Properties panel on the right panel change the text to 'Hello World'
under the main window, switch to Design tab, under left panel switch to Tools tab, under Windows Forms (Tools Panel) grab a Button and drop it into the UI panel on the main window, under the Text field under Properties panel change the text on that Button to ‘Hello World’

Step 3 :

Double click on the Button will bring you to the Button1Click function, under that method insert this line of code.

def Button1Click(self, sender, e):
		print "Hello World!"

You also need to import the sys module on the top of the source code for later use.

import sys

Step 4 :

Go back to Design, then Tools and drag a MenuStrip widget from Windows Forms and placed it on the top of the main UI. Enter 'Menu' to the main text box and 'Close' to the sub text box of the MenuStrip widget
Switch back to Design tab, then Tools tab and drag a MenuStrip widget from Windows Forms to the top of the main UI. Enter ‘Menu’ to the main text box and ‘Close’ to the sub-menu text box in the MenuStrip widget

Step 5 :

Now click on the Close sub-menu tab will bring you to the close function, now type in this code below the function to close the application once the close sub-menu has been clicked.

def CloseToolStripMenuItemClick(self, sender, e):
		sys.exit()

Step 6 :

Now compiled and run the python program by pressing the green arrow above the main window
Now compiled and run the python program by pressing the green arrow above the main window

Step 7 :

If you press the Hello World button then you will see that phrase appears on the command prompt and if you click on the Close sub-menu item under main Menu then the application will terminate
If you press the Hello World button then you will see the Hello World phrase appears in the command prompt window behind the application and if you click on the Close sub-menu tab under the main Menu tab then that application will terminate

Overall speaking this IDE is what a python developer really needs to create a more advance UI for his or her desktop application written in Python and the best of all is it is completely free for you to use to create your application (not only for those applications written in python but also for application written in other programming languages such as c#, c++ and even Ruby as well)!

Like this post? Kindly share!