473,748 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to accelerate python application GUI speed

Hi,all

I use wxPython make a bittorrent client. I find wxPython very slow and
use many many memory.
When app start, it need 19MB memory. I only use common GUI components.
Python is a really good
programming language. But how to do a small,smart, efficency GUI in
win32,it's a big question.

I need make GUI,core code is bittorrent code. I can't change it.it's
really good code.

I read book 'Python Programming on Win32' ,I get following idea. I
test it.

1. Use wxpython ,it's successful,but very slow .

2. use python for delphi. I test it, but it need embed python code to
delphi. So need
change original code.Actually I don't know how to change .it's big
project.

3. User win32com, make a com server by delphi. com server have form.
make python code
as com client. I make a com server and invoke the server by
pythonwin. but the form
can't show. :( anyone do it ,could you share you code to world.

4. use pythonwin. mfc or win32gui framework. I check the demo code,
it's very complex.
you know I hate MFC. it's a joke. i like VCL so much.

5. I have a another idea. use wxWindows (c lan) build a GUI. embed
python code .
or embed wxWindows code to python by SWIG. I have't test it. if you
have do it.
Please tell us.

Thanks.

Ulysses
ul********@yaho o.com.cn
Jul 18 '05 #1
13 9226
ul********@yaho o.com.cn (ulysses) writes:
Hi,all

I use wxPython make a bittorrent client. I find wxPython very slow and
use many many memory.
When app start, it need 19MB memory. I only use common GUI components.
Python is a really good
programming language. But how to do a small,smart, efficency GUI in
win32,it's a big question.


An solution is to make a web application and use a tiny browser like
kmeleon.

bye

--
William Dode - http://flibuste.net
Jul 18 '05 #2
ul********@yaho o.com.cn (ulysses) writes:
[...]
Python is a really good programming language. But how to do a
small,smart, efficency GUI in win32,it's a big question.
http://venster.sourceforge.net/

[...] 4. use pythonwin. mfc or win32gui framework. I check the demo code,
it's very complex. you know I hate MFC. it's a joke. i like VCL so
much.
Well, if you hate win32 also, then you won't like venster.

5. I have a another idea. use wxWindows (c lan) build a GUI. embed
python code . or embed wxWindows code to python by SWIG. I have't
test it. if you have do it. Please tell us.


Interesting idea.
John
Jul 18 '05 #3
Wilk <wi******@OUTfl ibuste.net> writes:
ul********@yaho o.com.cn (ulysses) writes: [...] An solution is to make a web application and use a tiny browser like
kmeleon.


Or MSIE, possibly using HTA.
John
Jul 18 '05 #4
On Wed, 03 Sep 2003 06:32:42 -0700, ulysses wrote:
Hi,all

I use wxPython make a bittorrent client. I find wxPython very slow and
use many many memory.
When app start, it need 19MB memory. I only use common GUI components.
Python is a really good
programming language. But how to do a small,smart, efficency GUI in
win32,it's a big question. [snip] 5. I have a another idea. use wxWindows (c lan) build a GUI. embed
python code .
or embed wxWindows code to python by SWIG. I have't test it. if you
have do it.
Please tell us.


Swig is how wxPython works already. If you wanted to do the whole gui in
C++, and just have python launch the code, you can do an extension pretty
easily, see my wiki entry here:
http://wiki.wxpython.org/index.cgi/C_2b_2bExtensions
(I'm not sure that this will make any difference wrt memory usage though.)
I think that letting C++ "drive" your code will be a significantly greater
time investment, I'm not sure how much of an effort it is to get the
python mainloop and the wxWin mainloop to work together, but since it is
already done for me with wxPython, I don't think I'll go trying to find
out either :-)

-Mark
Jul 18 '05 #5
ulysses wrote:
I use wxPython make a bittorrent client. I find wxPython very slow and
use many many memory.
When app start, it need 19MB memory. I only use common GUI components.
Python is a really good programming language. But how to do a small,smart,
efficency GUI in win32,it's a big question.


In my opinion, the Qt toolkit is far better in terms of quality and speed
than wx/tk/whatever. It's also dead simple to code for. The Python
bindings are here: <URL:http://www.riverbankco mputing.co.uk/pyqt/>.

Check out the license first, some people don't like any of the choices
available.
--
Jim Dabell

Jul 18 '05 #6
You will always take a hit using threading and a gui. I agree with your
complaints about wxPython's size though. I'm not quite sure what you
mean by wxPython is "slow" though. Do you mean that running your code
inside wxPython is slow?

