wxPython Not Ready for Commercial Use

  • Thread starter Polerio Babao Jr.II
  • Start date
P

Polerio Babao Jr.II

Please correct me if im wrong. I have depended much on python and
wxpython gui apps. After a year of using python apps I was able to do
good application written entirely in python. One big problem came into
my attention. The printing support. Yes, there was reportlab. But what
if your client wanted to simulate the customized excel output and have
it converted to reportlab. you cannot do it 100%. There are so many
drawbacks which I do not like. I tried to use the xml file of excel
and modify it on the fly to answer that problem but still not a very
good solution.

I am targetting crystal report as my ideal reporting application. From
my experiences I was not able to print a very good output for
commercial application. If anyone can provide me a very good reporting
application that can be integrated within python I must say python can
be used for commercial gui app. If not then we are all correct, python
is good for training purposes but not for production yet. Please
excempt reportlab from your choices as I have used it already and was
not able to simulate excel like output, still you can do it, the very
difficult way. I am just dissapointed, now I am trying to learn c++/qt
to solve my gui and printing problem. Please correct me if I am wrong.
Thanks.
 
P

phansen

Polerio said:
Please correct me if im wrong. I have depended much on python and
wxpython gui apps. After a year of using python apps I was able to do
good application written entirely in python. One big problem came into
my attention. The printing support. Yes, there was reportlab. But what
if your client wanted to simulate the customized excel output and have
it converted to reportlab. you cannot do it 100%. There are so many
drawbacks which I do not like. I tried to use the xml file of excel
and modify it on the fly to answer that problem but still not a very
good solution.

I am targetting crystal report as my ideal reporting application.

Have you looked at any third-party products which support
an ActiveX interface? Surely there are such things and they
could easily be integrated with a wxPython app.
> If not then we are all correct, python
is good for training purposes but not for production yet.

Given the number of people actually using it for production use,
this ludicrous statement clearly must have been intended to
provoke a response, rather than to indicate a serious claim on
your part. Heck, if you used it for over a year and it's only
suitable for training, that's egg on your face, isn't it?

-Peter
 
I

Istvan Albert

Polerio said:
my attention. The printing support. Yes, there was reportlab. But what
if your client wanted to simulate the customized excel output and have
it converted to reportlab. you cannot do it 100%. There are so many

I think the ability to easily and precisely reproduce of output of
other software packages is hardly a measure of any language maturity.

Istvan.
 
J

Jeff Shannon

Polerio said:
Please correct me if im wrong.

I believe that you *are* wrong.
One big problem came into my attention. The printing support.

Printing in a reliable cross-platform way is a hard problem, which is (I
believe) why the support in wxWidgets/wxPython is not up to the same
level as its screen-display support. But there *are* (IMO) reasonable
solutions.
But what if your client wanted to simulate the customized excel output

Presuming that you're targetting Windows, there's a couple of solutions
here. Perhaps the simplest would be to use either pythonCOM or
pyXLWriter ( http://sourceforge.net/projects/pyxlwriter/ ) to get Excel
to handle the output for you. I suspect that either of these methods
would be simpler than writing Excel-xml.
I am targetting crystal report as my ideal reporting application.

Does Crystal Reports offer a COM automation API? If so, you could use
*it* directly (via pythonCOM).
... now I am trying to learn c++/qt to solve my gui and printing problem.

Seems to me that the effort involved here would be rather greater than
the effort involved in customizing your printing under wxPython. And
while I don't know what sort of built-in printing support (if any) QT
may have, I don't think that changing languages gains you anything. (At
worst, you can access the win32api printing calls directly from Python;
all that using c++ would gain you is a different selection of libraries,
which may or may not help very much.)

Jeff Shannon
Technician/Programmer
Credit International
 
A

Alex Martelli

Polerio Babao Jr.II said:
difficult way. I am just dissapointed, now I am trying to learn c++/qt
to solve my gui and printing problem. Please correct me if I am wrong.

