Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Join Python script into a huge one

13 views
Skip to first unread message

Ugo García

unread,
May 9, 2002, 5:57:08 PM5/9/02
to
hi all. I use python as the script language of a game I'm doing in Visual C.
The problem that I have is that the game could have very much scripts and I
don't want the user to "see" those. I know that I can compile them and don't
include the source but I still having the problem of the number of files. Is
there any way to join ALL scripts into a huge one???? It could be great to
have all the scripts in only one file.

Thanks in advance
--ugo


Michael Gilfix

unread,
May 9, 2002, 6:26:05 PM5/9/02
to
You could distribute the .pyc files. I think they're portable but
I'm not sure (someone can confirm or deny that). Then they can only
look at your doc strings. I'm not sure why you need to join all the
scripts into one huge one though... just use distutils and install it
or add the appropriate directory to your PYTHONPATH.

-- Mike

> --
> http://mail.python.org/mailman/listinfo/python-list
`-> (plugin)

--
Michael Gilfix
mgi...@eecs.tufts.edu

For my gpg public key:
http://www.eecs.tufts.edu/~mgilfix/contact.html


Chris Liechti

unread,
May 9, 2002, 8:46:47 PM5/9/02
to
"Ugo García" <plu...@supercable.es> wrote in
news:1020981481.93253@seux119:

if you wan't to keep the number of files but not make them visible,
consider packing them up in a ZIP file and then use the zipfile module and
a custom import hook.
variants of this technique are used in py2exe and Installer.
this could also help:http://www.mcmillan-inc.com/iu.html

other possibilities could be packing them in string resources and feed them
throug PyRun_SimpleString or use freeze to convert them to char arrays of
bytecode. but i'm in favor of keeping them in a zip as this is the easiest
to change/upgrade when you change one of your scripts.

chris

--
Chris <clie...@gmx.net>

A. Keyton Weissinger

unread,
May 9, 2002, 10:53:46 PM5/9/02
to
Hi Folks,

I am beginning work on what will likely turn into a fairly large GUI-based
application and would like your thoughts on which library to use:

A) Tk Only
B) Tk with Python Mega-widgets or similar (i.e. Tk with some other stuff)
C) Qt (BlackAdder just announced the incorporation of Qt3 into BA)
D) wxPython

I want to get the best combination of easiest to install most feature rich
and do not have enough experience with the non-Tk libraries.

Thank you!!!!

Keyton

Skip Montanaro

unread,
May 9, 2002, 11:43:43 PM5/9/02
to

Keyton> I am beginning work on what will likely turn into a fairly large
Keyton> GUI-based application and would like your thoughts on which
Keyton> library to use:

Keyton> A) Tk Only
Keyton> B) Tk with Python Mega-widgets or similar (i.e. Tk with some other stuff)
Keyton> C) Qt (BlackAdder just announced the incorporation of Qt3 into BA)
Keyton> D) wxPython

Don't forget PyGtk (with or without Glade):

http://www.daa.com.au/~james/pygtk/

Grab it here:

http://www.gnome.org/~james/

Go directly to PyGtk 1.99.x and Gtk+ 2.0.

--
Skip Montanaro (sk...@pobox.com - http://www.mojam.com/)
"Excellant Written and Communications Skills [required]" - post to chi.jobs


Alex Martelli

unread,
May 10, 2002, 2:21:22 AM5/10/02
to
A. Keyton Weissinger wrote:

IMHO, unless you have problems with the licenses or funding issues, Qt
is a good choice. It's not simplest, but extremely feature-rich and
well documented when you considered both Rempt's book AND the ease of
using Trolltech's large manuals (things translate from Qt to PyQt quite
plainly). BlackAdder makes it easy to install as it comes with all you
need (or will once it does support Qt3), although in fact on my Linux
box I decided to install from sources anyway (my personal preference:
software that's mission-critical for me I install from sources -- Python,
VIM, now Qt, and a very few other pieces).

Tkinter is OK, but nowhere as feature-rich as Qt -- not as fast, not
as neatly native-looking. wxPython was OK when I last tried it, but
that was quite a while ago -- I'm not qualified to have an opinion on
how it is right now.


A;ex

Michael Gilfix

unread,
May 10, 2002, 6:48:52 AM5/10/02
to
Since this has already been answered for the most part, I just want
to add that if you're considered development on windows, or want portability
across *nix and windows, then wxPython might be your best choice. It's
very cross platform. pyGTK unfortunately isn't at the moment.

-- Mike

On Thu, May 09 @ 22:53, A. Keyton Weissinger wrote:
> Hi Folks,
>
> I am beginning work on what will likely turn into a fairly large GUI-based
> application and would like your thoughts on which library to use:
>
> A) Tk Only
> B) Tk with Python Mega-widgets or similar (i.e. Tk with some other stuff)
> C) Qt (BlackAdder just announced the incorporation of Qt3 into BA)
> D) wxPython
>
> I want to get the best combination of easiest to install most feature rich
> and do not have enough experience with the non-Tk libraries.
>

> Thank you!!!!
>
> Keyton
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
`-> (lists)

