6 Qustions about Python: Does it do GUI? more...

Sridhar R sridharinfinity at yahoo.com
Sat Feb 14 03:34:38 EST 2004


"Will" <k4bda at yahoo.com> wrote in message news:<mailman.11.1076682913.31398.python-list at python.org>...
> I just discovered Python and looked briefly at one of the tutorials 
> for beginners...

   Python is lot more than one of those tutorials.  You need to dig a
lot for better solutions. ;)

> It looks a lot like the old Command line Basic... I'm sure it does 
> much more but...

   Ofcourse, it is.

> 1 - Can you create windows, buttons, user input fields, etc as you 
> can with Visual Basic?

   Well, let me tell you one thing.  I was used to be a VB programmer.
 After switching to the Linux world, I started learning GTK ( a GUI
toolking on top of X).  Then I programmed my first project (an 8085
simulator), just in 3 days.  I personally believe that, VB is not as
easy for programmer like me.  I need flexiblity.  But such  feelings
were not in my mind when I was using VB and at that time I was looking
VB as the only easiest language in the World.  Now I am never able to
see any other easier language than Python.  Once again, welcome to the
Python world.

   Anyway, try Glade (http://glade.gnome.org), a GUI builder.  Also
for GUI try PyGTK (http://pygtk.org).  Search google for windows
version of glade.  For me, pygtk (or GTK) has killer API than MFC, or
whatever stuffs that are Windows-only.
 
> 2 - Can you call Windows Procedures or what ever they call them 
> these days?

   Do you mean by Win32API.  No.  Please switch the viewpoint you're
viewing from.  A person writing a software, shouldn't be programming
it platform specific.  (For eg, a VB programmer can only write
programs for Windows world, though projects like http://vb2py.sf.net
exist).  You should write programs in a portable way.  Try using
existing python packages and modules for you job.  If you need to do
more windows specific stuffs, then I remember win32api module for
python once, try that.

> 3 - Can you create your own objects with a bunch of methods and 
> properties?

  and that's python.

> 
> 4 - Can you create a Windows program that looks and feels like a 
> Windows program?

   Try PyGTK (http://pygtk.org)  (particularly look at the windows
part of the FAQ)
   Try http://gtk-wimp.sf.net
   This is enough.  Even your VB can't create programs with WindowXP
look and feel (by default).
    See screenshots at http://gtk-wimp.sf.net


> 5 - Does it come with a compiler or must the user have the 
> interpreter on their machine?

   Yes and not necessary.  It's better if the user has Python
installed on his machine. Otherwise, you have package your application
_completely_ everytime bundled.  That is a space overhead.  Projects
like py2exe and freeze are there for you question.

> 6 - Why another language? Easier than C or C++ or Visual C ?? More 
> powerful than Visual Basic or the competing Borland productg?? Why 
> Python?
> 

   I strongly discourage your point of mentioning VB as powerful.  May
be your domain was SMALL.
When I was using VB, I thought VB was powerful.  At that time, I know
only what you know.  Then I
entered the open source world.  I learn lot of languages.  Now feel VB
is just well behind lot of the languages I learnt.  Now python is in
front.
  Learn python. Program python.  Then say which is the powerful
language (for you).  Don't back away by just seeing that python
doesn't have any wysiwyg stuffs.  Remember UNIX, a most powerful
architecture than Windows, though windows has more attractive GUI (now
Linux has some the best GUIs)

> I'm interested as I never really took the time to become much of a C 
> programmer (or C++ or Visual C) - I've done lot's of assembly 
> language/embedded processor stuff & years ago Basic and some Visual 
> Basic... before .net... and wondered if Python would do me for some 
> projects I have always wanted to do?

    Yes.  Python is a scripting language.  It will decrease you
development time, increasing your productivity.  Henessey and
Patterson say
   "A program will spend 90% of the time in 10% of its code"
  So write Python, and find that 10% of code (by profiling), then
optimise it by writing that part in C/C++.
  AFAIC this is the most elegant way to write software
  
  Search Google with this query "why python esr", and click on the "I
am feeling lucky" button (or surf to the first search result).   I'll
definitely be a lucky person ;)

 
> Thanks for any info.
> 
> Will

Happy hacking.



More information about the Python-list mailing list