473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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

I just discovered Python and looked briefly at one of the tutorials
for beginners...

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

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

2 - Can you call Windows Procedures or what ever they call them
these days?

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

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

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

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'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?

Thanks for any info.

Will

Jul 18 '05 #1
8 2271

"Will" <k4***@yahoo.com> wrote in message
news:ma*************************************@pytho n.org...
I just discovered Python and looked briefly at one of the tutorials
for beginners...

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

1 - Can you create windows, buttons, user input fields, etc as you
can with Visual Basic?
Yes and no. Yes, you can use one of several GUI toolkits
(an interface to TK comes with Python) to construct user
interfaces. No, it does not have the ease of drag and drop
building UI and data base programs that VB does.
2 - Can you call Windows Procedures or what ever they call them
these days?
With some work, yes. There are several extensions for that.
3 - Can you create your own objects with a bunch of methods and
properties?
That's how you program in Python, after all.
4 - Can you create a Windows program that looks and feels like a
Windows program?
If you want to. It's possible to access the Windows graphics API,
but it's not really the easiest thing to do. Most people will use
one of the other graphics toolkits.
5 - Does it come with a compiler or must the user have the
interpreter on their machine?
No compiler, but there are ways of avoiding having to install
the interpreter as a separate step.
6 - Why another language? Easier than C or C++ or Visual C ?? More
powerful than Visual Basic or the competing Borland productg?? Why
Python?
There's a Python history somewhere; it started out as the scripting
language for an operating system research project at a university in
the Netherlands. As a language, it tries to maintain a productive
balance between simplicity and power in an OO framework.
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?
Unless they are really unusual projectes, most likely.
Thanks for any info.
You're welcome.

Will

Jul 18 '05 #2
John Roth wrote:
"Will" <k4***@yahoo.com> wrote in message
news:ma*************************************@pytho n.org...
I just discovered Python and looked briefly at one of the tutorials
for beginners...

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

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

Yes and no. Yes, you can use one of several GUI toolkits
(an interface to TK comes with Python) to construct user
interfaces. No, it does not have the ease of drag and drop
building UI and data base programs that VB does.


There are several GUI builders around (wxGlade, for example) but they
are still under develpment.

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

No compiler, but there are ways of avoiding having to install
the interpreter as a separate step.


If this is a huge concern for you, check the freezing modules.
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?

Unless they are really unusual projectes, most likely.


Like embedded processor stuff.

--
Andres Rosado
Email: an*****@despammed.com
ICQ: 66750646
AIM: pantear
Homepage: http://andres980.tripod.com/

A friend may well be reckoned the masterpiece of Nature.
-- Ralph Waldo Emerson
Jul 18 '05 #3
See answers below:

-Larry Bates
-------------------
"Will" <k4***@yahoo.com> wrote in message
news:ma*************************************@pytho n.org...
I just discovered Python and looked briefly at one of the tutorials
for beginners...

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

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

Answer: Yes, take a look at wxPython interface at:
http://www.wxpython.org/. There are also several other
interfaces Tk, Qt, etc. but I think wx is the most like
Windows.

2 - Can you call Windows Procedures or what ever they call them
these days?

Answer: You can call both windows .DLLs and COM objects
for .DLLs see http://aspn.activestate.com/ASPN/Coo.../Recipe/146847 for COM objects get a copy of Python Programming on Win32. It contains
a ton of examples on how to interface Python with the Windows world.

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

Answer: Absolutely. You can create Python objects as well as COM objects
that can be called by other programming languages (e.g. VB). This is
one of the most powerful features of Python. Everything in Python is
an object (even the builtin methods). But unlike some other languages
the basic set of keywords is more like old Fortran (very short) so you
aren't constantly forgetting the language.

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

Answer: Absolutely. You can even call the same dialogues that Windows
calls so that it looks EXACTLY like a Microsoft product. Of course if
if you do the program will only run on Windows. If you use wxPython
your application would be portable (e.g. Linux, Mac, etc.). For a
good example of how well you can integrate Python into the "Microsoft"
world take a look at SpamBayes (spam filtering plug in for Outlook) at
http://spambayes.sourceforge.net/. Download ActiveState's excellent
Python distribution and you can see. It is all written in Python, but
acts like any other Windows application.

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