Uwe Schmitt

unread,
May 10, 2002, 8:39:15 AM5/10/02
to
A. Keyton Weissinger <li...@weissinger.org> wrote:

| D) wxPython

Hi, I use wxPython, because it's look and feel is quite near
to the Win look and feel, which has the effect that software
using wxPython is well accepted by "low-level"-users...
I had a look at Qt and looks quite interesting.

Greetings, Uwe

--
Dr. rer. nat. Uwe Schmitt ICQ# 159647634 Uwe.S...@num.uni-sb.de
Universitaet des Saarlandes Angewandte Mathematik
Building 36.1 Room 4.17 PO-Box 151150 D-66041 Saarbruecken
Mobile:0177/6806587 Fax:+49(0)681/302-4435 Office:+49(0)681/302-2468

Ron Stephens

unread,
May 10, 2002, 10:14:28 AM5/10/02
to
This, to me, is the $64M question. In my case, learning GUI
programming is the real issue. I can do everything I want to do on the
command line with Python, which is really cool, but I still have a
long way to go on GUI's.

Please note the release of a new PythonCard beta version just below
this thread on the newsgroup. I think it has great potential; but for
a newbie with no time on my hands, I find installing it on Linux and
learning it to be not easy.

I really think PyQt and BlackAdder can do what I want, but due to
extensive business travel the last few months (and the next few) I
just have not had the time to really sit down and study the Rempt book
as much as I need.

I have learned one thing; there is no royal road to learning GUI
programming.

I am going to have to do the hard work. It's that simple.

Good luck to you.

By the way, yet another option is using Jython and the Java GUI tools.
And there was an article in one of the Linux magazines a year ago that
extolled the virtues of PyGTK and Glade, and it sounded like an easy
to learn option, relatively speaking.

So many choices.

Personnally, right at this moment, my desire is to somehow create good
GUI versions of some Python scripts of mine, specifically for
deployemnt on the new Linux based Sharp Zaurus.

The plethora of options is overwhelming (which is good, but I find
myself scattering my thoughts ;-)))

My Python scripts run perfectly well from the bash shell command line
on the Zaurus.

The Zaurus is based on the Trolltech QT toolkit. So, optimally, I
should probably learn PyQt and deploy as native QT apps on the Zaurus.
But I don't know how well or how easily the PyQt apps would port to
the Zaurus.

The Zaurus also runs Jeode, a JVM. I have converted some of my scripts
to Jython and then compiled them using jythonc. I am considering how
hard it would be to use the available java compilers for the arm
microprocessor so that they can be automatically installed on the
Zaurus as Jeode apps (using ipkg type installers for the arm systems).
But I would probably stil need to create gui's using jython and awt.

Someday, someone may even port one or more of the Python gui toolkits
to the Zaurus (many libraries for Python for the Zaurus are available
at Riverbank at
http://www.riverbankcomputing.co.uk/zaurus/index.php but not Tkinter
or wxPython etc.

I suspect that I will need to be satisfied for now with my command
line Python scripts on the Zaurus (which I find pretty cool all by
itself ;-))), but that for real slick GUI versions my best bet is to
really learn BlackAdder and PytQt programming starting with the Rempt
book; but I am always intrigued with "shortcuts" and thus I am still
"eyeing" the jythonc, compiled java option, although what will it gain
me if I find learning AWT to be as hard as learning QT???

Any comments would be welcome as always ;-))))

(But isn't it really gratifying that even a newbie hobbyist ike me can
use Python to get as far as I am already, to run my own Python scripts
on the Zaurus? But if I could create a good gui, others might find my
scripts to be fun and usefull ....??? >>>

Ron Stephens
http://www.awaretek.com
Python scripts and news

holger krekel

unread,
May 10, 2002, 10:37:06 AM5/10/02
to
Ron Stephens wrote:
> Personnally, right at this moment, my desire is to somehow create good
> GUI versions of some Python scripts of mine, specifically for
> deployemnt on the new Linux based Sharp Zaurus.

you might want to take a look at

http://david.boddie.org.uk/Projects/Python/CMDSyntax

which has very clean,powerful cmdline-synxtax parsing
and pops up a GUI for missing parameters. It's very
well documented.



> The plethora of options is overwhelming (which is good, but I find
> myself scattering my thoughts ;-)))

