making windows apps

Z

Zach Shutters

I am new to python and working my way through the van Rossum tutorial. I
am cursios though about if you can program windows with python? I know I
shouldn't worry about this right now but I am curious. If so, is there any
recommended tutorials on this. I know I can search google but i figured I
would see what some people who know the language well would recommend.
One last thing, in order for a program I write in python to run on
someones computer, they have to have the python interpreter installed? And
if so, wouldn't most people not have it installed since they wouldn't be
programming in it. I know this is probably an uber nube question, but that's
what I am right now. Hopefully no one will get pissed off and give some
smart ass comment about how stupid my question is (sorry but most of the
time thats what I get when I post in a newsgroup lol)

-Zach
 
P

Peter Hansen

Zach said:
I am new to python and working my way through the van Rossum tutorial. I
am cursios though about if you can program windows with python?

Yes, certainly. If you follow the newsgroup, you'll often see
discussions of various ways of doing GUI programming, including
one that was just started and to which I just posted a small
sample program just now.
I know I can search google but i figured I
would see what some people who know the language well would recommend.

Well, there's always people here willing to answer questions, but
it is *really* appreciated when people do take the time to check
with Google first. For example, it would easily have found you
this page http://www.metaslash.com/brochure/tutorial/ or this
one http://www.python.org/doc/faq/gui.html.
One last thing, in order for a program I write in python to run on
someones computer, they have to have the python interpreter installed?

Yes, at some point, unless you use Jython to turn the program into
Java .class files in which case they need the Java runtime
installed instead.
And
if so, wouldn't most people not have it installed since they wouldn't be
programming in it.

Most people who are interested in distributing their Python programs
either don't mind having their users download Python (it's trivially
easy to do) or they package up their program with tools such as py2exe,
which create executables that bundle the interpreter. They also
generally use other tools such as InnoSetup to build nice installers.
The end users cannot tell the difference and don't have a clue what
language their application is programmed in, so you shouldn't worry
about this issue much.
> Hopefully no one will get pissed off and give some
smart ass comment about how stupid my question is (sorry but most of the
time thats what I get when I post in a newsgroup lol)

This newsgroup is different. On the other hand, it is *really*
appreciated when people take the time to research a little
themselves, so it's a good thing you are doing the tutorial
now. Consider also reading through the FAQ at the www.python.org
site (skim it quickly the first time, as you won't understand
many of the entries, but you'll remember some of them anyway and
can go back later when you know more and you'll understand much
more of them). You might also keep Google Groups in mind, so
that you can quickly check the archives for this newsgroup when
you are thinking of asking questions in the future. It's *really*
appreciated. ;-)

-Peter
 
J

Josh Close

Yes, you can download a windows installer for python and just double
click to install it :p

If you want to get your python code to run on a computer without the
interpreter, you can make an .exe file from your code. There are
several ways to do this, but I can't really direct you there since I
haven't done it myself yet.

-Josh
 
P

Paul McNett

Zach said:
I am new to python and working my way through the van
Rossum tutorial. I am cursios though about if you can program
windows with python?

Yes you can, in fact, no matter what you mean by "windows".
I know I shouldn't worry about this
right now but I am curious. If so, is there any recommended
tutorials on this. I know I can search google but i figured I
would see what some people who know the language well would
recommend.

Well, now I need to know what you mean by "windows". I think you
mean you want to program a graphical user interface, in which
case you need to continue on with your tutorial for now but
then take good looks at the three main user-interface toolkits
for Python that are cross-platform:

+ Tkinter (included with Python, the easiest to learn and work
with).
+ wxPython (the best choice, but could be a steep learning curve
and the API is in rapid flux)
+ PyQt (the most polished, but licensing issues are abundant)

One last thing, in order for a program I write in
python to run on someones computer, they have to have the
python interpreter installed?
Yes.

And if so, wouldn't most people
not have it installed since they wouldn't be programming in
it.

Most if not all Linux and Macintosh systems come with Python
installed already. For Windows, it is an easy install. There
are also third-party utilities to wrap your Python program into
an executable, complete with the Python interpreter so no
separate install would be necessary. Google for 'py2exe' for a
start.
I know this is probably an uber nube question, but that's
what I am right now. Hopefully no one will get pissed off and
give some smart ass comment about how stupid my question is
(sorry but most of the time thats what I get when I post in a
newsgroup lol)

Keep reading the tutorial, and refrain from asking stupid
questions, and you'll be fine. :)
 
C

Carlos Ribeiro

I am new to python and working my way through the van Rossum tutorial. I
am cursios though about if you can program windows with python? I know I
shouldn't worry about this right now but I am curious. If so, is there any
recommended tutorials on this. I know I can search google but i figured I
would see what some people who know the language well would recommend.

Python can be used to write graphical native applications for both
Windows and Linux. In any case, you need to choose first what
windowing library (or toolkit) you're going to use. If you are used to
the Windows way of doing things, relax -- the only difference is that
if you use MS tools, you have no choice but to use the toolkit that
Microsoft provides (so you never knew that it was possible to have a
choice), but now you have a few options.

The main windowing libraries available for use with Python are:

-- Tk
-- wxPython
-- Qt

I suggest that you take look at wxPython (at www.wxpython.org). It's
cross platform, which means that an app written using it will run
without changes in Linux and Windows systems while keeping the same
look and feel. Tk is easy to use, and well supported in Python, but I
prefere wxPython (that's a personal opinion, and your mileage may
vary). As for Qt, the library is excellent, but the it's only
available under a commercial license for Windows.

The next step is to choose a programming environment. Again, if you
are used to VB or Delphi, you never knew that you had a choice here,
because these tools pack everything -- the language, the supporting
libraries, the windowing libraries, and the programming environment
into a single package. It would really be nice to have such a pack for
Python (and in fact, there are a some good, but high-priced commercial
options available; for example, BlackAdder or Wingz); however, if
you're using only free tools, then the selection is relatively
limited, but still useful enough for most needs.

If you took my advice and selected wxPython, the two best choices for
the IDE are Boa Constructor and PythonCard. The former is a very
advanced IDE, but it's still in development. PythonCard is simpler and
a little bit easier to use, but it's also not released yet -- only the
development version is available.
One last thing, in order for a program I write in python to run on
someones computer, they have to have the python interpreter installed? And
if so, wouldn't most people not have it installed since they wouldn't be
programming in it. I know this is probably an uber nube question, but that's
what I am right now. Hopefully no one will get pissed off and give some
smart ass comment about how stupid my question is (sorry but most of the
time thats what I get when I post in a newsgroup lol)

There are easy ways to pack everything that is needed to distribute
any type of Python program into a single installer. I don't have the
pointers here but I've done it before and it's a snap. It works for
any type of app, including Windows apps; the installation kit
generates a single exe file for easy distribution.


--
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: (e-mail address removed)
mail: (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,206
Messages
2,571,069
Members
47,675
Latest member
RollandKna

Latest Threads

Top