Hi

Ive been working with PHP, AS3 and some javascript for a while now, and want to move into something that allows me to develop desktop apps...

I considered Java, but have become used to PHP's loose typing or whatever the technical name is, and so after some investigation Python seems to be a good option...

Apparently it is useful for desktop as well as online app development? What are the GUI components like that are available for desktop development?

Thanks
lworks

Member Avatar for sravan953

Python is a really good choice! It has a nice, clean interactive shell called IDLE. The language is also easy, for example:

print "Hello"

This gives:

Hello

I recommend you start learning it: Dive Into Python/

Also, for the GUI, you have tkinter and wxPython. tkinter is a little old, so wxPython is the order of the day! ;)

Also, for the GUI, you have tkinter and wxPython. tkinter is a little old, so wxPython is the order of the day! ;)

But tkInter is included in the standard distribution...

Member Avatar for leegeorg07

But tkInter is included in the standard distribution...

Only for the Unix version, I havent found it in the binary version

Only for the Unix version, I havent found it in the binary version

??
I'm on windows and it's in. I use 2.4.

Member Avatar for leegeorg07

Oh, well I can't find it in 2.6 or newer, maybe as sravan said that its outdated python org decided not to include it anymore

Oh, well I can't find it in 2.6 or newer, maybe as sravan said that its outdated python org decided not to include it anymore

The binary windows installer of Pyhon26 or Python31 both have tkinter. In fact in Python31 Tkinter has been spruced up with the module ttk.

Vegaseat left this example somewhere on this forum:

'''
Python31 includes the Tkinter Tile extension module ttk.

Ttk comes with 17 widgets, 11 of which already exist in Tkinter:
Button, Checkbutton, Entry, Frame, Label, LabelFrame, Menubutton, 
PanedWindow, Radiobutton, Scale and Scrollbar 

The 6 new widget classes are:
Combobox, Notebook, Progressbar, Separator, Sizegrip and Treeview

You have to do some detective work on file
C:/Python31/Lib/tkinter/test/test_ttk/test_widgets.py
to figure out how these widgets work
'''

# ttk_notebook1.py
# exploring the Tkinter expansion module ttk notebook
# tested with Python 3.1 and Tkinter 8.5   by  vegaseat

import tkinter as tk
import tkinter.ttk as ttk

root = tk.Tk()
# use width x height + x_offset + y_offset (no spaces!)
root.geometry("%dx%d+%d+%d" % (300, 200, 100, 50))
root.title('test the ttk.Notebook')

nb = ttk.Notebook(root)
nb.pack(fill='both', expand='yes')

# create a child wdget for each page
f1 = tk.Frame(bg='red')
f2 = tk.Frame(bg='blue')
f3 = tk.Frame(bg='green')

# create the pages
nb.add(f1, text='page1')
nb.add(f2, text='page2')
nb.add(f3, text='page3')

# put a button widget on child f1
btn1 = tk.Button(f1, text='button1')
btn1.pack(side='left', anchor='nw', padx=3, pady=5)

root.mainloop()

Tkinter is small but powerful. The included Python IDE called 'IDLE' is based on Tkinter, as is the module turtle.

Member Avatar for leegeorg07

Oh, well then I call myself owned :D

Python is a good choice for easy-going desktop application development. Of course, you're going to want to get adjusted to and familiarized with classes, methods/functions, etc. before starting on GUI projects.

And for GUIs, I'd still really suggest wxPython over Tkinter. I personally can't stand the non-native look of Tk's widgets, whereas wxPython's elements use the native operating system's look.

Should you decide to have fun with Python, be aware that the language has been modernized starting with version 3. I would recommend to start with the present version Python 3.1.1

Some examples of the older Python2 code will give you problems, but a number of good tutorials have been rewritten for version 3.

Dive Into Python is Mark Pilgrim's free online book, novice to pro, updated constantly, and rewritten for Python3 (check appendix A for 2to3 diffs). Get it at:

http://diveintopython3.org/


Another online book rewritten vor Python3 is at:
http://www.swaroopch.com/notes/Python_en:Table_of_Contents

Python has a commandline based interpreter called the the interactive shell, good for short one-line explorations. The books use it a lot, but the code looks goofy with lots of '>>>' and '...', so don't get too confused! Real Python code looks a lot more readable when written in an editor, saved as a .py file and run.

Right now Python3 gives you only two GUI toolkit choices, one is Tkinter (TCL based) and the other is PyQT (C++ based). PyGame (SDL/C++ based) is another GUI toolkit mostly used or games. It just came out for Python31. The popular wxPython (C++ based) has not been rewritten yet to work with Python3.

Here is a collection of coding examples that compare the GUI toolkits:
http://www.daniweb.com/forums/post866067.html#post866067

Should you decide to have fun with Python, be aware that the language has been modernized starting with version 3. I would recommend to start with the present version Python 3.1.1

Yeah as he said, wxPython has not been made for python 3.
The versions that have wxPython support are:

  • Python 2.4
  • Python 2.5
  • Python 2.6

So personally i do not use python 3 for the reason that i use GUI's in almost every program.

If you are new to Python, I wouldn't 'putz' around with old Python2. There are simply too many things that Python3 has to offer. Otherwise, after a few years you will be stuck with old Python2 code that does not easily convert to Python3. The little 2to3.py utility program only handles simple stuff.

I appreciate all the input - going to have to do some of my own testing now I guess, thanks for the contributions!

Good luck with your studies, whatever language you pick!

I have learned and applied a number of computer languages in my life, things like Asm, Fortran, Forth, Pascal, Basic, C, C++, C#, Object Pascal, HTML, Java Script, and finally Python. Of all of those I enjoy Python the most. It is a language with an easy to learn syntax, many modern concepts, and because of its pseudo type syntax it applies well to solving scientific problems.

Member Avatar for sravan953

vegaseat pretty much summed it all up! ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.