Just to add another choice :-)

holger


Boudewijn Rempt

unread,
May 10, 2002, 11:35:36 AM5/10/02
to
Ron Stephens wrote:

> I have learned one thing; there is no royal road to learning GUI
> programming.
>

Wise words! Ultimately, no matter how many dialog windows you
can paint and generate, there will be a day when you have to code
parts of GUI by hand.

>
> I suspect that I will need to be satisfied for now with my command
> line Python scripts on the Zaurus (which I find pretty cool all by
> itself ;-))), but that for real slick GUI versions my best bet is to
> really learn BlackAdder and PytQt programming starting with the Rempt
> book; but I am always intrigued with "shortcuts" and thus I am still
> "eyeing" the jythonc, compiled java option, although what will it gain
> me if I find learning AWT to be as hard as learning QT???
>

Harder, if my experience is any guide. AWT (and Swing, too) really
hurt my head whenever I have to look at them :-) What is it that makes
Qt hard to learn for you?

> (But isn't it really gratifying that even a newbie hobbyist ike me can
> use Python to get as far as I am already, to run my own Python scripts
> on the Zaurus? But if I could create a good gui, others might find my
> scripts to be fun and usefull ....??? >>>

Absolutely.


--
Boudewijn Rempt | http://www.valdyas.org

Boudewijn Rempt

unread,
May 10, 2002, 11:36:14 AM5/10/02
to
Ron Stephens wrote:

> The Zaurus is based on the Trolltech QT toolkit. So, optimally, I
> should probably learn PyQt and deploy as native QT apps on the Zaurus.
> But I don't know how well or how easily the PyQt apps would port to
> the Zaurus.
>

You shouldn't have _any_ problems at all.

William Dode

unread,
May 10, 2002, 12:01:44 PM5/10/02
to
Le Thu, 9 May 2002 22:53:46 -0400
"A. Keyton Weissinger" <li...@weissinger.org> écrivait:

I use wxPython with lot of satisfactions, very easy to learn and the
mailing-list help you very quickly.

Qt is not gpl licence for windows...

bye

>
> Thank you!!!!
>
> Keyton
>
>
>


--
William Dodé - Informaticien Indépendant
http://www.flibuste.net

François Pinard

unread,
May 10, 2002, 2:57:47 PM5/10/02
to
[Alex Martelli]

> IMHO, unless you have problems with the licenses or funding issues,

> Qt is a good choice. [...] Tkinter is OK [...] wxPython was OK [...]

No opinion on `pygtk'? :-)

--
François Pinard http://www.iro.umontreal.ca/~pinard

Alex Martelli

unread,
May 10, 2002, 4:15:32 PM5/10/02
to
On Friday 10 May 2002 20:57, François Pinard wrote:
> [Alex Martelli]

>
> > IMHO, unless you have problems with the licenses or funding issues,
> > Qt is a good choice. [...] Tkinter is OK [...] wxPython was OK [...]
>
> No opinion on `pygtk'? :-)

Never used it, so, no experience, and no interest in remedying that
in the foreseeable future.


Alex


David LeBlanc

unread,
May 10, 2002, 4:40:49 PM5/10/02
to
Has anyone mentioned FLTK or Fox as Python GUI's of interest?

David LeBlanc
Seattle, WA USA

> --
> http://mail.python.org/mailman/listinfo/python-list

Bob X

unread,
May 10, 2002, 5:24:05 PM5/10/02
to

Far as I know Fox is no longer being maintained...

Did someone pick that up and start developing it again?

Bob

Robert George Mayer

unread,
May 10, 2002, 5:26:27 PM5/10/02
to
"A. Keyton Weissinger" wrote:
>
> Hi Folks,
>
> I am beginning work on what will likely turn into a fairly large GUI-based
> application and would like your thoughts on which library to use:
>
> A) Tk Only
> B) Tk with Python Mega-widgets or similar (i.e. Tk with some other stuff)
> C) Qt (BlackAdder just announced the incorporation of Qt3 into BA)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> D) wxPython
>
> I want to get the best combination of easiest to install most feature rich
> and do not have enough experience with the non-Tk libraries.
>
> Thank you!!!!
>
> Keyton

