473,241 Members | 1,494 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,241 software developers and data experts.

How do I make Windows Application with Python ?

Well that's it, how do I make Windows Application with Python ???
Is there simple way that works 100% ? How can I rework visual design
done in VS 2003 to use it for my python program ?
Jul 18 '05 #1
14 4491
BOOGIEMAN wrote:
Well that's it, how do I make Windows Application with Python ???
Is there simple way that works 100% ? How can I rework visual design
done in VS 2003 to use it for my python program ?


Close your eyes, see this model-view-controller in your application,
rewrite it in Python using one of its MVC frameworks.

You see? It's easy, like that!

--
Jarek Zgoda
http://jpa.berlios.de/ | http://www.zgodowie.org/
Jul 18 '05 #2
BOOGIEMAN wrote:
Well that's it, how do I make Windows Application with Python ???
Is there simple way that works 100% ? How can I rework visual design
done in VS 2003 to use it for my python program ?


What do you mean by "Windows Applications"? I'm running
Python on Windows XP, so every program I write with
Python is a "Windows application" by my definition. Obviously
you are using a different one.

(And if you just mean "it has a GUI", then my answer is
"I use wxPython with Python". There is also Tkinter, and
other options. Please ask a more specific, detailed question
to get useful answers.)

-Peter
Jul 18 '05 #3
On Mon, 03 Jan 2005 22:57:22 +0100, Jarek Zgoda wrote:
Close your eyes, see this model-view-controller in your application,
rewrite it in Python using one of its MVC frameworks.

You see? It's easy, like that!


