PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread aum
Hi all,

I've been doing a fair bit of python gui programming on and off, jumping
between different widget sets along the way, from anygui, to pythoncard,
to tkinter/PMW, then to wxPython/wxGlade, and have now settled on a python
gui API that seems to get barely a mention - PyFLTK.

PyFLTK (http://pyfltk.sourceforge.net) is a SWIG-generated Python
wrapper around the multiplatform FLTK widget set ('Fast Light Tool Kit'
- http://fltk.sourceforge.net). In recent months, this wrapper has
stabilised to the point where it's fit for production projects.

A recent development that's given PyFLTK even more power is the
companion utility program, 'flconvert', which takes gui layout files
(created with the FLTK 'fluid' gui designer program) and turns them into
importable Python modules that Simply Just Work.

Every widget set has its place, and I feel this applies in no small part
to PyFLTK.

To me, wxPython is like a 12-cylinder Hummer, with fuzzy dice hanging
from the mirror, fridge and microwave in the back, and DVD consoles on
every seat, towing a campervan - absolute power and luxury, giving 8mpg
if you're lucky.

wxPython has the cost of a massive disk and memory footprint. A 'hello,
world' turned into a windoze exe with py2exe weighs in at around 15MB,
and takes 6-10 seconds to load up on a 2GHz Athlon box, about as long as
Photoshop! For large and intricate apps, wxPython is a logical choice,
but for smaller progs it's serious overkill IMHO.

Whereas PyFLTK feels more like an average suburban 4-door sedan giving
70mpg, nothing too flash, but easy to drive, easy to park and generally
comfortable, and easy to look after. The widget set is pretty simple,
but covers all the basics and includes good rich-text features in
listboxes, as well as an html viewer that supports html2.0 and parts of
html3.0.

Some of the things I'm liking about PyFLTK include:
 - way less code to get things done
 - some nice automagic, for instance in setting up tiling (similar to
   wx's splitter windows)
 - an absolute minimum of 'voodoo programming' (which was a constant
   bugbear for me with tkinter)
 - apps compile small, and start up fast
 - a really good designer program - fltk's 'fluid' program is light
   years ahead of wxglade imho

Also, FLTK's intuitive, semantically clear API makes it really
approachable for newcomers. One can write a 'hello, world' in 5 lines:

  import fltk
  label = "something here" # to stop string being gc'ed
  w = fltk.Fl_Window(100, 100, 300, 200, label)
  w.show()
  fltk.Fl.run()

So I hope this humble message might inspire some folks to have a serious
look at pyfltk. For many situations, PyFLTK can take you to break-even
point quickly, and deliver net savings in time and effort after that.

-- 
Cheers
David

-- 
Cheers
David

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


Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread aum
On Sun, 06 Nov 2005 16:31:54 -0800, Paul Rubin wrote:

> aum <[EMAIL PROTECTED]> writes:
>> To me, wxPython is like a 12-cylinder Hummer, ...
>> Whereas PyFLTK feels more like an average suburban 4-door sedan
> 
> Interesting.  What would Tkinter be at that car dealership?  What
> about PyGTK?

Tkinter - would be like an old Holden with abundant interchangeable parts,
but needing a cultivated intuitive feel and much tinkering to get the
engine and everything else to work just right. Needing to pull over and
change a few jumpers on the PC board of the radio to get it on the right
channel. 

PyGTK - no experience there

Pythoncard - a 50cc motorbike with training wheels

-- 
Cheers
David

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


Re: how to present Python's OO feature in design?

2005-11-06 Thread aum
On Sun, 06 Nov 2005 19:06:49 -0800, pcmanlin wrote:

> As I know java has many UML tools to design for its OO feature, is
> there any tools or good concept for Python project Modeling?

Just code the bloody thing!

One of Python's strengths is its rapid design/programming/testing
turnaround. And virtually none of Java's mind-gnashing red tape.

-- 
Cheers
David

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


Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread aum
On Sun, 06 Nov 2005 21:23:03 -0800, Roger Binns wrote:

>> To me, wxPython is like a 12-cylinder Hummer, with fuzzy dice hanging
>> from the mirror, fridge and microwave in the back, and DVD consoles on
>> every seat, towing a campervan - absolute power and luxury, giving 8mpg
>> if you're lucky.
> 
> A word of support for wxPython:

Most right you are, Roger. wx is a 5-star GUI library.
When advanced GUI features are needed, wx, gtk2 or qt are definitely the
way to go.

What I'm saying is that there are many basic projects being written for
these toolkits, whose functionality could be completely supported by
PyFLTK. When only a smaller set of widgets is needed, there's a stronger
case for using lighter widget libraries - especially FLTK, because you'll
get way more functionality per line of code, and finish your project
faster, than if using the bigger toolkits with their application-level red
tape - the extra lines of code you have to write to get things done.

If travelling off-road for a few weeks and driving over minefields in
enemy territory, take the Hummer. But for ordinary use, like commuting to
work, visiting friends, shopping etc, using anything more than the Honda
4-cylinder sedan is IMHO a waste of resources.

Similarly, coding something in wx when FLTK will suffice is a waste of
time, effort, disk space, CPU cycles and memory.

-- 
Cheers
aum

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


Re: PyFLTK - an underrated gem for GUI projects

2005-11-07 Thread aum
On Mon, 07 Nov 2005 12:25:49 +0100, egbert wrote:

> PyFLTK is not a debian package - yet. 
> Is nobody interested, or is there a more specific reason ?

AFAIK, the maintainer feels it's still at release-candidate stage.
When he's happy with it, I'm sure he could be persuaded to make
arrangements to .deb it, or get someone else to.

In the meantime, it does build ok on Debian, provided you build/install
libfltk from source, and set the FLTK_HOME env var to point into it before
running the pyfltk setup.py, as per the instructions in pyfltk tarball.

-- 
Cheers
David

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


Re: PyFLTK - an underrated gem for GUI projects

2005-11-07 Thread aum
On Mon, 07 Nov 2005 09:10:32 -0200, Jorge Godoy wrote:

> Installing things mean, usually:
8><

Distilling what you've said, it would appear the essence of your argument
is "PyFLTK is less desirable because it's not popular", an argument
which, despite a level of pragmatic truth, does contain more than a little
bit of recursion.

Fortunately this thinking wasn't too widespread in the early days of wx
and wxPython.

I do respect wxPython. It's definitely a high-class gui environment.

But for smaller gui programs not needing the power of wx, I find I get
the job done much more quickly and effortlessly with PyFLTK.

-- 
Cheers
David


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


ANN: C++ support for Pyrex

2005-11-07 Thread aum
Hi,

Many Pyrex users are grateful for the ability to seamlessly integrate
Python and C code without the menial tedium of hand-coding extensions in
pure C.

However, Pyrex has a frustrating lack of C++ support, something its
esteemed author doesn't yet have the time to fix.

As an interim solution, I've just released a first cut of 'pyrexembed', a
system that lets you embed C++ code directly into your Pyrex sources.

More info, download etc at http://www.freenet.org.nz/python/pyrexembed

-- 
Cheers
Aum


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


R.I.P. Vaults of Parnassus?

2005-11-07 Thread aum
Hi,

The Vaults of Parnassus site:
http://www.vex.net/parnassus/
has been down for several days, with no resolution available for the
vex.net domain.

That site was a treasure-trove of Python resources, with a decent search
engine.

Does anyone know if it'll be coming back up, or if it's mirrored anywhere?

Can anyone recommend any other good warehouses of Python goodies?

-- 
Cheers
aum

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


ANN: askmgr

2005-11-12 Thread aum
Hi all,

I've just released a gui-based management utility for Active Spam Killer
(ASK) installations.

ASKmgr gives a quick and convenient way to manage one's ASK installation,
including whitelists, ignorelists, blacklists, message queue and message
log.

(Fqr those not familiar, ASK is a powerful anti-spam system that works on
whitelists, blacklists and a challenge-response system. It leaves
Bayesian-based spamfilters in the dust, and has reduced my spam inflow
from 4k+/week to 15/week.

Posted on-topic here because both ASK and ASKmgr are written in
Python.

http://www.freenet.org.nz/askmgr2

-- 
Cheers
aum


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


Re: Want to perform unattended installation of SW using python

2005-11-13 Thread aum
On Sun, 13 Nov 2005 02:57:04 -0800, 28tommy wrote:

> Hi,
> 
> I'm trying to automate an installation of some SW that is installed on
> Windows (you know - 'Start' ==> 'Next' ==> 'Next' ==> 'Finish' kind of
> installation). Is ther any way to perform that using python?

Quick answer is yes, very much so. What /can't/ you do in python? :)

I presume that by 'start -> next -> next' you're referring to
'installation wizards'. You can write those in python, using any of the
available GUI programming libraries, such as Tkinter, wxPython, PyFLTK,
FoxPY, PyQt or whatever appeals. PyFLTK and wxPython have Wizard widgets
built in, and quite likely PyQt does as well.

-- 
Cheers
aum


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


q: console widgets for *nix and windows?

2005-11-14 Thread aum
Hi,

Can anyone please recommend a widget library for text console, that works
not only on *nix systems but windows /as well/?

I'm looking for something a bit higher-level than pure curses, preferably
with a gui-like set of widgets, event loop, handler methods etc.

Thanks in advance for your recommendations.

-- 
Cheers
aum


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


Re: q: console widgets for *nix and windows?

2005-11-15 Thread aum
On Mon, 14 Nov 2005 20:56:36 +, Grant Edwards wrote:

>> Can anyone please recommend a widget library for text console,
>> that works not only on *nix systems but windows /as well/?
>> I'm looking for something a bit higher-level than pure curses,
>> preferably with a gui-like set of widgets, event loop, handler
>> methods etc.
> 
> http://tvision.sourceforge.net/

Thanks - but the python wrapper (pytvision.sf.net) is pretty broken,
particularly the windows build.

Any other suggestions?

Looking for:
 - builds ok under gcc on linux and mingw on win32
 - has python wrapper available that builds with the same tools
 - works
 - can use the win32 cmd.exe console

I've tried urwid over wvision, but still no luck.

My main need is to create a user interface compatible with blind users'
screen reader programs - for both linux and win32.

-- 
Cheers
aum


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


ANN: pygene - genetic algorithms package

2005-12-05 Thread aum
Hi all,

I looked at a few genetic algorithms/genetic programming packages for
Python, and found them somewhat convoluted, complicated and
counter-intuitive to use.

So I've written a genetic algorithms package which I hope will be more
approachable to beginners.

The first release of pygene is up at:
http://www.freenet.org.nz/python/pygene

The package includes full api documentation, and an implementation of
the travelling salesman problem, plus a couple of simpler cases.

-- 

Cheers
aum


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


Re: ANN: pygene - genetic algorithms package

2005-12-06 Thread aum
On Mon, 05 Dec 2005 23:45:30 -0800, Erik Max Francis wrote:

> I only scanned through the API documentation, but it looks like only 
> genetic algorithms are supported, not full genetic programming.

Correct. Organisms of a species have a fixed genome.

> I've been planning on releasing my stack-based genetic programming 
> system Psi (implemented in Python) at some point in the future, FYI.

Has it got an approachable API? Good doco? Examples understandable by
newbies? Hope so. There's a lot of good software that gets ruined because
insufficient work has been put in to its usability and comprehensibility.

-- 

Cheers
aum


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


Re: ANN: pygene - genetic algorithms package

2005-12-07 Thread aum
On Tue, 06 Dec 2005 22:44:39 -0800, Erik Max Francis wrote:

> Peter Hansen wrote:
> 
>> Okay, good, I already knew all that then, except perhaps that key word 
>> "fixed".

One thing I should say here is that pygene is a collection of
inter-related classes for populations, organisms, gametes and genes.

Users are encouraged to subclass off these to address the
problems they're trying to solve.

For instance, the BaseGene class is completely agnostic about the actual
data contained in the gene. Any BaseGene subclass only has to implement
the methods:
 - __add__ - produce phenotype effect of combining a given gene pair
 - mutate - apply a random mutation to the gene
 - randomValue - set the gene's value to a legal random value

As for the gene's value - as long as the above 3 methods are supplied in a
subclass, the gene can hold any object - just as long as one's Organism
subclass' '.fitness()' method can understand what the gene class'
'.__add__()' method returns.

A Gene subclass could even hold an AST for a program to be generated.

It wasn't my original intention to support genetic programming, but in
theory at least, pygene could be extended into a GP system.

Hmm, it's tempting to try a bit of GP, perhaps initially generating
code for a tiny language like BrainFuck, then work up to Forth, Factor and
beyond.

-- 

Cheers
aum


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


ANN: pygene0.12 - Genetic Programming&Algorithms Library

2005-12-10 Thread aum
Hi all,

This announcement supersedes an earlier announcement of pygene.

pygene 0.2 now supports genetic programming, in addition to the classical
Mendelian genetic algorithms of the earlier version. I thank the
respondents to the earlier announcement for inspiring me to implement GP
functionality.

http://www.freenet.org.nz/python/pygene

Feedback and suggestions most welcome.

pygene does not claim to be any better or worse than the existing python
genetic algorithms and genetic programming libraries. out there. It does
follow a certain style of OO API design which will appeal to some more
than others. For me, I find it easiest to work with - but that's just the
author being biased.

-- 

Cheers
aum


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


ANN: SimpleJSONRPCServer

2006-10-07 Thread aum
Hi,

I've built a module called SimpleJSONRPCServer, which is essentially the
same as the familiar python library module SimpleXMLRPCServer, except that
it uses the JSON-RPC protocol.

For those unfamiliar with JSON-RPC - see www.json-rpc.org - it's an
alternative to XML-RPC, offering most of its capabilities, but using far
less traffic and requiring less processing time on the server and client.

For more information, downloads and a live demo, visit:
http://www.freenet.org.nz/dojo/pyjson

If any Python honchos here want to raise a PEP for it, I'd support that
fully.

Cheers
aum


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


Re: ANN: SimpleJSONRPCServer

2006-10-07 Thread aum
On Sun, 08 Oct 2006 10:16:05 +1300, aum wrote:

> If any Python honchos here want to raise a PEP for it, I'd support that
> fully.

Don't worry - I've just posted my own PEP for it.

Cheers
aum

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


q - including manpages in setup.py

2006-05-28 Thread aum

Hi,

What is the best way to incorporate manpages in a distutils setup.py
script?

Is there any distro-independent way to find the most appropriate place to
put the manpages?
For instance, /usr/man/? /usr/share/man? /usr/local/man?
/usr/local/share/man?

Also - I've got .html conversions of the manpages, for the benefit of OSs
such as Windows which don't natively support manpages. What's the best
place to put these?

-- 

Cheers
aum


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


Re: saving settings

2006-05-29 Thread aum
On Mon, 29 May 2006 09:05:36 +0200, SuperHik wrote:

> Hi,
> 
> I was wondering how to make a single .exe file, say some kind od clock,
> and be able to save some settings (alarm for example) into the same 
> file? Basically make code rewrite it self...
> 
> thanks!

Yikes!!!

I'd strongly suggest you read the doco for ConfigParser, and load/save
your config file to/from os.path.join(os.path.expanduser("~")).

Another option - save your stuff in the Windows Registry

-- 

Cheers
aum


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


Another option - Re: saving settings

2006-05-29 Thread aum
On Mon, 29 May 2006 09:05:36 +0200, SuperHik wrote:

> Hi,
> 
> I was wondering how to make a single .exe file, say some kind od clock,
> and be able to save some settings (alarm for example) into the same 
> file? Basically make code rewrite it self...
> 
> thanks!

Another option I thought of:
 - get the Nullsoft NSIS installer
 - write a Python wrapper to NSIS if desired
 - within your app, include:
- embedded py2exe
- embedded/wrapped NSIS
 - within your app offer a menu option to 'export this
   program', which changes data files as needed, then invokes
   py2exe and NSIS to create a whole new installer exe

That way, you'd have what you're after - a way to distribute your app,
including its current state, as a single EXE file. Also, it would have the
advantage of this EXE being an installer which sets up start menu
shortcuts.

-- 

Cheers
aum


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


ANN: pyfcp

2006-06-18 Thread aum
Hi all,

pyfcp is a suite of tools, including a package, modules and applications,
for accessing the Freenet network.

What is freenet?

Freenet - www.freenetproject.org - is a 'darknet' which supports anonymous
publication and retrieval of websites and other media, in a way that makes
it extremely expensive, if not impossible, for Big Brother to find out
the source or requesters of any given files.

pyfcp empowers python programmers to write applications which access the
freenet network.

Note that pyfcp only works with the new-generation 0.7 alpha freenet - it
will not work with the current stable 0.5 version. But that is most
certainly a plus :)

pyfcp is available on the freenet website (downloads section), but also
has its own website on the mainstream web:

 http://www.python.org/pyfcp

as well as within freenet:

 freenet:[EMAIL 
PROTECTED],E9uFCy0NhiTbR0jVQkY77doaWtxTrkS9kuMrzOtNzSQ,AQABAAE/pyfcp/50/

Enjoy!

-- 

Cheers
aum


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


Re: pyfcp

2006-06-19 Thread aum
On Mon, 19 Jun 2006 14:45:19 +0800, Thomas Moore wrote:

>>  http://www.python.org/pyfcp
>> 
> 
> It gets me to Error 404.

Apologies - that URL should have been:

http://www.python.org.nz/pyfcp

-- 

Cheers
aum


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


Re: pyfcp

2006-06-19 Thread aum
On Mon, 19 Jun 2006 17:51:06 +0200, Marc 'BlackJack' Rintsch wrote:

> In <[EMAIL PROTECTED]>, aum wrote:
> 
>> On Mon, 19 Jun 2006 14:45:19 +0800, Thomas Moore wrote:
>> 
>>>>  http://www.python.org/pyfcp
>>>> 
>>> 
>>> It gets me to Error 404.
>> 
>> Apologies - that URL should have been:
>> 
>> http://www.python.org.nz/pyfcp
> 
> I get: Unknown host www.python.org.nz
> 
> Ciao,
>   Marc 'BlackJack' Rintsch

Dammit, what was I thinking?!

 http://www.freenet.org.nz/pyfcp

-- 

Cheers
aum


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


Re: ANN: pyfcp (URL correction)

2006-06-19 Thread aum
On Mon, 19 Jun 2006 16:24:41 +1200, aum wrote:

>  http://www.python.org/pyfcp

Sorry, that should have been:

   http://www.freenet.org.nz/pyfcp

-- 

Cheers
aum


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


Re: wxPython GUI designer

2006-06-19 Thread aum
On Sun, 18 Jun 2006 13:09:08 -0700, diffuser78 wrote:

> I am newbie learning wxPython. I tried using GUI designer called
> wxGlade. When it generated code I couldnt get the same level of
> flexibility as writing the code by oneself.
> 
> Any view on what you think about using GUI designer tools.
> 
> Every help is appreciated.

I use wxGlade all the time, and find it's great. My only complaint is that
there are some controls it doesn't know about, such as wx.HtmlWindow, and
I have to add these controls in wxGlade as 'custom' controls. But to me,
that's pretty minor.

To get the best out of wxGlade, you really need to subclass the classes
that wxGlade generates. Don't look to wxGlade to write your app for you.
It's there for gui structure (the 'view'), and it's up to you to flesh out
the 'controller' side.

So I'd recommend you persist with wxGlade - subclass all the classes that
wxGlade generates, and add your own methods to handle events, set up the
gui as you want, and (in some rare cases) do some extra initial bindings.

I typically set wxGlade to generate a file called 'myapp_ui.py', and I
write my own 'myapp.py', in which I 'import myapp_ui', then subclass the
wxGlade-generated classes in 'myapp_ui'.

Works a treat for me, and saves a lot of time compared to hand-coding the
GUI.

-- 

Cheers
aum


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


ftplib.FTP.retrbinary() hangs on completion

2006-06-29 Thread aum
Hi,

I've been having some headaches with FTP.retrbinary() hanging on
completion.

I'm only seeing the symptom when downloading a 700k .bmp file in passive
mode.

What happens is that after all the data comes in over the data connection,
.retrbinary() does 'return self.voidresp()'. This has a call chain ending
with 'self.file.readline()'.

To investigate, I overrode the .getline() method with one
which replaces the self.file.readline() with a self.sock.recv(1) loop, and
determined from this that after the last byte of binary data comes in on
the data connection, not a single byte comes in on the control connection.

Not sure if this is a deeper underlying socket issue - I'm running
python2.3 on debian unstable linux.

For a workaround, I've overridden retrbinary, so that it sets a socket
timeout on the control connection prior to doing the last .voidresp()
call, and in the event of timeout, it closes the control connection,
reconnects and logs in again - very ugly.

Can anyone share some light, or offer a better workaround?

-- 

Cheers
aum


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


Re: Leo 4.4.1 beta 3 released

2006-06-29 Thread aum
On Thu, 29 Jun 2006 11:39:08 -0500, Edward K. Ream wrote:

> Leo 4.4.1 beta 3 is now available at:
> http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106
> 
> This release corrects several long-standing bugs and adds optional flashing 
> of matching brackets.

(snip)

The author's surname needs an 's' on the end to indicate the quantity of
paper that would be needed to communicate the virtues of his software, and
the value of the tireless efforts he's put into it over the years.

-- 

Cheers
aum


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


ANN: XMLObject

2006-04-15 Thread aum
Hi folks,

I've just released an XML object wrapper called XMLObject, which aims to
do for XML file handling what SQLObject does for database access.

XMLObject wraps XML files as Python objects, and lets you work with XML
data more quickly and easily, and with code that's shorter and much more
readable than the raw python XML APIs.

It borrows some ideas from 'xml_objectify', but uses none of its code. In
addition to 'xml_objectify', it lets you make changes within the document,
and to save back to an XML file.

http://www.freenet.org.nz/python/xmlobject

-- 

Cheers
aum


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


Re: Python certification/training

2006-04-17 Thread aum
On Sun, 16 Apr 2006 06:13:51 -0700, chrisBrat wrote:

> Are there any certifications that are available for developers learning
> Python? Where?
> I'm specifically looking for distance/on-line courses or certifications
> but welcome any information available. 

Makes me wonder, just out of curiosity - are there any universities
actually teaching python (in anything bigger than a small elective
module), or are they all still owned by Java, C++, C# and Visual Basic?


-- 

Cheers
aum


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