Keyton -

Would you please say where you heard about Qt3 in BlackAdder? The
news on BlackAdder has been nonexistent for some time.

- BOB

Gustavo Cordova

unread,
May 10, 2002, 5:55:24 PM5/10/02
to
A question:

Is designing and making a GUI toolkit a'la Tk,
with only the most basic stuff written in C
(native GUI interface, speed stuff, etc) and
the rest written in Python, doable?

I can't help thinking that building something
like that would be very interesting.

Opinions?

Would it be worth the effort?

-gus


David LeBlanc

unread,
May 10, 2002, 6:02:10 PM5/10/02
to
From http://www.fox-toolkit.org/news.html:

April 5, 2002 - New drop: FOX 1.1.8

That's pretty new :)

David LeBlanc
Seattle, WA USA

> Far as I know Fox is no longer being maintained...

Gustavo Cordova

unread,
May 10, 2002, 5:51:19 PM5/10/02
to

Actually, what's not being maintained are the Python bindings
for fox: pyfx??? Something like that.

As for fox, it's getting better and better. Has a wierd look,
but being portable everywhere is cool.

-gus


Chris Liechti

unread,
May 10, 2002, 6:41:41 PM5/10/02
to
Gustavo Cordova <gcor...@hebmex.com> wrote in
news:mailman.1021068439...@python.org:

> A question:
>
> Is designing and making a GUI toolkit a'la Tk,
> with only the most basic stuff written in C
> (native GUI interface, speed stuff, etc) and
> the rest written in Python, doable?

so somthing like Java's SWING. the only thing you
need is an area and some drawing functions. i'm sure
it's doable, but...
- you need many widgets, buttons, labels, lists, trees.
e.g. drawing a foldable tree is some work.