What's C++ gotta do with it? If you want to use Qt (and are willing to
pay the fees for it, or else only release under GPL and not for
Windows), fine, it's actually what I prefer myself. But you can use
either C++ or Python indifferently with either framework,
wxWidgets/wxPython or Qt/PyQt. So you definitely _are_ wrong in
implying that language choice and choice of frameworks have anything
much to do with each other in this context.

If wxPython has problems they lie elsewhere... I was just trying to
install bittorrent on a Linux box tonight, and bittorrent requires
wxPython, so I _did_ just go through the very messy and lengthy build
process (./configure-make-sudo make install only does the wxWidgets
part, then you have to edit config.py before you run python setup.py to
build -- and the docs explaining this are quite lengthy)... only to find
in the end that bittorrent just doesn't like the current release of
wxPython, crashing loudly pretty soon. I guess incompatible changes
have been made, or programming errors, or something. Guess I should try
again with another, older, stable release of wxPython, but it's a bit
late to restart tonight.

However, Qt (for all that I _do_ like it) has just the same kind of
problem... you upgrade the library, your apps start breaking right and
left and center. Apparently, achieving stability and good backwards
compatibility in such huge frameworks is NOT a trivial problem,
particularly because users and would-be users are always clamoring for
more and more feechurs (and your peculiar whine which seems to equate
"lacks builtin ability to emulate Excel custom printing" to "is not
ready for commercial use" offers an entertaining example thereof).


Alex
 
C

Carlos Ribeiro

Well, for what I have read of your situation, it's not much different
in essence from mine, or from other people that are using Python for
business applications. There are some fellows around here who are not
entirely satisfied with the state of the art in this particular area.

Said that, let me point out where I disagree with you. (Please beware,
I'm going to enter ëvangelize-mode"). The problem is not with
wxPython, which is solid, mature, and very comprehensive. The problem
is not with the emulation of feature X or Y of some other well known
software. The problem, in my not-so-humble opinion, is the lack of a
solid framework to develop *business applications*, that tie all
things together under an abrangent and comprehensive umbrella. It
includes:

-- solid supporting libraries (abstract data types, networking, etc)
-- that's where Python excels;
-- GUI stuff (that's wxPython domain, Qt and Tk are also good options);
-- database support (beyond DBAPI 2.0; including GUI bindings, object
persistence);
-- report generation;
-- last, but not least: a set of guidelines and a basic app framework
that can be easily adapted for new projects. Those who ever programmed
with Delphi know what I am talking about here. As far as Python is
regarded, each and every project uses a different approach[1], making
code reutilization extremely hard.

I may have forgotten something on my list above, but you've got the
basic idea. On the good side, there are plenty of people working on
such tools. On the bad side, there is still no standard, and there's
possibly a long way ahead until some standard finally materializes.
--
[1] What did I mean with "a different approach"? non-standart
interfaces, lack of naming conventions, different ways to bind to or
handle external events, etc.The integration depends on more factors
than the basic class hierarchy -- the actual usage of the classes (how
they are instantiated, bound together, etc.) must be similar enough to
make integration possible. As it is now, it'is possible to have two
wxPython apps programmed in such a way that integration between them
difficult or even impossible, due to this factor.

--
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)
 
C

Cliff Wells

If wxPython has problems they lie elsewhere... I was just trying to
install bittorrent on a Linux box tonight, and bittorrent requires
wxPython, so I _did_ just go through the very messy and lengthy build
process (./configure-make-sudo make install only does the wxWidgets
part, then you have to edit config.py before you run python setup.py to
build -- and the docs explaining this are quite lengthy)... only to find
in the end that bittorrent just doesn't like the current release of
wxPython, crashing loudly pretty soon. I guess incompatible changes
have been made, or programming errors, or something. Guess I should try
again with another, older, stable release of wxPython, but it's a bit
late to restart tonight.

Most likely it requires wxPython 2.4.x. 2.5.x, while recommended, is
considered the development branch and there have been a few incompatible
changes made (although most of them can be easily worked around iirc.

Regards,
Cliff
 
C

Cliff Wells

Please correct me if im wrong. I have depended much on python and
wxpython gui apps. After a year of using python apps I was able to do
good application written entirely in python. One big problem came into
my attention. The printing support. Yes, there was reportlab. But what
if your client wanted to simulate the customized excel output and have
it converted to reportlab. you cannot do it 100%. There are so many
drawbacks which I do not like. I tried to use the xml file of excel
and modify it on the fly to answer that problem but still not a very
good solution.

I am targetting crystal report as my ideal reporting application. From
my experiences I was not able to print a very good output for
commercial application. If anyone can provide me a very good reporting
application that can be integrated within python I must say python can
be used for commercial gui app. If not then we are all correct, python
is good for training purposes but not for production yet. Please
excempt reportlab from your choices as I have used it already and was
not able to simulate excel like output, still you can do it, the very
difficult way. I am just dissapointed, now I am trying to learn c++/qt
to solve my gui and printing problem. Please correct me if I am wrong.
Thanks.

Ah, the old "make an inflammatory statement to goad someone into
answering my question" tactic.

When it comes to automating external applications (Crystal Reports,
Excel) on Windows, there's only a couple of ways to do it, and it has
nothing to do with programming language choice. COM is the answer and
Python has it. You can try C++ if you like, but what you'll find is
that you are going to run into exactly the same problem, only it will
take you twice as long to get there.

If you want "Excel-like" output, why not use COM to control Excel? It's
been several years, but I built an application (using Python, wxPython
and win32com) to do just that. If what you are looking for is someone
to show you how to do it, why not just pay someone to do it? Perhaps
it's the programmer, not the language, that isn't ready for
production ;)


Regards,
Cliff
 
A

Andrew Durdin

Presuming that you're targetting Windows, there's a couple of solutions
here. Perhaps the simplest would be to use either pythonCOM or
pyXLWriter ( http://sourceforge.net/projects/pyxlwriter/ ) to get Excel
to handle the output for you. I suspect that either of these methods
would be simpler than writing Excel-xml.

I was recently involved in a project which required producing excel
files programmatically (this was from VB *spew*). I started off using
COM, but it turned out to be unreasonably slow for filling in all the
cells that we needed to do; so instead we output an XML spreadsheet.
It was much faster, and simpler in the end.
 
P

Paul McNett

Andrew said:
I was recently involved in a project which required producing
excel files programmatically (this was from VB *spew*). I
started off using COM, but it turned out to be unreasonably
slow for filling in all the cells that we needed to do; so
instead we output an XML spreadsheet. It was much faster, and
simpler in the end.

I used COM to do an Excel spreadsheet once. It was pretty
complex and took an outrageous amount of processing time. And
then the client updated Excel and had to call me in because
something in the COM interface changed.

I wonder if your XML method has a better chance of surviving
Excel "upgrades". I will certainly try to avoid COM in the
future.
 
G

Gerrit Muller

Carlos Ribeiro wrote:
possibly a long way ahead until some standard finally materializes.
--
[1] What did I mean with "a different approach"? non-standart
interfaces, lack of naming conventions, different ways to bind to or
handle external events, etc.The integration depends on more factors
than the basic class hierarchy -- the actual usage of the classes (how
they are instantiated, bound together, etc.) must be similar enough to
make integration possible. As it is now, it'is possible to have two
wxPython apps programmed in such a way that integration between them
difficult or even impossible, due to this factor.
Actually you mean expensive in terms of effort. The mismatch between the
architectures of both applications causes a lot of adaptations and
integration effort. See: "From Legacy to State-of-the-art; Architectural
Refactoring." (especially page 7)
<http://www.extra.research.philips.com/natlab/sysarch/ArchitecturalRefactoringPaper.pdf>

If you want to build bigger systems with cooperating applications then
you will have to work also on the architecture of the total system: a
minimal set of rules and conventions to enable this integration. I do
fully agree that most designers underestimate the costs of integration.
Often the class hierarchy or similar "structure" rules are seen as the
architecture. However you need a set of other views to enable this
integration, among them the choice of integrating concepts, see page 10
of "Light Weight Architectures; The way of the future?"
<http://www.extra.research.philips.com/natlab/sysarch/LightWeightArchitectingPaper.pdf>

kind regards, Gerrit
 
F

Fritz Bosch

Paul McNett said:
I used COM to do an Excel spreadsheet once. It was pretty
complex and took an outrageous amount of processing time. And
then the client updated Excel and had to call me in because
something in the COM interface changed.

I wonder if your XML method has a better chance of surviving
Excel "upgrades". I will certainly try to avoid COM in the
future.

Each call of the COM interface is quite slow, but it seems to
be larglely independent of the amount of data transferred in
a call. So the solution seems to be to transfer large chunks
at a time instead of individual cells:

# get the content of an excel range as a list of lists
data = my_excel_range.Value
data = [list(row) for row in data]
# manipulate the data inside python
...
# transfer it back to excel in one go
my_excel_range.Value = data

It's quite easy to access the entire used range of a worksheet
in this way:

book = excelApp.Workbooks.Open(file_name)
sheet = book.Sheets[sheet_name]
my_excel_range = sheet.UsedRange


fritz
 
C

Carlos Ribeiro

Actually you mean expensive in terms of effort. The mismatch between the
architectures of both applications causes a lot of adaptations and
integration effort. See: "From Legacy to State-of-the-art; Architectural
Refactoring." (especially page 7)

Gerrit, thank you very much for your pointers. It's a slow learning
process, but it's becoming clear what I'm looking for. Sometimes it's
difficult to express exactly what I mean -- english is not my first
language, and also, because I left college a long time ago, so I'm not
up-to-date with the latest academic talk. But I try to keep myself
well informed, reading as much as I can about the topic. I'm *very*
interested in the subject of architecture of systems. For a long time,
most studies that I could find were focused on *systems engineering*,
and I had always wondered why some stuff didn't "click" in quite right
to me. I think that I'm more of an architect than an engineer, in a
way. It's nice to find more about it.
--
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)
 
B

Bill Wilkinson

I am targetting crystal report as my ideal reporting application. From
my experiences I was not able to print a very good output for
commercial application. If anyone can provide me a very good reporting
application that can be integrated within python I must say python can
be used for commercial gui app. If not then we are all correct, python
is good for training purposes but not for production yet. Please
excempt reportlab from your choices as I have used it already and was
not able to simulate excel like output, still you can do it, the very
difficult way. I am just dissapointed, now I am trying to learn c++/qt
to solve my gui and printing problem. Please correct me if I am wrong.
Thanks.

I use Jython with the POI libraries for publishing to Excel.
http://jakarta.apache.org/poi/

There is a Java version of Crystal Reports now. You can also use
Jasper Reports: http://jasperreports.sourceforge.net . Both of these
can be used nicely from Jython.
 
B

Baalbek

Bill said:
I use Jython with the POI libraries for publishing to Excel.
http://jakarta.apache.org/poi/

The Jython/POI combination is indeed my favourite way of dealing with
Excel, BUT somehow reading Excel files 500KB and larger takes an
incredible amount of time (f.ex reading a document about 600Kb makes me
sit and wait for several minutes).

Any idea why the POI takes such a long time to read relatively small
Excel files (it's not Jython's fault, I tested the POI classes in Ant,
and same thing there).

Baalbek
 
B

Bill Wilkinson

Baalbek said:
The Jython/POI combination is indeed my favourite way of dealing with
Excel, BUT somehow reading Excel files 500KB and larger takes an
incredible amount of time (f.ex reading a document about 600Kb makes me
sit and wait for several minutes).

Any idea why the POI takes such a long time to read relatively small
Excel files (it's not Jython's fault, I tested the POI classes in Ant,
and same thing there).

Baalbek

hmmm, yes, it can be slow like that. I don't know the reasons. But
there is competition, Java Excel API. Which is also a hoot from
Jython.
http://www.andykhan.com/jexcelapi/
It is supposedly faster.

Bill
 

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
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top