Yes, only if I'd know what you're talking about :(
Jul 18 '05 #4
On Mon, 03 Jan 2005 17:19:22 -0500, Peter Hansen wrote:
What do you mean by "Windows Applications"? I'm running
Python on Windows XP, so every program I write with
Python is a "Windows application" by my definition. Obviously
you are using a different one.

(And if you just mean "it has a GUI", then my answer is
"I use wxPython with Python". There is also Tkinter, and
other options. Please ask a more specific, detailed question
to get useful answers.)


Well, I programmed a little in MS Visual Studio 2003, and there you have
Console apllication and Windows application (among others). Windows one is
with buttons and other gadgets. So, I want to make applications that
doesn't open console to display result, I want to display it into the
message box. Also, I want to use that application on the computers where
Python isn't installed
Jul 18 '05 #5
BOOGIEMAN wrote:
Well, I programmed a little in MS Visual Studio 2003, and there you have Console apllication and Windows application (among others). Windows one is with buttons and other gadgets. So, I want to make applications that
doesn't open console to display result, I want to display it into the
message box. Also, I want to use that application on the computers where Python isn't installed


Well, in Python you can code "Windows Applications":
see WxPython, AnyGUI, PyGTK, etc.

There'is at least one RAD if you don't want to code the gui yourself
(Boa Constructor).

See http://www.python.org/cgi-bin/moinmoin/GuiProgramming.

And about using your applications where Python is not installed,
look at http://www.python.org/moin/Py2Exe

--

Pato./

Jul 18 '05 #6
There are several GUI toolkits for python. Tkinter comes with python,
but wxPython, a binding to wxWindows is popular, as is pyQT, and pyGTK.
You can also build native win32 GUIs using PythonWin, part of win32all.
A more complete list of options is available here:
http://www.python.org/cgi-bin/moinmoin/GuiProgramming .

I have heard a couple good things about Boa Constructor
(http://boa-constructor.sourceforge.net/) as an IDE. It includes a GUI
designer. I have not used it though. Stand alone GUI designers such as
wxGlade (http://wxglade.sourceforge.net/) are available as well.

As far as packaging the application for use on computers where python
is not installed. If you are distributing to windows computers you can
use py2exe to make a windows executable from a python program. It will
include dlls you need to distribute with your program. cx_Freeze and
Gordon McMillan's Installer also can create windows executable files.

Good luck... and be sure to read through the online tutorials and
wikis, there is a wealth of information out there. A book isn't a bad
investment either, I always feel better with a good reference book
around. Python in a nutshell is a good reference book, while Learning
Python gives you a good introduction to the language.

Chris

Jul 18 '05 #7
I should learn to type faster. You beat me to the response.

Chris

Jul 18 '05 #8
> Well, I programmed a little in MS Visual Studio 2003, and there you have
Console apllication and Windows application (among others). Windows one is
with buttons and other gadgets. So, I want to make applications that
doesn't open console to display result, I want to display it into the
message box. Also, I want to use that application on the computers where
Python isn't installed


First there is a good book: Python Prgoramming on Win32, by Hammond &
Robinson, O'Reilly is the publisher. I believe one of these guys wrote
the python windows extension.

Second, on MS Windows you need two python installs, the basic python install,
and the python for windows extension (also sometimes call win32all or
something like that). These two together give you a great basic set to
work with. I've done MS Windows programming with these and they work great.

With the win32 extension module -- you can use ActiveX, you can use the
standard MS Windows calls, and it also defines a python intepretor mode
where it does not open the console window if you name the main program
module as .pyw (as opposed to .py). It does other things too. This is
all discribed in the book I recommended. Note also, if you don't want to
see the console window -- even without use .pyw files, you can tell the
launcher to open the console window minimized -- not great but it does
work.

I believe also if you want to use MS Visual Studio -- Active State sells
python programming tools that plug into MS Visual Studio if you want to do
that. I've not tried these so I don't know how they work or if they are
any good.

It's also possible to program on MS Windows so your app is protable to Linux
and other systems. You can use Tkinter or wxWidgets (was called
wxWindows -- until maybe MS made them change it) to do that. I've
used Tkinter before for example, though I think wxWidgets is probalby
more of the wave of the future. Others may know.

If you want to run the program on other computers not having python, you
have two basic choices. One -- what I do, I just made up a python setup
CD that installs python, python windows extensions, and the basic
libraries I usually use so that it's easy to setup a python environment on
other systems. Then I install my code.

The other alternative is to use one of the tools that wraps up a python
program with the needed executables. Some of these are py2exe, cx-freeze,
McMillan Installer, Fractel Mountains, StarKits, UPX, and InnoSetup. I've
not used any of these -- and so this list may not be correct/complete.
Others may know what's best.

There are also some compilers too - pyrex, pysco starkiller, and pypy.
Again, I've not used any of these and this is just from some cryptic notes
I've taken. So ask others for input. Probabably you want one of the
installers rather than the compilers because python compilers are kind of
new, but that's just a guess.

Hope that helps.
Rob
Jul 18 '05 #9
BOOGIEMAN wrote:
On Mon, 03 Jan 2005 17:19:22 -0500, Peter Hansen wrote:

What do you mean by "Windows Applications"? I'm running
Python on Windows XP, so every program I write with
Python is a "Windows application" by my definition. Obviously
you are using a different one.

(And if you just mean "it has a GUI", then my answer is
"I use wxPython with Python". There is also Tkinter, and
other options. Please ask a more specific, detailed question
to get useful answers.)

Well, I programmed a little in MS Visual Studio 2003, and there you have
Console apllication and Windows application (among others). Windows one is
with buttons and other gadgets. So, I want to make applications that
doesn't open console to display result, I want to display it into the
message box. Also, I want to use that application on the computers where
Python isn't installed


if you are familliar with the .NET framework you can use the beta
release og Python.NET to create your GUI. It gives you access to the
Windows Forms controlls in the .NET framework

--
--------------------------------------
Ola Natvig <ol********@infosense.no>
infoSense AS / development
Jul 18 '05 #10
You need py2exe to bundle applications so they can be used on machines
without python. When you do that you have a choice of whether or not
your application should have a console box or not. In order to use
buttons and other widgets you will need to choose a GUI toolkit. I
recommend starting with Tkinter - but others would recommend wxPython.
Regards,

Fuzzy
http://www.voidspace.org.uk/python/index.shtml

Jul 18 '05 #11
On Mon, 03 Jan 2005 19:56:10 -0600, Rob Emmons wrote:
I believe also if you want to use MS Visual Studio -- Active State sells
python programming tools that plug into MS Visual Studio if you want to do
that. I've not tried these so I don't know how they work or if they are
any good.


Thanks all for very detailed answers. BTW I tried this one but it seems
that it doesn't use VS'es visual designer. Also it doesn't have "build"
option so it is basicly only usefull to higlight Python syntax.
Active Sate Komodo looks like much better choice
Jul 18 '05 #12
Couple of corrections - neither pypy nor starkiller are compilers.
Starkiller isn't available yet and *may* be helpful in building
compilers. Pyrex is an alternative language - a python/C hybrid that
can be compiled.

If you want to release an application then innosetup, starkit, and upx
might help - but they're not python related. You will need something
like py2exe, cx_freeze, or mcmillan installer. (Which are specific to
python - py2exe seems to be the more mature tool).

Alternatively you could consider 'Movable Python' - a frozen
distribution of python that doesn't need isntalling. See
http://sourceforge.net/projects/movpy
Regards,

Fuzzy
http://www.voidspace.org.uk/python/index.shtml

Jul 18 '05 #13
BOOGIEMAN wrote:
Thanks all for very detailed answers. BTW I tried this one but it seems
that it doesn't use VS'es visual designer. Also it doesn't have "build"
option so it is basicly only usefull to higlight Python syntax.
Active Sate Komodo looks like much better choice


I don't know of any python IDE with a visual designer and a build to exe
option.

But since you are familiar with Visual Studio and you are developing on
Windows, you might check out the free SharpDevelop IDE:
http://www.icsharpcode.net/OpenSource/SD/

Then unzip this boo add-in into the SharpDevelop folder under Program
Files: http://coedit.net/boo/BooBinding.zip

Then you can start up SharpDevelop, create a new boo project, press the
green play button, and your exe will be built and executed (the one
below is only 4kb in size). We are working on adding support for
SharpDevelop's visual form designer soon.

To show a Windows message box instead of printing to the console like
you were asking earlier, you can use code like this:

import System.Windows.Forms
MessageBox.Show("your message")

Or for a more complete windows app:

import System.Drawing
import System.Windows.Forms

class MainForm(Form):
def constructor():
self.Text = "My Window"

b = Button(Text: "Click Me")
b.Location = Point(100,75)
b.Click += def():
MessageBox.Show("Button clicked")
#or:
#b.Click += OnButtonClick

self.Controls.Add(b)

def OnButtonClick():
MessageBox.Show("Button clicked")
f = MainForm()
Application.Run(f)
Jul 18 '05 #14
On Wed, 05 Jan 2005 04:49:05 -0800, Fuzzyman wrote:
Couple of corrections - neither pypy nor starkiller are compilers.
Starkiller isn't available yet and *may* be helpful in building
compilers. Pyrex is an alternative language - a python/C hybrid that
can be compiled.

If you want to release an application then innosetup, starkit, and upx
might help - but they're not python related. You will need something
like py2exe, cx_freeze, or mcmillan installer. (Which are specific to
python - py2exe seems to be the more mature tool).

Alternatively you could consider 'Movable Python' - a frozen
distribution of python that doesn't need isntalling. See
http://sourceforge.net/projects/movpy


Great summary. I was hoping someone would fill in the blanks. I've been
interested in this area for some time -- but have not had time to look
into it more than keep a list of interesting projects I wanted to research
in the future. I'll add your comments to my list.

Again, thanks.

Rob

Jul 18 '05 #15

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

Similar topics

19
by: Eric | last post by:
I'm trying to have some scripts run periodically on Windows XP and found the "Task Scheduler" did not execute my scripts. My scripts are of the form scriptName.py, and will run just by invoking that...
1
by: bill ramsay | last post by:
Dear all. I am using an existing hodge-podge of an application that runs on top of an Access database. This application dials up customer equipment, handshakes then downloads/uploads various...
2
by: Roose | last post by:
With some googling I have found these resources: http://docs.python.org/ext/win-dlls.html http://www.python.org/doc/faq/windows.html I have a large Win32/MFC/C/C++ application that has an...
2
by: Aki Niimura | last post by:
Hello everyone, I'm encountering a weird problem and couldn't find any Internet postings that are relevant to my problem and it seems coming from the Pmw Balloon widget inside. I have...
3
by: Mike Moum | last post by:
Hi, I'm a civil engineer who also doubles as chief programmer for technical applications at my company. Most of our software is written in Visual Basic because our VP in charge of I.T. likes to...
16
by: Paul Rubin | last post by:
As what must be penance for something or other, I'm needing to release a Python app for use under Windows XP. Please be gentle with me since I'm a Un*x weenie and the only thing I've had much...
33
by: Will McGugan | last post by:
Hi, I'd like to write a windows app that accesses a locally stored database. There are a number of tables, the largest of which has 455,905 records. Can anyone recommend a database that runs...
3
by: Wolfgang Keller | last post by:
Hello, this is a potentially veeery dumb question, but: - If an application supports VBA as a macro language, - and if you can execute Python code from within a VBA script (how?) - and if the...
1
by: freesteel | last post by:
I have posted about this problem before. SInce then I found a much better article to help with embedding python in a multithreaded application: http://www.linuxjournal.com/article/3641 I...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.