- speed. SWING is rich on components but i never seen one
program that not made the impression of beeing slow :-(

- userbase. just another toolkit? who's gonna use it.
you'll need supporters and developers to take off ground.

- layouters. placing widgets by coordinate is painful there
needs to be some automatic layout mechanism. so you need
to calculate sizes of fonts, labels, etc. again some work

- you need a good look and feel. best it looks native on
each platform it runs...

- event system you have to distribute inputs and update
messgaes

> I can't help thinking that building something
> like that would be very interesting.

ineresting of course. but a lot of work to achieve a usable
level.

> Opinions?

i wanted such a GUI kit... i've once played around with VNC
(http://www.uk.research.att.com/vnc/) in java (SWING). i made a panel that
is accessible by a remote computer as well as local with the mouse etc. i
wanted to do the same thing in python but it doesn't seem to be that easy
with the toolkits i know.



> Would it be worth the effort?

i fear not. but still, if you want to gain experience and have some time to
spend you can learn much about software design, OO, ...

chris


--
Chris <clie...@gmx.net>

David LeBlanc

unread,
May 10, 2002, 6:56:31 PM5/10/02
to
fxPy last updated 4/1/2002

David LeBlanc
Seattle, WA USA

> --
> http://mail.python.org/mailman/listinfo/python-list


Alexander Jerusalem

unread,
May 10, 2002, 11:07:57 PM5/10/02
to
I recently downloaded wxPython and played around with it a bit. It
worked immediately and it has an incredible wealth of widgets, low
memory footprint and it's fast. It works on windows and unix. A mac
version is being worked on.

Regards

"A. Keyton Weissinger" <li...@weissinger.org> wrote in message news:<mailman.102099925...@python.org>...

Alex Martelli

unread,
May 11, 2002, 2:05:20 AM5/11/02
to
Robert George Mayer wrote:
...

> Would you please say where you heard about Qt3 in BlackAdder? The
> news on BlackAdder has been nonexistent for some time.

It was announced on the BA mailing list, where news about BlackAdder
are anything but "nonexistent". I think you can join the list from the
appropriate pages on theKompany's website.


Alex

Alex Martelli

unread,
May 11, 2002, 2:57:20 AM5/11/02
to
Gustavo Cordova wrote:

> Is designing and making a GUI toolkit a'la Tk,
> with only the most basic stuff written in C
> (native GUI interface, speed stuff, etc) and
> the rest written in Python, doable?

Yes. Sam Rushing went some way towards
doing it on top of the raw Win32 API's, as one
of the developments of calldll, if I recall correctly.

> I can't help thinking that building something
> like that would be very interesting.

It would no doubt teach you a lot to build it.

> Would it be worth the effort?

I doubt anybody would _use_ it (Python has too
many GUI kits, not too few), but that need not
mean it's not worth to learn by building it anyway.


Alex

F. GEIGER

unread,
May 10, 2002, 12:55:32 PM5/10/02
to
I use wxPython, because it's rather feature rich and easy to use. I tried
PyQT too. I found its slot mechanism very appealing. As debugging of
PyQt-Apps wasn't directly supported by a former version of WingIDE (don't
know if 1.1.3 again supports it) I switched back to wxPython.

BTW anygui supports this slot mechanism too. anygui is very promising in any
regard as the backend becomes a minor issue there. As soon as anygui is in a
less early stage I'll stick with anygui.

Cheers
Franz

"A. Keyton Weissinger" <li...@weissinger.org> schrieb im Newsbeitrag
news:mailman.102099925...@python.org...

William Dode

unread,
May 12, 2002, 4:12:14 AM5/12/02
to
Hi,

After reading this thread i was going to try fxPy (i'm using wxPython
now). And it seems to be very interesting, just very rarely used and seems
to depends on only one developper (17 developers for wxwindows, 4 admins,
like i read on sourceforge)

fox doesn't depend on any lybrary (wxPython depends on gtk), and is fast
and light.

It seems to have a table control, even if it's not use in the fxpy demo.

Somebody can write something more on the difference between theses two gui
?

bye

Le Fri, 10 May 2002 15:56:31 -0700
"David LeBlanc" <whi...@oz.net> écrivait:

J. Random Hacker

unread,
May 13, 2002, 1:03:15 AM5/13/02
to

Dont forget FXPy.
No one else mentioned it, I wonder why.
FXPy is based on the FOX GUI toolkit which is very nice and lightweight.
The FOX library is of an extremely beautiful design.
I like wxPython, but then again, I don't. wxPython and wxWindows are very
much like MFC, which IMHO is not a good thing unless you're porting an
application from MFC. I don't hate MFC because its Microsoft but simply
because its a shitty design and the only reason to copy it is to give MFC
programs an easy and free port path. The Docview architecture was
originally introduced in the early 90s, many years after the literature
had covered how to do MVC (model-view-controller) correctly, and I don't
thinks its any better.
This is just one example, but I don't think something
being structured like MFC is a good thing.
On the other hand, wxPython has lots of features and its mature. In
addition its quite popular. I think that wxPython is light years ahead of
Tkinter too. Also, the fact that wxPython uses a "native" toolkit for
each port is a nice thing, some people don't like the FOX widgets.

You really can't go wrong with either. You can produce a program that
works with either one which is what really matters.

David Boddie

unread,
May 13, 2002, 10:32:19 AM5/13/02
to
holger krekel <py...@devel.trillke.net> wrote in message news:<mailman.1021041498...@python.org>...
> Ron Stephens wrote:

> > Personnally, right at this moment, my desire is to somehow create good
> > GUI versions of some Python scripts of mine, specifically for
> > deployemnt on the new Linux based Sharp Zaurus.
>
> you might want to take a look at
>
> http://david.boddie.org.uk/Projects/Python/CMDSyntax
>
> which has very clean,powerful cmdline-synxtax parsing
> and pops up a GUI for missing parameters. It's very
> well documented.

Thanks for the mention! I've updated the page a little and I'll try
to produce more documented examples in the future.

The library is most suitable for scripts which only need user input when
they start, and which work without (much) user intervention afterwards.

David

J.Jacob

unread,
May 13, 2002, 11:33:48 AM5/13/02
to
> [Ron Stephens]

> ... but I am always intrigued with "shortcuts" and thus I am still


> "eyeing" the jythonc, compiled java option, although what will it gain
> me if I find learning AWT to be as hard as learning QT???
>
> Any comments would be welcome as always ;-))))
>

Be -very- happy with all the choices Python offers you. Even the
Tkinter that comes with most python distributions and needs no extra
installs works fine for any GUI I ever made. That is with the
exception of 3D graphics stuff or fast realtime 2D things, but then
you'd better code in C anyway.
About AWT: I used to be some kind of a walking AWT encyclopedia at my
university and I can tell you it is my opinion the AWT design
absolutely -stinks- ! Do you know that Sun even admitted that version
1.0 was bad and had it all redesigned? Well...I think their current
version hardly any better. And Swing has some unbelievably clumsy
designs. There are so many weird design decisions (and errors!) in
the Java class libraries that I quit Java and switched to Python.
:--))

0 new messages