Qualitatively, when using wxPython and QT I've encountered about a 30%
speed hit when using threads.

I'll assume that your bit-torrent code has a pretty simple interface,
such as "download this file to here", "I'm X percent done" and "cancel
the download"

If this is the case, you might be interested in using wxProcess to spawn
a new python process and then monitor the new processes stdout to update
a progress bar or a dialog box.

The benefits are as follows:
1) Easy to kill a process.
2) The process doesn't get blocked by the GIL and can run with (just
about) full CPU power.

Downsides:
1) python needs to be in your path and the python path has to be
set up correctly to load your code.
2) wxProcess doesn't work on OS X yet.

My code is pretty ugly, but I am using it in a production environment.
Let me know if you want me to post it here (it comes with an example).

--
Brian Kelley bk*****@wi.mit. edu
Whitehead Institute for Biomedical Research 617 258-6191

Jul 18 '05 #7
jj*@pobox.com (John J. Lee) writes:
Wilk <wi******@OUTfl ibuste.net> writes:
ul********@yaho o.com.cn (ulysses) writes:

[...]
An solution is to make a web application and use a tiny browser like
kmeleon.


Or MSIE, possibly using HTA.


What is HTA ? I thought about an HTTPServer that could work with any
browser.

--
William Dode - http://flibuste.net
Jul 18 '05 #8
| What is HTA ?

Wilk ....

HTA ... HTML Application

http://msdn.microsoft.com/workshop/a...bjects/hta.asp

Example containing a bit of VBScript
to access some common applications
under Windows ...

http://fastq.com/~sckitching/HTML/Start_Page.hta

--
Cousin Stanley
Human Being
Phoenix, Arizona
Jul 18 '05 #9
| But you can use Python just as easily.
|
| <script language="Pytho n">
| ...
| </script>

John ....

I did that example HTA using VBScript about 3 years ago
before I even knew that Python existed and just posted it
as a handy example to illustrate basically what a local
HTA could do ....

It would be WAY cooler to do it in Python,
and now that I know it's possible I'll try it ....

--
Cousin Stanley
Human Being
Phoenix, Arizona
Jul 18 '05 #10

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

Similar topics

467
21601
by: mike420 | last post by:
THE GOOD: 1. pickle 2. simplicity and uniformity 3. big library (bigger would be even better) THE BAD:
52
3855
by: Neuruss | last post by:
It seems there are quite a few projects aimed to improve Python's speed and, therefore, eliminate its main limitation for mainstream acceptance. I just wonder what do you all think? Will Python (and dynamic languages in general) be someday close to compiled languages speed? What will be the future of Psyco, Pypy, Starkiller, Ironpython and all the other projects currently on development?
114
9870
by: Maurice LING | last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic typing, is there any other real reasons that Python is slower than Java? maurice
9
4520
by: Dieter Vanderelst | last post by:
Dear all, I'm currently comparing Python versus Perl to use in a project that involved a lot of text processing. I'm trying to determine what the most efficient language would be for our purposes. I have to admit that, although I'm very familiar with Python, I'm complete Perl noob (and I hope to stay one) which is reflected in my questions. I know that the web offers a lot of resources on Python/Perl differences. But I couldn't find a...
50
5726
by: diffuser78 | last post by:
I have just started to learn python. Some said that its slow. Can somebody pin point the issue. Thans
8
1978
by: . | last post by:
What is the fast way for a fast implementation of Python? -- JavaScript implementation of Python http://groups.google.it/group/JSython/
4
2339
by: wang frank | last post by:
Hi, While comparing the speed of octave and matlab, I decided to do a similar test for python and matlab. The result shows that python is slower than matlab by a factor of 5. It is not bad since octave is about 30 time slower than matlab. Here is the result in matlab: Elapsed time is 0.015389 seconds.
0
266
by: Kurt Mueller | last post by:
Am 08.10.2008 um 06:59 schrieb Hendrik van Rooyen: OK, this is gives an impression of SPEED. In your application the REAL-TIME requirements are isolated and implemented in the custom controller. And the HMI which has to be fast enough (SPEED, not HARD-REAL-TIME)
2
1943
by: mh | last post by:
I've got some python xmlrpc servers and clients. What's the best way to accelerate them? xmlrpclib.py attempts to import these modules: import _xmlrpclib import sgmlop from xml.parsers import expat and falls back to defining the SlowParser class.
0
8995
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9558
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9378
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9331
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6077
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2216
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.