Answer: No compiler (works like Java), but you can "freeze" the
application so that you don't have to install Python interpreter.
One example: http://starship.python.net/crew/theller/py2exe/
I use py2exe and InnoSetup (http://www.jrsoftware.org/isinfo.php)
to freeze and distribute software. Both of these are open source
(free) and have proven to work for me. I've written COM objects,
NT Services and regular programs and have frozen and distributed
them using this method.

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

Answer: Much easier than C or C++, more powerful than VB. Portable
across Operating Systems (unlike VB). Programming in Python becomes
as easy as writing pseudocode because properly written Python looks
exactly like the pseudocode that you would write down at the beginning
of an application. You can write COM objects, NT services, GUI
applications, batch-like files, web services, and simple conversion
routines all in one language. You eventually get good at the
language because you aren't constantly switching between languages.
The intrepreted nature of Python also allows you to do things that
are very difficult in compiled languages. The included standard
library that includes routines for SMTP mail, FTP, HTTP, Zip/UnZip,
date/time conversions, etc. can solve the vast majority of problems
right out of the box. With other languages you must purchase lots
of add-ons to achieve the same functionality (and constantly upgrade
them whenever you get a new version of the language). There are
excellent open-source tools like Python Imaging Library (PIL) and
Report Lab/Graphics (PDF generation) that would cost 100's if not
thousands of dollars.

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?

Thanks for any info.

Will

Jul 18 '05 #4
In article <ma*************************************@python.or g>,
Will <k4***@yahoo.com> wrote:

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


The original intent was to create a language that borrowed ideas from
ABC and Pascal/Modula-3 while still being easy to hook to C libraries.
--
Aahz (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/

"Argue for your limitations, and sure enough they're yours." --Richard Bach
Jul 18 '05 #5
"Will" <k4***@yahoo.com> wrote in message news:<ma*************************************@pyth on.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.
Jul 18 '05 #6
Sridhar R <sr*************@yahoo.com> pisze:
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


I'd rather propose wxPython, since it uses native Windows controls.

--
Jarek Zgoda
http://jpa.berlios.de/
Jul 18 '05 #7
On Fri, 13 Feb 2004 14:30:29 -0000, Will <k4***@yahoo.com> wrote:
I just discovered Python and looked briefly at one of the tutorials
for beginners... .... 6 - Why another language? Easier than C or C++ or Visual C ?? More
powerful than Visual Basic or the competing Borland productg?? Why
Python?


Why *not* another language? Of the ones you mentioned, only C and C++
are freely available and widespread over multiple platforms -- and they
are very different from python and solve different problems.

(Your mileage may vary. I don't care about GUIs (although you have a point
there about non-native Windows GUIs being painful), and I don't care to
learn anything I cannot apply under Unix.)

/Jorgen

--
// Jorgen Grahn <jgrahn@ ''If All Men Were Brothers,
\X/ algonet.se> Would You Let One Marry Your Sister?''
Jul 18 '05 #8
On 2004-02-13, John Roth <ne********@jhrothjr.com> wrote:
Yes and no. Yes, you can use one of several GUI toolkits
(an interface to TK comes with Python) to construct user
interfaces. No, it does not have the ease of drag and drop
building UI and data base programs that VB does.


Yes and kind-of. See Boa-constructor. :P

--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
Jul 18 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Krisztian Kepes | last post by:
Hi ! I want to start many py programs - with other parameters. Because the programs have many to-do, I don't want to wait for them. In Delphi it is like this: >>>>>>>>>>>>>>>
54
by: seberino | last post by:
Many people I know ask why Python does slicing the way it does..... Can anyone /please/ give me a good defense/justification??? I'm referring to why mystring gives me elements 0, 1, 2 and 3...
0
by: UrsusMaximus | last post by:
One measurement by which Python is more popular than Ruby, Java, Perl, PHP and .NET is in the world of Podcasts. At Podcastalley, podcasts are ranked by popularity in each of several genre's. In...
113
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside...
4
by: Stephen Cattaneo | last post by:
Hello all, I am attempting to execute an automated test (written in Python) via cron. I have to check the HOSTNAME variable as part of the test, oddly under cron the HOSTNAME environment...
0
by: Edwin.Madari | last post by:
source in or execute .profile (or .bash_profile which ever is applicable toyou) as a first thing in the cron to get environment variables. hope that helps. Edwin -----Original Message-----...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.