Re: Numeric literal syntax

2008-09-03 Thread Cliff
On Sep 2, 12:34 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Ben Finney wrote:
> > I would argue that the precedent, already within Python, for using a
> > space to separate pieces of a string literal, is more important than
> > precedents from other programming languages.
>
> that precedent also tells us that the whitespace approach is a common
> source of errors.  taking an approach that's known to be error-prone and
> applying it to more cases isn't necessarily a great way to build a
> better language.
>
> 

Also a source of mental complexity.  The two proposals (whitespace vs.
underscores) are not just a question of what character to use, it's a
question of whether to create an integer (and possibly other numeric
type) literal that allows delimiters, or to allow separate literals to
be concatenated.  In the second case, which of the following would be
proper syntax?

0b1001 0110
0b1001 0b0110

In the first case, the second literal, on its own, is an octal
literal, but we expect it to behave as a binary literal.  In the
second case, we have more consistency with string literals (with which
you can do this: "abc" r'''\def''') but we lose the clarity of using
the concatenation to make the whole number more readable.

On the other hand, 0b1001_0110 has one clear meaning.  It is one
literal that stands alone.  I'm not super thrilled about the look (or
keyboard location) of the underscore, but it's better than anything
else that is available, and works within a single numeric literal.
For this reason I am +0 on the underscore and -1 on the space.

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


SCM

2011-03-08 Thread Cliff Scherer
Hi,
I am looking for a Python library, which can handle the modelling of material 
flows in Supply Chains.

Any idea ?
Thx
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: rfc822 module bug?

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 09:08 +, Nemesis wrote:
> Hi all,
> I found that the function parsedate_tz of the rfc822 module has a bug
> (or at least I think so).
> I found a usenet article (message-id: <[EMAIL PROTECTED]>)
> that has this Date field:
> 
> Date: Tue,26 Jul 2005 13:14:27 GMT +0200

My preferred date/time module is Gustavo Niemeyer's DateUtil module:

https://moin.conectiva.com.br/DateUtil

It parses an astounding number of date formats (I used it to parse the
mess of dates and times provided by RSS feeds without a hitch).

Regards,
Cliff


-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: [path-PEP] Path inherits from basestring again

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 08:01 -0600, Ivan Van Laningham wrote:
> Tony Meyer wrote:
> > 
> > >> (Those who are offended by sweeping generalisations should
> > >> ignore this next bit)
> > [...generalisation bit snipped...]
> > > This is not only bullshit, it's elitist bullshit.  "Windows users are
> > > more clueless than users of posix systems."  Pfui.  Prove it
> > > or withdraw it.
> > 
> > Sigh.  I guess you didn't read or understand the first sentence?
> > 
> 
> Yes, I read and understood it.  Saying "Don't read this if you don't
> want to be offended" doesn't make an offensive statement inoffensive.

While people are loathe to admit it, many stereotypes have some basis in
fact.  The problem is when people extend that to generalize about others
(especially in a negative way).  It's probably true that, as a whole,
most Windows users are quite a bit less knowledgeable about their
systems than *nix users.  This is probably the result of Windows being
quite a bit more user-friendly than *nix systems (another
generalization!), hence demanding less of the user, and also, I suspect,
due to the fact that *nix users tend to be a self-selected crowd (they
chose *nix because they wanted to learn more, and are willing to accept
the larger demand the OS places on them in exchange for the added
flexibility it provides).  Of course, this is impossible to prove, but
anyone who's done support knows where the majority of the silly
questions come from.

That being said, there is a big difference between a Windows *user* and
a Windows *developer*.  I doubt many Windows *users* will be writing
Python code.  I would expect that any Windows *programmer* would have no
problem using "/" as a path delimiter (and in fact, Microsoft APIs have
supported / as a path delimiter since MS-DOS days).  Programmers are as
much a self-selected crowd as the *nix users and this puts them on par
with *nix developers.

> Using __div__ to mean path concatenation is no worse than
> using __add__ to mean string concatenation, and it is both easy to
> remember (once the manual is read) and easy to type.

I agree.  I like overloading as long as it makes sense when I read it.
Python's use of "+" to mean concatenation doesn't make me blink, nor
does overloading "/" in this case.  In fact, I'm surprised it's only now
been proposed.

Regards,
Cliff


-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 12:06 -0700, Paul Rubin wrote:
> Peter Hansen <[EMAIL PROTECTED]> writes:
> > The last time I checked (as I recall), at least Wax and possibly Dabo
> > both either lagged well behind recent wxPython developments of provide
> > relatively limited support, leaving out a sizable and (to me)
> > important number of features from what they wrapped.
> 
> wxPython also depends on wxWidgets which lags behind GTK.

But how stable is GTK on systems such as Windows and OS/X?  That has
been what has kept me from using it.  Most GTK apps I've used on Windows
(including the venerable GIMP) are nowhere near as stable as their Linux
counterparts (although this may not be entirely the fault of GTK).
Also, GTK on OS/X requires Fink, which is a pretty hefty requirement to
place on an end user.

Regards,
Cliff


-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: python SMTP server

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 14:44 -0700, Fernando M. wrote:
> Hi,
> i made a test with smtplib module a few days ago, for sending mails,
> and i was wondering if there's another module for running an SMTP
> server, so i could make a standalone script for sending mails without
> using an external SMTP server.
> I've been searching but i'm not sure if there are modules for it, or
> anything.
> Which ones are my options?

You might take a look at:

http://www.divmod.org/projects/quotient

It does quite a bit more than just SMTP, but that is included.

However, you should note that if you are running the server at home,
chances are that most mail servers will reject mail from your system.
It's best to use the server your ISP provides.  You can have your local
SMTP server forward through your ISP's server, but this is, in most
cases, unneeded complexity.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Dabo in 30 seconds?

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 20:29 -0700, James Stroud wrote:
> I am going to go ahead and throw out Dabo with all of the others that claim 
> quick development of an application. You try them and then you get bugs, 
> bugs, bugs. Or they don't compile without 16000 dependencies. Forget it. My 
> advice is to choose something, one thing, that is REAL standard, and in the 
> standard library (e.g. Tkinter). And go for it. Learn it inside and out--it 
> will always be there for you. It is the green, green grass of home, not that 
> greener grass on the other side of the hill. Don't listen to the guys that 
> says this one is crap or that one isn't. Dropping one and learning another is 
> just pain. I think this is a developer trick, to keep you at war with 
> yourself. The more you have internal conflict the more you will be looking 
> for an App framework to solve your inner problems, and that keeps these guys 
> in business--the business of wrecking souls.

Then why are you using Python at all?  Shouldn't you be in the "safe
home" of Java or Visual Basic, where "standards" are all you have?


-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-07-30 Thread Cliff Wells
On Sun, 2005-07-31 at 00:59 -0400, Mike Meyer wrote:

> I don't particularly like Tkinter, but it seems to me that it's pretty
> much won. It seems to be installed on every desktop platform along
> with Python. That means that if I want to distribute GUI apps, I'm
> going to cause the least headache for my end users by writing them in
> Tkinter.

By this argument, we should just give up and use Visual* on Windows.

The least headache for end users comes from properly packaging your
application.  End users shouldn't need to worry about installing third
party packages (or even Python for that matter).  Tools such as py2exe
and Inno installer make this pretty simple on Windows, and py2app on
OS/X accomplishes the same.  It should be irrelevant to end users what 
libraries or tools you use to develop the app.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-07-30 Thread Cliff Wells
On Sat, 2005-07-30 at 16:52 -0700, Bugs wrote:
> Cliff Wells wrote:
> > 
> > But how stable is GTK on systems such as Windows and OS/X?  That has
> > been what has kept me from using it.  Most GTK apps I've used on Windows
> > (including the venerable GIMP) are nowhere near as stable as their Linux
> > counterparts (although this may not be entirely the fault of GTK).
> > Also, GTK on OS/X requires Fink, which is a pretty hefty requirement to
> > place on an end user.
> > 
> 
> wxWidgets only uses GTK on Linux.  On Windows and OS X it uses native 
> widgets where possible.

You missed my point.  I'm advocating wxPython over PyGTK for this
reason.  I'm quite aware of how wxPython functions.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 10:01 +0200, Torsten Bronger wrote:
> Hallöchen!
> 
> Cliff Wells <[EMAIL PROTECTED]> writes:
> 
> > [...]
> >
> > The least headache for end users comes from properly packaging your
> > application.  End users shouldn't need to worry about installing third
> > party packages (or even Python for that matter).  Tools such as py2exe
> > and Inno installer make this pretty simple on Windows, and py2app on
> > OS/X accomplishes the same.
> 
> Does py2exe work for all GUI libraries?  It'll highly probably work
> with Tkinter, and I've read that it also works with pyGTK, but does
> it also work with wxPython or PyQt?

py2exe and py2app work for wxPython at least, not sure about the other
gui toolkits.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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

Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 04:23 -0700, Paul Rubin wrote:
> Torsten Bronger <[EMAIL PROTECTED]> writes:
> > >> Does py2exe work for all GUI libraries?
> > > No, it's Windows-only.
> > However, OS'es and GUI libraries are different axes in the space of
> > possibilities.
> 
> I'm not sure what you mean.  Whatever GUI library the Mac uses, py2exe
> doesn't work with it, since py2exe doesn't work for Macs.

py2app is the py2exe equivalent for OS/X.  And it works fine with
wxPython as well.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 01:08 -0700, Paul Rubin wrote:
> Cliff Wells <[EMAIL PROTECTED]> writes:
> > application.  End users shouldn't need to worry about installing third
> > party packages (or even Python for that matter).  Tools such as py2exe
> > and Inno installer make this pretty simple on Windows, and py2app on
> > OS/X accomplishes the same.  It should be irrelevant to end users what 
> > libraries or tools you use to develop the app.
> 
> What if I want to be able to write multi-platform applications without
> having to deal with OS-specific packaging schemes for every OS that I
> want to run on?  Even if I only want to run on Linux, I don't see how
> to package a wxPython application to minimize end user hassle.  The
> only realistic GUI's to use are Tkinter or HTTP/HTML over a local
> socket talking to a user-provided web browser.

Hm.  That's odd, I thought I had just finished a fairly sophisticated
app that runs on Windows, Linux and Mac OSX using wxPython... I must be
mistaken.  

Regardless, if you are doing cross-platform work for *end-users* you had
better be prepared for a little pain as there is no magic bullet.   

As far as Linux only apps go... if a Linux user can't figure out how to
install wxPython (which is provided in several common packaging
formats), then I suspect they are used to pain.

The bottom line is this:  some people like Tk, some wxPython.  Each has
advantages and disadvantages.  But to claim that you *can only* do
something in one or the other only demonstrates that you haven't really
tried.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 00:23 -0700, Paul Rubin wrote:
> [EMAIL PROTECTED] (phil hunt) writes:
> > What you say Pythonic, what do you mean? And how do you rate 
> > Tkinter, PyGtk, PyQt/PyKDE, wxWindows for "Pythonicness"? 
> 
> Tkinter is not very Pythonic because it's sort of a Frankenstein
> hybrid of Python and Tcl, but at least it's there and it more or less
> works.  The others are non-Pythonic because they're not included in
> the standard distro and therefore the Pythonic "use the included
> batteries" tenet says to use Tkinter despite its flaws.

Am I to assume that you don't use *any* third party libraries?   

As far as the "use the included batteries" tenet... has Python changed
from a programming language to a cult in the few months I've been off
the list?  Where are these "tenets"?  I've never heard such nonsense.

Cliff


-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 10:07 -0700, Kay Schluehr wrote:

> Some other people already abandoned Python not for the worst reasons:
> 
> http://www.kevin-walzer.com/pivot/entry.php?id=69

Being a developer requires not only a bit of brains, but quite a bit of
tenacity as well.  Apparently Kevin lacks the second.

> My objection with wrappers around wrappers around wrappers is that I
> have no hope ever watching the ground. If some error occurs, which
> layer has to be addressed? Which developing group is reponsible? My own
> or that of team A, team B, team C ... ? The baroque concept is
> repulsive to me and only acceptable in case of legacy code that gets
> wrapped around old one and is dedicated to substitute it continously.

Of course, Tkinter is still a wrapper around a third party library (Tk)
borrowed from a different language (Tcl) and written again in a third
language (C), much the same as wxPython.  

Your concerns are valid in a theoretical sense, but in practice make
little difference.  If you are using Tkinter and it exposes a bug in Tk,
then you report to the Tkinter maintainers and they will get it fixed.
The same can be said for wxPython.  Robin Dunn is a wxWidgets developer
and if wxPython exposes a bug in wxWidgets, then he will be responsible
for getting that bug fixed.

As an aside, at one time, Tkinter required that Tcl be installed (and
used) in order to interface with Tk.  This is no longer the case.  Tk
has been abstracted into a standalone library (quite some time ago,
actually) and Python uses it pretty much the same way Tk does.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 14:58 -0400, Mike Meyer wrote:
> And what do I use to bundle my application for Unix? Most of the
> things I build get installed on Unix servers.

You install GUI apps on Unix *servers*?  

Regardless, when you say "Unix", what do you mean?  You may as well say
"OS" as this term has little meaning.  Linux (which flavor)?  BSD?  SCO?
HPUX?  OS/X?  Minix?   Whichever way, I suspect that a bit of distutils
hacking would solve your problem.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: python SMTP server

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 13:14 +0200, Benjamin Niemann wrote:

> But you should be aware of the fact that (if you send mail from a dialup
> machine without going through a relay server) your mails will quickly be
> marked as spam - I hope you do not intend to send spam...

Yah, Postfix on my servers uses several dnsbl's which automatically
reject home users (unless they authenticate first).  Even if this isn't
the case for the majority of SMTP servers today I expect it won't be
long before it is.

As an aside, I will say that many SMTP servers that service home users
(i.e. Comcast, et al) limit the amount of mail that you can send within
a defined period.  By using a local SMTP server to proxy, your app can
queue up a large amount of mail in a much shorter period.  It won't
necessarily go out any faster, but at least your app won't be tied up
waiting for the mail to be accepted.  So there is perhaps one useful
(beyond learning and fun) application for using a local SMTP server.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Dabo in 30 seconds?

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 00:32 -0700, Paul Rubin wrote:

> Those issues about the 1600 dependencies don't apply nearly as much to
> pure Python modules (e.g. Twisted) as they do to extension modules
> that require the presence of further stuff on the system.  E.g., on
> Linux, to use wxPython, you need wxWidgets, which needs GTK 1.5, which
> has been obsolete for years, and there are all sorts of build
> conflicts when you try to compile this stuff out of the box.  I don't
> know where Dabo fits in.  It does sound nice in some regards.

wxWidgets/wxPython hasn't required GTK 1.x in quite a long time.  Please
get your facts straight.  Also, the "1600" dependencies you complain
about come standard on any modern Linux system or can be easily
installed with the system's package management tool.  I've also built
wxPython from source on OS/X, which, while orders of magnitude more
difficult than on Linux, still wasn't that hard.  I'm seriously getting
the impression you are criticizing something you've never even tried.

> Pico Lisp uses an interesting approach to portable GUI's: it includes
> a socket-based GUI API and a special Java applet that runs in a
> browser and implements the API.  All the issues of dealing with
> OS-specific window systems go away, as long as you can run a
> Java-enabled browser and point it at the Pico Lisp application.  See:
> 
>http://www.software-lab.de/down.html

It sounded interesting until you said "Java Applet".  Talk about causing
deployment issues...

Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Dabo in 30 seconds?

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 01:03 -0700, Paul Rubin wrote:
> Cliff Wells <[EMAIL PROTECTED]> writes:
> > Then why are you using Python at all?  Shouldn't you be in the "safe
> > home" of Java or Visual Basic, where "standards" are all you have?
> 
> I don't know about VB but Java does a much better job of supporting
> standards than Python does.  Python's advantage is in being a much
> more pleasant language to code in.  It would benefit greatly from also
> doing a better job implementing standards.  Many or most of the Python
> library modules that purport to implement standards just sort of
> get halfway there and then stop.

Well, this is a problem with open source in general.  Take a look at
sourceforget and you'll see hundreds if not thousands of packages that
never even made it out of "planning" stages.  

It might be nice to see some things standardized in Python, but I'm
unconvinced that the GUI toolkit is one of them.  Different GUI toolkits
vary widely in flexibility, ease-of-use (and this varies on who you
are), target platform, etc.  For instance, I might be inclined to write
a GUI in pygame, if the particular app I'm writing required it.
Personally, while I prefer wxPython in general, I *like* having options
for those times when wxPython simply isn't the right tool for the job.

"When all you have is a TkHammer..."

Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Dabo in 30 seconds?

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 18:00 +, Dennis Lee Bieber wrote:
> On Sun, 31 Jul 2005 00:13:18 -0400, Ed Leafe <[EMAIL PROTECTED]> declaimed
> the following in comp.lang.python:
> 
> > 
> >  Sorry you feel that way. You'll miss out on really great Python products 
> > that 
> > aren't in the standard Library, such as Twisted, Zope/Plone, Dabo, and many 
> > others.
> >
>   Zope/Plone are applications in their own right... They aren't
> designed to be plug-ins for the development of Python programs. Yes,
> they USE Python as the runtime basis but they are complete as is -- one
> can install Plone and never have to know about Python (be a touch
> limited, but it can be used). In a way, Python is part of the Zope/Plone
> standard library, not the other way around.
> 
>   Can that be said for the others?

Twisted, for one, can't be used without knowing Python.  In fact,
without knowing Python quite well.  For that matter, it can't easily be
used .

Cliff (who has a love/hate relationship with Twisted)

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 12:48 -0700, Kay Schluehr wrote:
> Cliff Wells wrote:
> 
> > > My objection with wrappers around wrappers around wrappers is that I
> > > have no hope ever watching the ground. If some error occurs, which
> > > layer has to be addressed? Which developing group is reponsible? My own
> > > or that of team A, team B, team C ... ? The baroque concept is
> > > repulsive to me and only acceptable in case of legacy code that gets
> > > wrapped around old one and is dedicated to substitute it continously.
> >
> > Of course, Tkinter is still a wrapper around a third party library (Tk)
> > borrowed from a different language (Tcl) and written again in a third
> > language (C), much the same as wxPython.
> 
> Yes, sorrowly. But the discussion was focussed around another layer
> above wxPython, Tkinter etc. to make those toolkits more pythonic. Ed
> promised to support many GUI toolkits as backend in future ( reviving
> the failed AnyGUI approach ). That's o.k. as long as tedious
> maintenance is a fun job for some people and they do it right. I don't
> say that Ed produces crap, but I'll be carefull and wait a couple of
> years before using such kind of stuff in production code.

Well, more users means more bug reports, more feedback, more helping
hands ultimately.  The wait-and-see approach, while safer, is anathema
to open source.  Try it on toy apps.  If it works, it works.  If it
doesn't submit bug reports and help out a bit.

> > Your concerns are valid in a theoretical sense, but in practice make
> > little difference.
> 
> It makes all difference in practice. A few levels of stacking does not
> hurt in theory because it is easy to abstract them away by perfect
> machinery.

Having used wxPython for many years (although, admittedly not yet Dabo
[but I will next time I'm doing a GUI app]), I can say that the
machinery, while rarely perfect (and what in software is?), is entirely
serviceable.  I've hit my share of bugs, reported them, worked around
them, etc.  I've never yet been completely stymied by any issue I've hit
with this toolkit.  Dabo, being pure Python, is probably even easier to
deal with since if I did hit an issue I could probably fix it myself.

I'd say my 6 or 7 years of wxPython experience trumps your theoretical
concerns ;)

I'm not as certain I like the "multiple backend" approach however
(supporting both wx and tk, for instance).  What seems to happen with
those sorts of things is you get the intersection of functionality of
the two underlying systems with the outstanding benefits of neither.
Not to mention it makes any progress take twice as long since any
existing functionality must be replicated for each system.  I'd much
prefer to see Ed focus on one or the other [wxPython of course, since
I'm selfish ].

> > If you are using Tkinter and it exposes a bug in Tk,
> > then you report to the Tkinter maintainers and they will get it fixed.
> 
> As long as the chain of layers does not break and the conveyor-belt
> rolls efficiently it's like living in theory ;)

That can be said of any software in existence.  Nearly every bit of
software you use is layered many times over.

Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 18:01 -0300, Jorge Godoy wrote:
> Mike Meyer wrote:
> 
> > We already have multiple distributions of Python: CPython, IronPython,
> > and Jython (and there's at least one more). We even have multiple
> > distributions of CPython, what with Active State doing their own and
> > the MacPython distribution. I'm not proposing a fundamental change in
> > the world, I'm suggesting an addition that would satisify the OPs
> > needs.
> > 
> > The "standard" distributor is whichever one your organization settles
> > on when it comes time to choose a Python distribution.
> 
> So we don't solve the problem with a "standard" distribution and that was
> the point I was trying to show.
> 
> In fact this sounds more like a joke I've heard a while ago: standards, if
> you don't like the ones out there, create your own.
> 
> > None of which has stopped linux from following this path.
> 
> And solve a completely different problem while sharing the very same problem
> you, on the post prior to mine, was trying to solve: what is the standard
> GUI on a Linux distribution?  QVWM?  WindowMaker?  Gnome?  KDE?  FVWM?

Well, I think this exposes one of the more interesting sides of open
source software in general.  For better or worse, you get choices.  If
you don't like choice, you won't like open source.  Many choices is
sometimes great, sometimes annoying, but the bottom line is that very
little is spoon-fed to you, and choice and flexibility are the primary
reasons most people choose open source (this was the overwhelming
verdict of a survey SuSE took a while ago).  You can't even *run* Linux
without making a few basic choices (Which distro? Which architecture?
Which GUI? etc).  If you really expect this to change then I expect
there are many frustrating days ahead for you.  I think most end users
of Linux wish that the GNOME and KDE teams would merge (and there would
be a great benefit, I expect, in reduced duplication of effort), but
quite frankly, it ain't gonna happen, and quite probably there would be
a lot of downsides to such an event as well.  

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 23:46 +0200, Torsten Bronger wrote:
> Hallöchen!
> 
> Cliff Wells <[EMAIL PROTECTED]> writes:
> 
> > [...]
> >
> > Well, I think this exposes one of the more interesting sides of
> > open source software in general.  For better or worse, you get
> > choices.  If you don't like choice, you won't like open source.
> 
> On the other hand, the GUI package bundled with Python is a regular
> decision of some sort of committee.

No, it's a decision made by Guido some years ago that remains in place
because it's more pain to remove than to simple leave there.  

Besides, define "bundled with".  My python install doesn't have it.
Tkinter was separated out sometime ago as a separate download that just
happens to have a link next to the standard installer.  Having a link on
python.org hardly qualifies as "bundled with" IMO.  "Bundled near" would
be more accurate.

Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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

Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 16:23 -0700, Paul Rubin wrote:
> Torsten Bronger <[EMAIL PROTECTED]> writes:
> > I can't really understand your hostility towards non-Tkinter
> > toolkits.  In the case of wxPython, it's part of SUSE, which is
> > probably also true for Fedora and Mandriva.  Installing is as easy
> > as selecting a checkbox.  This covers a very great deal of Linux
> > users.  On Windows you have to call an exe file.
> 
> No it's not on Fedora, at least FC3.  I had huge trouble trying to
> build it and gave up.  I had similar problems on RH9.

I've been installing it from the RPM's on http://wxpython.org from
around Redhat 6.2 up through FC4.  I've never had an issue, except in
cases where I had screwed my Linux install up to the point of no
recovery (and I recall only once this happened, when I had decided to
use Ximian desktop around 7.3).  Also the Windows and Mac installers
there seem to work just fine as well.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Dabo in 30 seconds?

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 16:22 -0700, Paul Rubin wrote:
> Cliff Wells <[EMAIL PROTECTED]> writes:
> > wxWidgets/wxPython hasn't required GTK 1.x in quite a long time.  Please
> > get your facts straight.
> 
> It did last time I tried installing it, which was maybe 3-6 months ago.
> Someone posted that it had been updated recently.

Looking on SourceForge, I see that 2.4.2.4 had GTK2 builds and it's
dated 2003-10-01.  I also know that GTK2 support came well before this
and was in fact a build option long before Robin made an official
release.  Unfortunately SF doesn't go back any further than this and I
don't have time to research it further.   Nevertheless it's provable
that wxPython had GTK2 releases almost 2 years ago.

http://sourceforge.net/project/showfiles.php?group_id=10718&package_id=10559

> I spent several hours trying to install wxPython on Linux without
> success (a lot of that was figuring out that some undefined symbol it
> was complaining about was some GTK 1.5 function that had didn't exist
> in GTK 2.1).  As I remember, wxPython itself compiled without too much
> trouble but wxWidgets and/or GTK 1.5 (once I got a copy of that) had
> some problems.  I decided I just didn't care enough to keep pursuing it.

I've seen a few people run into issues like this, usually as the result
of autoconf/automake finding obsolete libraries on a system (e.g. if you
upgraded your redhat from 7.3 to 9.0 and stale libraries were left
around).  This isn't specific to wx, I've seen similar problems with
other software (PostgreSQL being a common one).  They can usually be
fixed, but it does take some sleuthing.  Still, can't really blame wx
for this as it's more the distro's fault for not having good
update/packaging systems.

> > >http://www.software-lab.de/down.html
> > 
> > It sounded interesting until you said "Java Applet".  Talk about causing
> > deployment issues...
> 
> Yeah, I don't have Java in my browser, but it's very widely deployed.
> For most of the stuff I do though, a plain HTML interface is fine.

Yah, I think Java is the one thing I've never had work satisfactorily
(read "without crashing or failing to load altogether") on
Fedora/Redhat.  For a while I had it working with the JVM from IBM, but
those happy days are long gone.  I now simply ignore apps written in
Java.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 16:57 -0700, Paul Rubin wrote:
> Cliff Wells <[EMAIL PROTECTED]> writes:
> > > And what do I use to bundle my application for Unix? Most of the
> > > things I build get installed on Unix servers.
> > 
> > You install GUI apps on Unix *servers*?  
> 
> The usual way to do that is with a web GUI, but nothing stops you from
> running Tkinter on a Unix server through a remote X connection.

Of course not, but unless the servers are on a trusted network and use
an authentication scheme such as kerberos, you are asking for trouble.

Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Dabo in 30 seconds?

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 17:16 -0700, Paul Rubin wrote:
> Cliff Wells <[EMAIL PROTECTED]> writes:
> > > It did last time I tried installing it, which was maybe 3-6 months ago.
> > > Someone posted that it had been updated recently.
> > 
> > Looking on SourceForge, I see that 2.4.2.4 had GTK2 builds and it's
> > dated 2003-10-01. 
> 
> That's sort of interesting.  I think I downloaded whatever was on
> wxpython.org.

Usually there will be a link to a couple different builds on
wxpython.org.  I can see where it would be pretty easy to grab the wrong
one.


> No this was definitely a GTK issue.  I avoid OS upgrades because of
> issues like what you describe.  If I want a new OS, I buy a new hard
> drive and install the new OS from scratch, or even buy a new computer.

I usually keep /home on a separate partition.  That lets me wipe / and
do a fresh install without affecting my personal stuff.  I will say that
using apt/yum to upgrade works pretty well these days, as long as the
jump isn't too far (i.e. more than one major release).  Still, I too
prefer the fresh install, just out of paranoia probably.


Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 16:38 -0700, Paul Rubin wrote:
> Cliff Wells <[EMAIL PROTECTED]> writes:
> > The bottom line is this:  some people like Tk, some wxPython.  Each has
> > advantages and disadvantages.  But to claim that you *can only* do
> > something in one or the other only demonstrates that you haven't really
> > tried.
> 
> I can put up a Tk gui in about 5 lines of code from a stock Python
> distro without having to install anything additional.  How do I do
> that with wxPython?

How can I embed a browser in Tk (I mean a real browser, like Mozilla,
Safari, or even Exploder)?  At all?  On any platform?  This has always
been the tradeoff for Tk.  wxPython has a much larger selection of
sophisticated widgets than Tk does (I first tried wxPython because of
its grid widget, which Tk didn't have at the time and the pure Tk
version I wrote was slw.  I doubt Tk still has anything that
compares). 

I'm working on improving my user interface designs and I'm leaning
toward the hybrid HTML + GUI systems as seen in many utilities (such as
Norton AV, AdAware, etc).  I don't see that approach as being even
remotely possible in Tkinter.

Tk is great for learning, easy to write small, basic interfaces, less
great for deploying real world apps with sophisticated interfaces.  I've
often felt that Tk was the VB of GUI toolkits: terrific for knocking out
simple stuff, but starts to bite you in the *** when you try to do the
hard stuff.  wxPython is the opposite: it has a steeper learning curve,
but once you know it, you can do amazing things.  For me, the long term
benefits are far more important to me than how low the startup costs
are.

Besides, as mentioned earlier, you *do* need to install something
additional: the python-tkinter package such as:

http://www.python.org/ftp/python/2.4.1/rpms/fedora-3/python2.4-tkinter-2.4.1-1pydotorg.i386.rpm

Although I'll also admit it seems that it can be easier (for many
people) to mess up your wxPython install than your Tkinter install.


Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-07-31 Thread Cliff Wells
On Sun, 2005-07-31 at 17:45 -0700, Paul Rubin wrote:
> Cliff Wells <[EMAIL PROTECTED]> writes:
> > > The usual way to do that is with a web GUI, but nothing stops you from
> > > running Tkinter on a Unix server through a remote X connection.
> > 
> > Of course not, but unless the servers are on a trusted network and use
> > an authentication scheme such as kerberos, you are asking for trouble.
> 
> If it's for sensitive stuff normally you'd use https.

Hm, I haven't tried piping X over https... I wasn't even aware it was
possible... do you have a link I can check this out on?

Also, why not just stunnel or ssh -Y instead?

Cliff 

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-01 Thread Cliff Wells
On Sun, 2005-07-31 at 23:47 -0700, Paul Rubin wrote:

 
commentary about how Paul wants to both not install *anything* and if he
does have to install something he must compile it from source because he
shouldn't have had to do it in the first place therefore he needs to
make it as difficult as possible and if something doesn't fit this
bizarre pattern then it sucks and we should just use tkinter instead.


I think you are one of a kind and that any suggestions you make about
what should or shouldn't be standard in Python (i.e what would be of the
most use to the largest number of people) are to be taken with an
extremely large grain of salt.  Nothing wrong with being unique, but you
just need to realize that no one else in their right mind wants to do
things your way and any attempts you make to get them to do so are
doomed to failure at best and ridicule at worst.

Regards,
Cliff


-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 08:53 +0100, phil hunt wrote:

> I was under the impression -- from reading this ng -- that wx was 
> buggy on some platforms and less portable than Tkinter. Not true?

It depends on how you define "buggy" and "portable"... also "platform"
is up for grabs too ;)

On the serious side, I expect that if you are simply counting bugs,
there are probably more in wxPython.  But I'd also say that when it
comes to ratio of bugs to features, they are probably quite comparable,
even if Tk has one bug and wxPython a hundred ;)

As far as more portable, Tk probably wins hands-down.  OTOH, in
practice, very few people care about the platforms wxPython doesn't run
on (think: GTK doesn't run there either).  wxWidgets is working on a
wxUniversal port which takes a similar tack that Tk does in most cases,
that is, providing all of its own widgets based on drawing primitives,
but I have no idea how far along that is nor how long until wxPython
supports it as another target.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: python SMTP server

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 12:28 +0200, Benjamin Niemann wrote:
> Cliff Wells wrote:

> > As an aside, I will say that many SMTP servers that service home users
> > (i.e. Comcast, et al) limit the amount of mail that you can send within
> > a defined period.
> 
> Or completely block outgoing traffic on port 25 except to their own relay...

Luckily I haven't encountered this with Comcast Cable (I use my own
mailserver [requires smtpauth] directly from home as Comcast seems to
have issues with mail and DNS on occasion).  If I ever do, I'll
immediately switch to one of the local DSL providers who support Linux.
Better for MTA's to block dynamic/home IP's using dnsbls than have the
ISP limit what you can do with your home computer.

> > By using a local SMTP server to proxy, your app can 
> > queue up a large amount of mail in a much shorter period.  It won't
> > necessarily go out any faster, but at least your app won't be tied up
> > waiting for the mail to be accepted.  So there is perhaps one useful
> > (beyond learning and fun) application for using a local SMTP server.
> 
> It would be interesting what the intention of the OP is. I just stumpled
> upon a similar problem. The prog I'm currently working on has a function to
> report crashes back to me. Originally these reports where sent by mail - no
> problem on UNIX/Linux hosts where you can assume to have a working MDA on
> localhost. But what to do on Windows systems?!? Ask for a SMTP server
> during installation? Confusing as the program itself is totally unrelated
> to email. In this case you _could_ deliver the mail directly to my MX
> host... But instead of this I installed a small CGI on my website that
> sends the mails to me and gets the data via HTTP POST from my app.

You can also use port redirection to bypass this sort of thing.  Send on
port 10025 instead and direct your MTA to listen on both ports.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: The state of OO wrappers on top of wxPython (was Re: Wheel-reinvention with Python)

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 14:20 +0200, Marek Kubica wrote:

> If you already tried GIMP on Windows, better try Inkscape on Windows.. that
> piece of GTK software is really good.

I don't do any actual work under Windows any more.  My Windows VMware
session is purely for testing Windows apps and websites under Exploder. 

However my girlfriend, while hating the Gimp (she prefers Photoshop, to
put it mildly), loves Inkscape and claims it is better in many ways than
Illustrator.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Dabo in 30 seconds?

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 08:30 -0400, Ed Leafe wrote:
> On Sunday 31 July 2005 20:09, James Stroud wrote:

>  No problem. But let me ask you what would *not* have disappointed you. As 
> others have pointed out, you didn't compile the wxWidgets part of your 
> wxPython install so as to include the stylized text control (yes, it seems 
> silly that you should have to specify that, but that's another thread...)
> 
>  Should we have defensive code for every possible broken installation? We use 
> a lot of the Python standard library modules, many dbapi-compliant modules, 
> and, of course, wxPython. If someone mis-installs one of the pre-requisites, 
> do you expect Dabo to catch that and present you with a diagnostic message? 
> I'm serious here: I want to know what people consider acceptable for a 
> software package that relies on other packages. 

Personally, all I expect is an obvious pointer to a mailing list and a
helpful community willing to suffer NB questions (fast bugfixes is a big
plus too).  If that's available, I'm happy.  But then I'm willing to
actually work a little to get what I want.  For other it seems they
won't be happy unless you drive to their house and install it for them
(which only seems fair, cause if you hadn't volunteered to write such
crap then they wouldn't have had to be bothered with it in the first
place, damn you).  Maybe you wouldn't mind tidying up a bit and washing
a few dishes while you're at it?  


Can't *quite* get this spoon to my mouth'ly yours,
Cliff


-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Majordomo results: [UBCCS:VIRUS] Was: Returned mail: Data f

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 06:04 -0700, [EMAIL PROTECTED] wrote:

>  Command 'nuisance' not recognized.

Hm, seemed to work anyway.

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Dabo in 30 seconds?

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 16:21 +0200, Daniel Dittmar wrote:
> Cliff Wells wrote:
> >  But then I'm willing to
> > actually work a little to get what I want.  For other it seems they
> > won't be happy unless you drive to their house and install it for them
> 
> To be fair to those slothes: some of them want to write software for a 
> commercial setting where they have to install it on other peoples 
> machines. So it isn't just getting it to work one one own's machine. 
> Using a specifc Python library with external dependencies means also 
> installing and *supporting* it on a possible large set of configurations.

I can understand this, but from my experience, their concerns are badly
misplaced:  I recently wrote a fairly sizable Python app (~8K LOC) that
utilized several 3rd party python librarys: wxPython, Twisted,
FeedParser, DateUtils and SQLite to name a few off the top of my head
(plus I had to repackage libxml and libxslt on OS/X because 10.3 ships
with broken versions :P). 

It ran on Windows and OS/X (and Linux, but that was never deployed as
the customer wasn't interested).  This was for a *very* large customer
and made it to nearly 10,000 desktops.  Not one complaint had to do with
installation of 3rd party packages.  Why?  Because I *packaged* it for
them.  Most of the effort I put in had little to do with any 3rd party
Python library but rather just the ins and outs of each platform's
packaging tools (and this can be no little pain I assure you).  I will
also note, out of fairness, that the port to OS/X was not as pain-free
as I had hoped (wxPython was fairly new to that platform and I found
more than a few bugs - most of them are resolved now, because I didn't
just give up when I found them, rather I reported them and 
they got fixed!  Who would have thought?!).

In short, these people's complaints reveal only two things: 1) they are
hopelessly pessimistic, whether out of pure laziness, lack of experience
or what I'm unsure and 2) they've never actually tried very hard or
perhaps even at all. Overall that's a recipe for failure in any
endeavor.  As I mentioned earlier, programming is half brains and half
tenacity.  If you lack one or the other, your chances of success are
pretty slim.  The sad thing is that their ability to cling so
tenaciously to such an unqualified position leaves me wondering if it
isn't truly the first quality that they lack.  Given how easy Python
makes things, I'd hate to see how they'd fare with a *real* programming
language .


Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: namespaces

2005-08-01 Thread Cliff Wells
On Tue, 2005-08-02 at 02:37 +1000, Steven D'Aprano wrote:
>  there is a reason why Lisp is a niche language, with very little if any use 
> in the commercial world.

Eric Naggum?

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Dabo in 30 seconds?

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 13:28 -0300, Jorge Godoy wrote:
> 
> We can find several problems, almost all of them can be solved with the
> admin's creativity.  

>>> import creativity
Traceback (most recent call last):
  File "", line 1, in ?
ImportError: No module named creativity
>>>

Nope.  Not included with Python.  Can't be used.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Dabo in 30 seconds?

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 10:57 -0700, Paul McNett wrote:
> Terry Reedy wrote:
> > "Ed Leafe" <[EMAIL PROTECTED]> wrote in message 
> > news:[EMAIL PROTECTED]
> 
> >>I'm serious here: I want to know what people consider acceptable for a
> >>software package that relies on other packages.
> 
> > To me, acceptability depends on the audience.  Do you want to limit Dabo to 
> > professional developers comfortable with sometimes cryptic traceback 
> > messages or do you want to include people using Python as part of other 
> > activities?
> 
> My concern with putting another layer on top of Python's excellent 
> traceback mechanism is that we could screw up and hide important 
> exceptions, or otherwise make it harder for the seasoned Pythonista to 
> get to the source of the issue. Nothing beats those tracebacks, ugly 
> though they may seem to a newbie... perhaps we need both methods, and to 
> default to the "nice" error handler.

That sounds great.  And fwiw, even "seasoned" developers like to be
pointed directly to the problem if at all possible.  For instance, it
may be clear from the traceback *what* the error is, but unless you RTFM
or are intimately familiar with wx, you may not immediately know how to
solve it.  Even if the traceback ended with an appropriate link to the
FAQ, that would be outstanding.

BTW, I'm with Terry: these discussions have definitely convinced me to
give Dabo a try.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 15:26 -0400, Mark Roseman wrote:
> > How can I embed a browser in Tk (I mean a real browser, like Mozilla,
> > Safari, or even Exploder)?  At all?  On any platform?  This has always
> > been the tradeoff for Tk.  
> 
> Try this as one example:
>   http://wiki.tcl.tk/4094

Okay, I figured if any, Win32 would be the one that worked, and I even
recall seeing this example at one time.  However, last time I checked,
this bit of code wasn't actually working (although it may have been a
temporary situation).

Still, that leaves Linux and Mac out in the cold.  But I'll admit you
met my challenge.  Most likely you can actually do most of the things
with Tk you can with Wx, it's simply a matter of how much effort is
going to be (for instance, it's certainly quite possible to embed Gecko
in Tk, but I for one am not likely to be up to the task).

> I'd respectfully disagree (having done large, real-world Tk apps).  
> You're right that Tk has a slow learning curve, which makes it easy to 
> knock out simple interfaces really quickly - and generally ones that are 
> not too impressive looking.  You can do more sophisticated ones, and 
> ones that blend properly into the platforms you're working on - however, 
> the amount of effort and learning curve increase substantially.  This is 
> because you end up needing to do a lot more fiddling, looking at or 
> using any of a large number of add-on packages, etc.).

Yes, this was my finding with Tk.  I ended up using Pmw.MegaWidgets and
a few other things to make up for deficiencies in the core library,  but
mostly I found a need to write highly sophisticated controls myself,
many of which were simply provided by wxPython.  I was spending more
time writing controls than writing applications.  It was kind of fun and
interesting, but not very productive.  This is what prompted my move to
wxPython several years ago.  I still believe wxPython to be a much more
rapidly evolving toolkit (although my tracking of Tk has fallen to
almost nil since the switch so I'm willing to stand corrected or at
least leave the point open to debate).  The native look-and-feel across
all platforms was another big motivation, but no the primary one.
Mostly I found that the steeper learning curve paid off quite well in
the long run.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 13:38 -0700, Paul Rubin wrote:
> Peter Decker <[EMAIL PROTECTED]> writes:
> > We were discussing your 'enormous pain' installing wxPython. I find it
> > interesting that you selectively quoted part of one line of my post,
> 
> Yes, the one line I quoted was the one that said most people have
> wxPython installed, which is a preposterous claim.  The reason they
> don't have it installed is they don't have reason to go through the
> hassle of installing it, given (among other things) that tkinter is
> already there.  If they don't want to go through that hassle, I don't
> see why I should want to go through it.

I seriously hope you are being intentionally obtuse, otherwise your
difficulties with wxPython have acquired a sharply illuminated source.
It was quite clear that by saying "most people" he was not referring to
the set of "most Python users", but rather the set of "most people who
have tried wxPython".

Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 14:13 -0700, Paul Rubin wrote:
> Cliff Wells <[EMAIL PROTECTED]> writes:
> > Still, that leaves Linux and Mac out in the cold.  But I'll admit you
> > met my challenge.  Most likely you can actually do most of the things
> > with Tk you can with Wx, it's simply a matter of how much effort is
> > going to be (for instance, it's certainly quite possible to embed Gecko
> > in Tk, but I for one am not likely to be up to the task).
> 
> I actually misunderstood your question about embedding a browser and
> thought for a while about what it would take to write or port a
> serious browser to use tkinter as its graphics layer.  The resulting
> picture wasn't pretty.  I wonder whether it's feasible in wxpython.

wxPython has a toy HTML renderer that allows embedding wxPython widgets
directly into it.  If you only need simple HTML it works great.  It is
also possible to embed IE, Safari and Mozilla (via wxMozilla) but you
lose the ability to embed the wxPython widgets).

> I like the idea of a browser-like portable gui toolkit.  Instead of
> merely wrapping some other widget set, you'd write your interface as
> an XML file using HTML-like interface elements.  You'd have callbacks
> on the form submit buttons and optionally on the other input elements,
> and you could get at the elements through the XML DOM if you were so
> inclined (sort of like the HTML DOM that browsers expose through
> Javascript).  Implementations could run on top of Tk, GTK, native
> Windows widgets, or whatever.  

Actually wxPython has this today (and has had for some time): you can
build your interface code in XML and wxPython will build the interface
on the fly.  I played with it once as a method of building a dialog
editor along the lines of VB, but the project I needed it for died and I
didn't have time to finish.  My discovery was that it was entirely
doable though, had I had time to finish.

In fact, with the XRC stuff in wxPython, you can even create custom
controls with pure XML.  I'm not sure how great this is for hand-built
interfaces (but I haven't tried), but it seems ideal for automated
generation of GUI's.


Regards,
Cliff


-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 14:16 -0700, Paul Rubin wrote:
> Cliff Wells <[EMAIL PROTECTED]> writes:
> > It was quite clear that by saying "most people" he was not referring to
> > the set of "most Python users", but rather the set of "most people who
> > have tried wxPython".
> 
> That wasn't clear to me.  If that's what he meant, he should have said so.

Paul,

Honestly what appears to me to be happening here is that you have found
yourself assailed on all sides and are perhaps getting a bit too quick
with both your reading of posts and with your replies.  The end result
is you end up trying to defend your earlier statements, which, due to
haste, were either worded incorrectly or based on incorrect
interpretations of what others have said.  Then because you feel under
attack you are compelled to defend those statements further, quite
probably against your own better judgement.

I know I've contributed plenty to this situation (and I'll also admit to
having been in similar situations before, and it's a lot easier to get
into this situation than to get out of it), therefore I'll make you a
deal: you slow down and put a bit more thought into your replies and
I'll lay off the sideways comments and cut you some slack.  In fact,
enough having been said, I think I'll just try to let this thread die a
natural death.

Deal?

Regards,
Cliff

P.S.  I would have preferred to have made this off-list, but I can't
figure out how I should decipher your email address.


-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 17:54 -0400, Mark Roseman wrote:

> 
> I'll point out that this has been done (in fact, many times).  For 
> example:
>   http://tkhtml.hwaci.com
> 
> (Integrating Gecko in has also been done, as a side note).

Interesting.  Your later point about hard to find is certainly correct
as my searches (albeit not as in-depth as they could have been) turned
up little in this regard.


> While I certainly don't begrudge anyone their choice of tools, it's no 
> surprise that someone who's become more familiar with wxPython would 
> have an unduly low opinion of Tk.  They've obviously spent more time 
> overcoming the warts in wxPython, and wouldn't have spent comparable 
> effort learning what it would take to overcome the warts in Tk - it just 
> looks hopelessly flawed in comparison.  

Well, as was mentioned earlier (by Paul I believe), "life is too short",
in this case, to become expert in more than one GUI toolkit (which as a
whole, are a wart on the face of programming in general, IMHO).  They
are highly complex and require a large investment of time regardless of
which you choose.  People often cite one kit as being "more pythonic"
than another, but frankly I've yet to see one that even remotely meets
that (admittedly vague) criteria.  I've made my choices based on my own
criteria, and certainly I would not hesitate to recommend my choices to
others.  

Frankly most of my ire in this thread has been over things tertiary to
the toolkits themselves: 1) the idea of demanding that one toolkit be
"the preferred" way  2) dismissing without due consideration the hard
work of others who have volunteered their code without demand for
recompense, and 3) what I've taken (rightly or wrongly) to be deliberate
obtuseness on the part of some of the participants.

Aside from that, I consider the choice of GUI toolkits to be a pretty
benign issue and hardly one qualifying for the level of heat we've had
for the last day or so.

> Switch "wxPython" and "Tk" around in the above argument and I think the 
> statements equally hold of course.

Agreed.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 23:49 -0400, Mike Meyer wrote:
> Cliff Wells <[EMAIL PROTECTED]> writes:
> 
> > On Sun, 2005-07-31 at 14:58 -0400, Mike Meyer wrote:
> >> And what do I use to bundle my application for Unix? Most of the
> >> things I build get installed on Unix servers.
> > You install GUI apps on Unix *servers*?  
> 
> Yup. Thanks to the wonders of X, I can run GUI apps on servers and
> have them display on my desktop. Or my OS X laptop. I normally leave a
> gkrellm running on most of my servers.

Yes, yes.  The "wonders of X" have been known to me since around 1992.
Personally I avoid running GUI apps on my servers since they are usually
unnecessary, waste memory, and if not used properly, open the door for
security issues (for that matter, any extra piece of software installed
opens the door for potential security issues so I tend to run
stripped-down servers that only provide needed services - no fluff.
Then again "server" is a pretty broad term.  The bulk of my servers are
shared and dedicated hosting environments where paranoia is rewarded.
Your situation may be different).

> Of course, the problem under discussion isn't restricted to GUI
> apps. Anytime I use a third party library, I have to deal with how end
> users are going to get it.

Absolutely.  However GUI libraries tend to stick out a bit more since
they tend to have a larger number of dependencies plus sheer code size
and complexity makes platform-specific bugs more likely.

> > Regardless, when you say "Unix", what do you mean?  You may as well say
> > "OS" as this term has little meaning.  Linux (which flavor)?  BSD?  SCO?
> > HPUX?  OS/X?  Minix?   Whichever way, I suspect that a bit of distutils
> > hacking would solve your problem.
> 
> I think the post I replied to covered the OS X case - there's an
> application bundler available for it already.

Yes, I've used it to bundle wxPython apps on 10.3.

> I want distributions that will work on all three major BSD variants
> and most Linux distrubtions - in particular, anything that uses deb's,
> rpm's or emerge. If you want to choose one in particular, try ubuntu
> Linux.

OpenBSD: in portage
FreeBSD: in portage
386BSD: don't know... does anyone still use this?
NetBSD: included AFAICT
Fedora: rpms available
Debian: debs available
Ubuntu: included
Gentoo: in portage
OS/X:  available on wxpython.org

FWIW, much of this info I found in less than 5 minutes using Google.  I
suppose with a little persistence you could have discovered it for
yourself.

Here's your Ubuntu instructions:
http://wiki.wxpython.org/index.cgi/wxPython_20with_20Ubuntu

Of course, if you are distributing end-user software by requiring users
to install 3rd party packages themselves, then I hope you are
distributing open source software.  If it's a commercial/closed-source
app you'll do far better by simply packaging all the requirements into
the installer and installing it within the application's directory tree
(this solves a lot of problems with version conflicts and user
confusion).

In my experience, binary packages work best for Windows and OS/X, and
source distributions work best for Linux (mostly because building
packages for Linux is a varied and sometimes painful process. Further
Linux truly works best as a source-based system: you cannot always
depend on ABI compatibility across versions of libraries - *usually* you
can but... caveat emptor).

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-01 Thread Cliff Wells
On Mon, 2005-08-01 at 23:56 -0400, Mike Meyer wrote:

> I think you have me confused with someone else. I was responding to
> someone who was claiming that the lack of a standard enterprise
> strength GUI toolkit was a serious problem for Python - I disagree. I
> won't recap the thread, but other languages have been *very*
> successful without having a GUI as part of the language, all they had
> was one development environment distributed with a GUI.

I think there's a lot of confusion in this thread.

> BTW, in answer to your rhetorical question about GUI's for Linux, the
> answer is plwm.

Technically, a toolkit for building a window manager, not a GUI.  But
funny anyway ;)

Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-01 Thread Cliff Wells
On Tue, 2005-08-02 at 00:18 -0400, Mike Meyer wrote:

> Or maybe you could switch to Jython, and just use swing?

Man, c.l.py is getting *mean* ;)


-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-02 Thread Cliff Wells
On Tue, 2005-08-02 at 09:45 +0200, Torsten Bronger wrote:

> Yes, this is what I meant with "legacy code".  C and C++ are
> actually special-purpose.  They are good for controlling a computer
> but not for implementing an idea.  Their current vitality on almost
> all software areas arise from the fact that they had been extremely
> successful before Java, C#, and VB came into play.  

Unfortunately your assertion is patently false.  C and C++ are very much
general-purpose languages.  It is a logical contradiction to assert that
Java, C#, VB and Python are general-purpose languages while C and C++
are not when the former were implemented using the latter.  
Being implemented in C, Python can do nothing that C cannot.  It can
certainly make it *easier* to do things, but it conveys no new abilities
other than that of meeting deadlines ;)

As an aside, I don't disagree with what I think is your main point:
higher-level abstractions make more advanced ideas feasible.  You simply
state it far too strongly.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-02 Thread Cliff Wells
On Tue, 2005-08-02 at 20:17 -0400, Mike Meyer wrote:

> Um - you're not answering the question I asked. I asked "What app do I
> use to bundle my applications for Unix, ala py2exe (or whatever it is)
> for Windows?" You're telling me how to install wxPython on those
> platforms.
> I know how to install wxPython. What I want to know is how to build an
> application bundle for all those Unix systems for a Python app I use
> that includes wxPython - or any other third party libraries I may be
> using.

Sorry, I assumed you'd know about distutils:

http://www.python.org/doc/current/dist/
http://www.python.org/doc/current/dist/built-dist.html

distutils can go so far as to build an rpm for you, but you'll need to
package things like .debs yourself.

Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-03 Thread Cliff Wells
On Wed, 2005-08-03 at 09:47 -0400, Mike Meyer wrote:
> Cliff Wells <[EMAIL PROTECTED]> writes:
> 
> > On Tue, 2005-08-02 at 20:17 -0400, Mike Meyer wrote:
> >
> >> Um - you're not answering the question I asked. I asked "What app do I
> >> use to bundle my applications for Unix, ala py2exe (or whatever it is)
> >> for Windows?" You're telling me how to install wxPython on those
> >> platforms.
> >> I know how to install wxPython. What I want to know is how to build an
> >> application bundle for all those Unix systems for a Python app I use
> >> that includes wxPython - or any other third party libraries I may be
> >> using.
> >
> > Sorry, I assumed you'd know about distutils:
> 
> Cliff, please quit being an ass. You keep assuming that because some
> tool isn't the answer to my question that I don't know about
> it. That's simply rude. It would be *much* more polite to ask "What's
> wrong with distutils" rather than saying "So you don't know about
> distutils."

Since you said "please".  I'll try to forget about "the wonders of X"
comment you made that I found just as rude.

> > http://www.python.org/doc/current/dist/
> > http://www.python.org/doc/current/dist/built-dist.html
> >
> > distutils can go so far as to build an rpm for you, but you'll need to
> > package things like .debs yourself.
> 
> I've very familiar with distutils. It doesn't do what I asked for, in
> that it only bundles up *my* code. It doesn't bundle the things I
> depend on the way py2exe does. It's patently *not* the answer to the
> question I asked.

It can.  It isn't terrifically easy, but distutils can be used to
package up 3rd party libraries, including binary libs.  It can, in fact,
package up any file you so desire.

> For those who want .deb's out of distutils, there's a PR on
> sourceforge that includes a patch to make it generate .debs that works
> quite well.

I wasn't aware of that.  Nice.

> Of course, anyone who built a .deb (or an RPM, or a port, or whatever)
> that bundled up everything it needed would be doing *the wrong
> thing*. Those formats are designed for packaging single distributions,
> not applications. They include dependency information that is used to
> fetch the dependencies and install them. From my standpoint, the
> problem here is that you then have to get the dependencies into the
> repository before you can put your application there and have it
> work. For instance, my port of bicyclerepairman is stuck at an old
> version because I haven't gotten a port PyMac accepted yet (it also
> has to do with bugs in the xemacs port, but that's another story).
> 
> I'm surprised you haven't mentioned eggs yet. Those work across all
> the platforms I named. Of course, they aren't the answer to my
> question either, because, like PRMs et al, they only reference
> external dependencies, they don't include them.

While this describes the general use case of RPM, you can most certainly
include external dependencies.  You do it by not making them external.
If you need wxPython included with your app, you can build wxPython as a
subtree of your project and package it that way.  While wasteful of
space, it is also the only sure way to make sure that your app has the
correct version and all needed dependencies.  This is how py2exe does it
on Windows and py2app does it on Mac (they just make it automatic). 

People find Linux more difficult to distribute binary apps on because
they try to follow the typical Linux pattern for distributing packages
versus using the one used elsewhere.  For binaries this doesn't work
very well.  

Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Wheel-reinvention with Python

2005-08-04 Thread Cliff Wells
On Thu, 2005-08-04 at 01:04 -0400, Mike Meyer wrote:

> Right. Let's go back to the original question: What's the app I use on
> Unix that acts like py2exe on Windows and py2app on Unix?
> 
> Any archiving system can be coerced into collecting all the parts
> together. None of them do it automatically. That automatically makes
> them *not* an answer to the question.

Nothing.  Since it isn't all written for you it can't be done.

Have a nice day.


-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Decline and fall of scripting languages ?

2005-08-06 Thread Cliff Wells
On Sat, 2005-08-06 at 03:24 -0700, Kay Schluehr wrote:
> No good news for scripting-language fans:
> 
> http://www.phpmag.net/itr/news/psecom,id,23284,nodeid,113.html

It didn't say what they left PHP, Perl and Python for (if you are to
even believe their findings).

PHP has been losing programmers in droves... to Ruby on Rails, but I'm
not sure how that is bad news for scripting-language fans.

Commercially funded studies are completely untrustworthy.  I've seen
contradictory studies published within months of each other by the same
research firms - it was more indicative of a change in clientelle than
anything else.

Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Python -- (just) a successful experiment?

2005-08-08 Thread Cliff Wells
On Sun, 2005-08-07 at 06:55 -0700, Paul Boddie wrote:
> Eric Pederson wrote:
> > Why is Ruby, and Ruby on Rails, getting such strong play?
> 
> Relentless hype from blogging celebrities?

This is certainly part of it, but I feel it ignores the much deeper
reasons which are the root of this hype.  I recently went to FOSCON (a
free seminar coinciding with OSCON put on by the local Ruby UG here in
Portland) and listened to a few presentations on Ruby and Rails by David
Hansson (the creator of Rails) and others.  By the end it was clear that
Ruby is wonderfully suited to writing domain-specific languages (DSL)
and that Rails is an excellent example of a DSL geared toward writing
database-driven web applications.  A friend of mine is writing a book on
Rails for a large publisher and admitted to me that he barely knows Ruby
(and has used Rails for only around six months).

The second presentation (I don't recall the speaker's name) specifically
covered metaprogramming (writing DSLs) and one of the things I found
interesting was that despite Ruby having far more syntax than Python in
general, the resulting Ruby-based DSLs presented had far *less* syntax
than had they been written in Python.  This is undoubtedly the reason
why Rails is apparently completely usable even if one knows very little
Ruby.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: Python -- (just) a successful experiment?

2005-08-08 Thread Cliff Wells
On Mon, 2005-08-08 at 10:10 -0700, Paul Rubin wrote:
> Cliff Wells <[EMAIL PROTECTED]> writes:
> > The second presentation (I don't recall the speaker's name) specifically
> > covered metaprogramming (writing DSLs) and one of the things I found
> > interesting was that despite Ruby having far more syntax than Python in
> > general, the resulting Ruby-based DSLs presented had far *less* syntax
> > than had they been written in Python.  This is undoubtedly the reason
> > why Rails is apparently completely usable even if one knows very little
> > Ruby.
> 
> Interesting.  But if we can generalize from that, then Lisp should be
> ruling the web.

Well, that is perhaps the other key feature: the Ruby/Rails community
seems pretty friendly and eager to help people jump to their side of the
fence (much like the Python community, btw), whereas Lisp community is
an oxymoron.

Regards,
Cliff

-- 
[EMAIL PROTECTED]
http://www.develix.com :: Web applications and hosting :: Linux, PostgreSQL and 
Python specialists ::


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


Re: HTML library

2006-01-17 Thread Cliff Wells
On Tue, 2006-01-17 at 09:28 -0800, Ron Griswold wrote:
> Hi Folks,
> 
>  
> 
> Can someone point me in the direction of an html library that
> generates html text for you. For example, if I had a tuple of tuples,
> I’d like a function that would create a table for me. I’ve looked
> through the standard library and it only seems to have html parsers. I
> need to go the other way ;)
> 

The two best things I know of are Nevow's Stan and XIST.  Since I
started using Stan, I've vowed to never write another line of XML.


http://divmod.org/trac/wiki/DivmodNevow

http://www.livinglogic.de/Python/xist/


Regards,
Cliff

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

Re: Using Python for my web site

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 17:12 -0300, Gerhard Fiedler wrote:
> On 2006-07-31 15:00:15, Bruno Desthuilliers wrote:
> 
> > In fact, the real question IMHO is: what would MySQL advantage over
> > PostgreSQL be ?-) 
> 
> A few years ago I did some research, and the result was that while
> PostgreSQL was claimed to have more features and a better design, the
> reports of database corruption seemed to have been more frequent than with
> MySQL. The usual reason given was that MySQL was more mature.
> 
> I assume you don't agree... :)

I certainly don't.  MySQL provides two different ways to corrupt your
data: actual database corruption *and* data integrity corruption.  You
can escape the second by using InnoDB rather than MyISAM tables, but
that increases your chances of the first (InnoDB not being as "mature"
as either MyISAM or PostgreSQL).

Also, saying "a few years ago I did some research" in software terms is
pretty much equivalent to saying "I don't know".

Regards,
Cliff

-- 

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


Re: Static Variables in Python?

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 15:21 -0400, Michael Yanowitz wrote:
>   Is it possible to have a static variable in Python - 
> a local variable in a function that retains its value.
> 
>  For example, suppose I have:
> 
> def set_bit (bit_index, bit_value):
>static bits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>bits [bit_index] = bit_value
> 
>print "\tBit Array:"
>int i
>while (i < len(bits):
>   print bits[i],
>print '\n'
 

Many people suggest that using a class for this is the Python idiom (and
perhaps it is), but I prefer to use a decorator for adding attributes to
functions in this case:

def attrs ( **kwds ):
''' taken from PEP 318 '''
def decorate ( f ):
for k in kwds:
setattr ( f, k, kwds [ k ] )
return f
return decorate

@attrs ( bits = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] )
def set_bit ( idx, val ):
set_bit.bits [ idx ] = int ( bool ( val ) )
print "Bit Array:"
for i in set_bit.bits:
print i,
print 


>>> set_bit ( 4, 1 )
Bit Array:
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
>>> set_bit ( 5, 1 )
Bit Array:
0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0


Regards,
Cliff

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


Re: Static Variables in Python?

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 13:02 -0700, Cliff Wells wrote:


> @attrs ( bits = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] )

Also, IMO, it's a bit more readable to write:

bits = [ 0 for i in range ( 16 ) ]

which avoids the necessity of counting the zeros to know how many there
are.

Regards,
Cliff


-- 

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


Re: Static Variables in Python?

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 13:37 -0700, Cliff Wells wrote:
> On Mon, 2006-07-31 at 13:02 -0700, Cliff Wells wrote:
> 
> 
> > @attrs ( bits = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] )
> 
> Also, IMO, it's a bit more readable to write:
> 
> bits = [ 0 for i in range ( 16 ) ]

Or even:

bits = [ 0 ] * 16

Just be careful to only use that style when the contents of the array
are non-mutable.  The list comp does the right thing in that case (at
risk of going on a tangent):

Right:
>>> bits = [ { } for i in range ( 16 ) ]
>>> bits
[{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]
>>> bits [ 0 ][ 'a' ] = 1
>>> bits
[{'a': 1}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]

Wrong:
>>> bits = [ {} ] * 16
>>> bits [ 0 ][ 'a' ] = 1
>>> bits
[{'a': 1}, {'a': 1}, {'a': 1}, {'a': 1}, {'a': 1}, {'a': 1}, {'a': 1},
{'a': 1}, {'a': 1}, {'a': 1}, {'a': 1}, {'a': 1}, {'a': 1}, {'a': 1},
{'a': 1}, {'a': 1}]
>>>


Regards,
Cliff

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


Re: Static Variables in Python?

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 15:21 -0400, Michael Yanowitz wrote:
>   Is it possible to have a static variable in Python - 
> a local variable in a function that retains its value.
> 
>  For example, suppose I have:
> 
> def set_bit (bit_index, bit_value):
>static bits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
>bits [bit_index] = bit_value
> 
>print "\tBit Array:"
>int i
>while (i < len(bits):
>   print bits[i],
>print '\n'
> 
>  
>I realize this can be implemented by making bits global, but can
> this be done by making it private only internal to set_bit()?  I don't
> want bits to be reinitialized each time. It must retain the set values
> for the next time it is called.

BTW, I'm assuming this example was contrived.  In real life, I wonder
why you'd ever want to use anything besides:

bits = [ 0 ] * 16
bits [ 4 ] = 1
print "Bit Array:"
print ' '.join ( bits )

Having a "set_bit" function seems redundant when the language syntax
directly supports what you are trying to do.

Regards,
Cliff

-- 

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


Re: Using Python for my web site

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 17:58 -0300, Gerhard Fiedler wrote:
> On 2006-07-31 17:28:00, Cliff Wells wrote:
> 
> >> I assume you don't agree... :)
> > 
> > I certainly don't.  [...]
> 
> > Also, saying "a few years ago I did some research" in software terms is
> > pretty much equivalent to saying "I don't know".
> 
> Exactly. So what's your point with this comment?

My point is to stop FUD right at that comment.  I don't doubt your
research from "a few years ago", but ancient research is entirely
irrelevant for making a decision *today*.

However, had I let it pass, then someone else might not make that
distinction and come away with the impression that your research was
somehow still relevant and that PostgreSQL is less reliable than MySQL.

> I stated what was my impression at the time, with the hope that others
> might want to comment. Thanks for the comment. 

You're welcome.

> OTOH, anybody who says "I know" regarding a comparison in reliability
> between databases must have pretty good data to back that up. Few have.
> Most are in the "I don't know, but my impression is that ..." group. 

Absolutely.  I can only give you anecdotal evidence myself.  Further, if
someone were to present a whitepaper of some sort demonstrating that one
is superior with regard to reliability or performance, I'd probably be
highly suspect of their motives.  

Regardless, since my job as a hoster requires that I assist customers
with database issues, I have hands-on experience with dozens of
instances of each and my *very recent* experience tells me that MySQL is
far more prone to database corruption than PostgreSQL.  In the past 6
months, I've repaired or restored at least 4 MySQL databases (and for no
apparent reason, to boot), but I've had to do the same for exactly zero
PostgreSQL installs since I started hosting over 3 years ago.  And just
to be clear, the number of PostgreSQL installs far exceeds the number of
MySQL installs.  Were there equal numbers of each I'd expect even more
MySQL problems.

Regards,
Cliff

-- 

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


Re: Using Python for my web site

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 14:40 -0700, northband wrote:
> Just spoke with my department and looks like we still want to go with a
> server scripting method.  Although MVC may be better fit, for the sake
> of the learning curve, we want to use a PSP style method.

I'm with the others who suggest using an MVC framework.  The learning
curve for Django, TurboGears, Pylons, et al, is ridiculously short, and
the maintainability of the resulting code is infinitely superior.

Why don't you take a look at the 20 minute wiki screencast that
TurboGears has and make a decision then.  Although the screencast is
specifically about TurboGears, a similar screencast could be made for
almost any of the other MVC-style frameworks:

http://files.turbogears.org/video/20MinuteWiki2nd.mov
http://www.turbogears.org/preview/docs/tutorials/wiki20/index.html

Developing in a PHP/ASP embedded style is an anachronism these days and
for good reason.   Spend a couple days learning a modern framework.  The
time will be well-spent and quickly made up in shortened development
time and code maintainablility.

> So as of now we are looking at using FreeBSD, MySQL, and some form of
> Python that will allow us to achieve great performance serving
> 30million page loads / month.

If I were you, I'd cease worrying about the performance of the framework
itself and research caching proxies and load balancing solutions
instead.  The payoff in performance will be much higher and you won't
have to make architectural compromises.

Regards,
Cliff

-- 

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


Re: Using Python for my web site

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 15:06 -0700, northband wrote:
> Makes sense, I will follow your advice.  Sounds like more time invest
> upfront will equal time saved over the long run.  I am defitely
> interested in proxy caching and load balancing.  Which do you
> recommend?  I have used #Pound while working for a university.

I currently use Pound, mostly for proxying to virtual hosts on my shared
hosting systems, but for heavy page hits and dynamic content, Squid is
probably of more interest since Pound doesn't do caching.

Regards,
Cliff


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


Re: Nuther problem with 'dive into Python'

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 14:03 +0100, Ben Edwards wrote:
> Am going through Chapter 9 - HTTP Web Services in dive into Python.  It
> uses the following:
> 
> data = urllib.urlopen('http://diveintomark.org/xml/atom.xml').read()
> 
> The page no longer exists, can anyone recommend an alternative page to
> use?

Perhaps any one of the approximately 100 million pages with Atom
feeds?  

Google is your friend:

http://www.google.com/search?hl=en&lr=lang_en&safe=off&q=blog
+atom&btnG=Search

Results 1 - 10 of about 105,000,000 English pages for blog atom. 

Cliff

-- 

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


Re: Using Python for my web site

2006-07-31 Thread Cliff Wells
On Mon, 2006-07-31 at 21:57 -0300, Gerhard Fiedler wrote:
> On 2006-07-31 18:23:17, Cliff Wells wrote:
> 
> > My point is to stop FUD right at that comment.  I don't doubt your
> > research from "a few years ago", but ancient research is entirely
> > irrelevant for making a decision *today*.
> 
> That's exactly the reason why I added this information. It might not be for
> you, but it is interesting for me (and might be for someone else) to see
> that I get a different feedback now than I got a few years ago. It tells
> something about the dynamic of the process that the mere status of today
> doesn't tell.

Well, perhaps I misunderstood your intent.  Sorry if I was short.

> Besides, "claimed to have" and "seemed to have" are not really FUD inducing
> terms :)

Taken in a vacuum, they can certainly add to an overall negative
impression.  PostgreSQL, in the past, has certainly had some hurdles
that made it a suboptimal choice for many people: performance and
difficulty in installation and management, among other things (I've
personally not had stability issues), lack of a native Win32 version,
etc, have made it the runner up in deployment to MySQL.  
Today, that's all changed.  PostgreSQL is comparable in performance to
MySQL (although I expect each outperforms the other in certain areas),
*easier* to install and maintain than MySQL, and its stability is
outstanding.  Release 8 also saw a native Windows version. For many
reasons, MySQL seems to be on the reverse track, sacrificing
performance, stability and ease of use in an attempt to catch up to
PostgreSQL in features.  
Nevertheless, there remains rumors and myths that stem from those old
days that cause many people to fear deploying PostgreSQL.  This is part
of the reason I'm always quick to jump on statements such as yours.  I
feel it's a disservice to the community to let those myths continue and
perhaps dissuade others from discovering what is today *the* premier
FOSS relational database.

> Anyway, I appreciate you sharing your experience (which in that area
> certainly is more than mine).

I'm glad I was able to add to the pool of knowledge (or at least the mud
puddle of anecdote).

Cliff

-- 

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


Re: code to retrieve web mail?

2006-07-31 Thread Cliff Wells
On Tue, 2006-08-01 at 01:47 +, John Savage wrote:
> I have a free web mail address and would like to use python to retrieve
> files that have been emailed to me. The basic code would accommodate
> cookies, a login name and password, then download using the full URL I
> can provide. From postings here I thought mechanize held promise, but
> I've found it to contain filenames that are invalid for MSDOS (too many
> characters, and/or too many dots in the name, etc.) so I have little hope
> that the mechanize module can be used.
> 
> I'm running python2.4.2 on plain MSDOS (not windows), so would appreciate
> a pointer to sample code that can do the job. I know that curl has this
> capability, but I'll learn something by tinkering with python code.

PyCurl certainly does have that capability, although the docs were
practically non-existent last I looked (and I've not tried it on DOS).
Still Google will help get you through it, along with the examples
included with the package, and once it's working PyCurl does an
outstanding job.

You might take a look at Beautiful Soup for parsing the HTML once PyCurl
has fetched it for you:

http://www.crummy.com/software/BeautifulSoup/

Also, no matter what method you finally end up with, you'll undoubtedly
need to mangle long filenames into 8.3 names, at least for attachments
and the like.

Regards,
Cliff

-- 

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


Re: Using Python for my web site

2006-08-01 Thread Cliff Wells
On Mon, 2006-07-31 at 22:25 -0700, Luis M. González wrote:
> I don't have experience with Django or any other python framework, but
> I have used bare-bones mod_python and it rocks.
> I wouldn't use PSP though...
> It is not very polished, and they way it handles the "indentation
> problem" in python is a little bit confussing.
> 
> IMHO the best way of using mod_python is with its publisher handler.
> It let's you code your applications in a MVC (model view controller)
> style.

While I agree (or at least consider the point moot) that this is
possibly the best way to use plain mod_python, I'd disagree that it's a
good way to develop modern web applications in Python.  By the time
you've decided on every bit of framework to use, and made all the little
decisions that go into turning a fresh, clean spot on your hard drive
into an application, what you've done is reinvent TurboGears rather than
develop your application.  Worse, you've probably reinvented it poorly.
I've done so many times and am well aware of what a time-waster it is.

You say that you haven't tried Django or any other Python framework.
Perhaps you should.  You seem to have at least the start of the right
idea about web application organization, so I think you'd be pleasantly
surprised with what you'll find already done for you by the major Python
frameworks and how much time you'll stop wasting on code that isn't part
of your application.

Regards,
Cliff

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

Re: Using Python for my web site

2006-08-01 Thread Cliff Wells
On Tue, 2006-08-01 at 10:41 -0300, Gerhard Fiedler wrote:
> On 2006-08-01 04:11:18, Cliff Wells wrote:
> 
> > You say that you haven't tried Django or any other Python framework.
> > Perhaps you should.  You seem to have at least the start of the right
> > idea about web application organization, so I think you'd be pleasantly
> > surprised with what you'll find already done for you by the major Python
> > frameworks and how much time you'll stop wasting on code that isn't part
> > of your application.
> 
> I've checked it out quickly, and it seems that it is not possible to
> install e.g. TurboGears on a typical shared host -- as a normal user. You
> seem to run a shared hosts farm (IIRC). What's your point of view of
> hosting TurboGears or Django on a shared host? Is that (reasonably)
> possible?

There's quite a few actually:

http://www.turbogears.org/preview/docs/deployment/hosting.html

That's just a few picks Kevin made, there are many more.  As I
understand it textdrive also supports TG.

For myself, I handle user-installation of TurboGears pretty much like I
do all user-installed Python packages: using setuptools.  Any user who
uses easy_install or 'python setup.py install' gets their packages
automatically installed into a subdirectory of their home directory and
that takes precedence over the system installed packages.  Works like a
charm.

Regards,
Cliff

-- 

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


Re: Using Python for my web site

2006-08-01 Thread Cliff Wells
On Tue, 2006-08-01 at 06:38 -0700, Luis M. González wrote:

> Well... yes, you're right.
> I guess that the reason for not having used a framework already is
> laziness...

Trust me, I'm quite familiar with the laziness problem =)

> I have experience with Karrigell, which rocks too, but it lacks some
> deployment options (no mod_python, no fastcgi, etc).
> 
> And as far as I could see in the Django docs, I should learn many new
> things to do exactly the same, such as yet another templating language
> or how to map urls with regular expressions (I still couldn't wrap my
> head around regex... I find them very boring to learn...). But you are
> absolutely right. I should definetely try Django sometime.
> I guess I'll do it when I have a real need to do some serious web
> stuff.
> 
> As for TurboGears, I'm not very impressed...
> This is a pile of different components picked by someone according to
> his liking, very well glued together. Althouh its quality may be good,
> why should I stick with a number of components chosen according the
> criteria of some other guy?
> For example, why kid instead of Cheetah? Why CherryPy?
> Really, it isn't that hard to install cheetah and, if you want an
> object relational mapper, sqlobject. Once you have them, using raw
> mod_python is just a pleasure.

Agreed.  But on the other hand, it isn't always about having "the best"
of each (why didn't they use Twisted rather than CherryPy would be *my*
question), but rather having a complete development stack that's
pre-integrated and is *good enough*.  And mind you, the integration work
is quite substantial.  Also, TurboGears has definitely proven the "a
rising tide lifts all boats" maxim, TurboGears has marketing and
community and all the projects that comprise TurboGears have benefited
from it.

Ultimately a framework is about helping you get *your* job done.  If
your job is assembling frameworks or evaluating which ORM is best, then
that's no help ;-)  But I suspect those people are in the minority and
most people just want to get their sites done without trying to figure
out which is "best" and then trying to figure out how to integrate that
with other components.

Also, TurboGears supports template plugins (I wrote one to support
Nevow's Stan, and there is a Cheetah plugin as well), and work is being
done to support alternate ORMs (SQLAlchemy is working now, although not
all the TG addons support it yet).  The goal is to at least offer people
the opportunity to replace certain components in the framework if they
object to some part of TG.  That's not the *ultimate* goal, but Kevin is
a pragmatic guy and recognizes that component bias can hurt TurboGears'
adoption and so is trying to address that in some fashion.

> I feel I'm in front of a white clean canvas and I just start coding.
> I like the flexibility of being able to choose each part of "my own
> framework".
> I even created a small script that does the automatic crud stuff for me
> (not as polished as Django for sure, but it works like a charm).

Sure, and if you are doing it as a hobby, or to learn or to perhaps take
over the world with a new ORM, then that's great.  But if someone is
paying you by the hour to develop a website for them and you are writing
an ORM when there's already half dozen out there, then someone probably
isn't getting their money's worth.  This is the problem frameworks were
meant to address: putting your focus back on your web application rather
than all the details that go into it.  Do you lose some flexibility?
You bet.  Not a lot, but a noticeable amount.  Of course the flip side
is that you can turn out a pretty sophisticated web app *by yourself* in
a few days.

I saw DHH of Ruby on Rails fame at FOSCON last year and he really
impressed me with is no-nonsense philosophy about web frameworks.  His
approach is the antithesis of Zope, Joomla, et al. Django and TurboGears
are no-nonsense in the same vein: they aren't about providing every
feature under the sun or blazing performance or ultimate
configurability.  They are about eliminating the time-consuming details
that you face every time you start a project.

> Anyway, there's still an issue with using these frameworks:
> Availability. It's very hard, if not impossible, to find a decent web
> host at an affordable price. Although I guess many of those who use
> Django, for example, run their own host.

Not true.  As I posted elsewhere there are many hosts who will run
frameworks (I suspect the pressure of Ruby on Rails really pushed open
the door).  Here's a short list from the TurboGears site:
http://www.turbogears.org/preview/docs/deployment/hosting.html

And from the Django site:
http://code.djangoproject.com/wiki/DjangoFriendlyWebHosts

WebFaction (formerly python-hosting) even has a control panel that will
install the framework of your choice with a mouse-click.



Regards,
Cliff

-- 

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

RE: Static Variables in Python?

2006-08-01 Thread Cliff Wells
On Tue, 2006-08-01 at 07:37 -0400, Michael Yanowitz wrote:

> # * class BitsClass *  
> class BitsClass (object):
> def __init__(self, num_bits):
> self.bits=[]
> for i in range(num_bits):
> self.bits.append(0)
> def set(self, bit_index, value):
>   self.bits[bit_index] = value
>   return self.bits
> def get(self, bit_index):
> if ((bit_index >= 0) and (bit_index < len(self.bits))):
> return self.bits[bit_index]
> else:
> return scenario_globals.ERROR_
> def display(self):
> i = 0
> while (i < len(self.bits)):
> print self.bits[i],
> i += 1
> print '\n',
> 
> global the_bits
> the_bits = BitsClass(16)
> 
> # inside another function I have:
> global the_bits
> the_bits.set(index, value)
> 
>   but I get back:
> Traceback (most recent call last):
>...
>   File "scenario_sync.py", line 245, in get_discrete_data
> the_bits.set(index, value)
> AttributeError: 'DiscreteBits' object has no attribute 'set'
> 
>   There is 
> 
>   I was also disappointed, I was hoping I could use BitsClass.print()
> instead of BitsClass.display().

>>> class BitsClass (object):
... def __init__(self, num_bits):
... self.bits=[]
... for i in range(num_bits):
... self.bits.append(0)
... def set(self, bit_index, value):
... self.bits[bit_index] = value
... return self.bits
... def get(self, bit_index):
... if ((bit_index >= 0) and (bit_index < len(self.bits))):
... return self.bits[bit_index]
... else:
... return scenario_globals.ERROR_
... def display(self):
... i = 0
... while (i < len(self.bits)):
... print self.bits[i],
... i += 1
... print '\n',
...
>>> the_bits = BitsClass(16)
>>> the_bits.set (4, 1)
[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]


Works for me.  I'm not sure what 'DiscreteBits' in your error refers to.
Also, you don't need to explicitly declare global variables "global".

Regards,
Cliff

-- 

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


Re: Using Python for my web site

2006-08-02 Thread Cliff Wells
On Tue, 2006-08-01 at 23:26 -0300, Gerhard Fiedler wrote:

> Or is there something in PostgreSQL that makes its users acidic? :)

Well, ACID is popular in PostgreSQL circles.

Cliff
-- 

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


Re: Using Python for my web site

2006-08-02 Thread Cliff Wells
On Wed, 2006-08-02 at 10:46 -0300, Gerhard Fiedler wrote:
> On 2006-08-02 00:51:28, Conrad wrote:
> 
> > Which begins "A few years ago" 
> 
> Exactly. Isn't this a good start for honesty? It doesn't claim to state
> anything up to date.
> 
> It continues "I did some research", "some" being a very clear indicator
> that I didn't consider this a thorough research. From the stated results of
> this research it should be clear to any reasonable reader what kind of
> research that was. "Claimed to have", "seemed to have" are not really
> expressions that try to claim more than they are.

I think the communication breakdown here is two-fold:

1) PostgreSQL fans are perhaps a bit paranoid about claims of MySQL
being better.  There used to be a tiny bit of truth in this claim for
certain applications (mostly relating to performance and ease of use).
This makes them tend to read statements such as yours as an attack and
so you get defensive responses.  
Also, comparing MySQL to PostgreSQL is a bit like comparing PHP to
Python: not even in the same class. PostgreSQL users probably consider
the whole comparison is a bit insulting to begin with, then to suggest
that MySQL *might* be better is practically a slap in the face ;-)

2) When you qualify statements with modifiers such as "some", "seemed",
etc, you are almost bound to be misinterpreted, since those modifiers
are apparently invisible on the net.  I suspect most people scan
messages, taking away the main point but discarding all the nice words
the writer was so careful to write.
For future reference, if you don't know and intend to convey that you
don't, it's probably best to end your statement (no matter how carefully
qualified) with a clear statement that you are fishing for informative
responses.

For instance, were I to say (on this list):

"I've heard that Python is slow compared to PHP, and that many people
recommend PHP because it's hard to find hosting for Python apps
anyway.", I'd probably get a nice mix of both helpful replies and
extremely irritable ones, despite the fact I clearly qualified my
statements.  Both of those statements were at least somewhat true at one
point and as such tend to invoke more passionate responses from Python
proponents.  On the other hand, had I appended "So I'd like some other
opinions because I don't know." to the end, it would probably cut the
irritation down considerably (or at least be in a much more defensible
position if it didn't).

Regards,
Cliff

-- 

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


Re: Using Python for my web site

2006-08-02 Thread Cliff Wells
On Wed, 2006-08-02 at 23:13 -0300, Gerhard Fiedler wrote:

> Thanks, that's one of the conclusions to which I also came. That final
> question was missing, even though I felt it was implied. I really had no
> clue that this is such a touchy subject. 

Every opinion in technology seems to be touchy for someone ;-)  

> Another one is that it seems (here I go again :) that there is something
> like a marriage between Python and PostgreSQL (or in other words, that
> Python fans that develop web apps have a tendency to favor PostgreSQL). Is
> there something like this? (Here is the question :)
> 

I don't think so.  If I had to venture an opinion, my impression has
been that the MySQL/PostgreSQL division lies more along the line between
web applications and other types of apps.  For some reason, web people
seem to either prefer MySQL or (more likely) fall back to it as a
default.  If there's a bias toward PostgreSQL in the Python crowd, I
suspect that's due to the fact that Python's presence seems to be more
weighted toward non-web programming relative to other languages (this
being due to Python's general applicability, not an implication Python
isn't suited for the web).

Regards,
Cliff

-- 

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


Re: Using Python for my web site

2006-08-03 Thread Cliff Wells
On Thu, 2006-08-03 at 15:51 +0200, paul kölle wrote:
> Cliff Wells wrote:
> 
> > For myself, I handle user-installation of TurboGears pretty much like I
> > do all user-installed Python packages: using setuptools.  Any user who
> > uses easy_install or 'python setup.py install' gets their packages
> > automatically installed into a subdirectory of their home directory and
> > that takes precedence over the system installed packages.  Works like a
> > charm.
> May I ask how you handle clashes with packages already installed in
> site-packages? Once I tried something like ~/lib/python and set up
> distutils accordingly, easy_install wouldn't work if the package was
> installed system-wide...

I followed these instructions:

http://peak.telecommunity.com/DevCenter/EasyInstall#administrator-installation

So far I've had no issues with package clashes. 

Regards,
Cliff


-- 

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

Re: Using Python for my web site

2006-08-03 Thread Cliff Wells
On Thu, 2006-08-03 at 09:49 +0200, Sybren Stuvel wrote:
> Cliff Wells enlightened us with:
> > 1) PostgreSQL fans are perhaps a bit paranoid about claims of MySQL
> > being better.  There used to be a tiny bit of truth in this claim
> > for certain applications (mostly relating to performance and ease of
> > use).
> 
> I even find PostgreSQL easier to use than MySQL :)

These days certainly, by quite a wide margin.  

> Sounds like the Fox News Network to me. "Some people say" If that
> doesn't sound familiar, check out the documentary "Outfoxed".

My main news source on Fox remains "The Simpsons".

Cliff

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


ReStructuredText

2006-08-15 Thread Cliff Wells
Started playing with docutils and don't understand why the following
doesn't work:


>>> from docutils.core import publish_parts
>>> t = '''
...
... 1. this is a test
... #. this is another line
... #. oh, screw it!
...
... '''
>>> publish_parts ( t, writer_name = 'html' ) [ 'body' ]
u'1. this is a test\n#. this is another line\n#. oh, screw it!\n'
>>>


Why doesn't the above turn out an enumerated list?  It looks like all
the examples I've seen, and I've tried adding and removing blank lines
around it to no avail.  

Regards,
Cliff

-- 

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


Re: ReStructuredText

2006-08-15 Thread Cliff Wells
On Tue, 2006-08-15 at 09:35 +0200, Sybren Stuvel wrote:
> Cliff Wells enlightened us with:
> > Why doesn't the above turn out an enumerated list?
> 
> You have to indent the list:
> 
> >>> from docutils.core import publish_parts
> >>> t = '''
> ... 
> ...1. this is a test
> ...#. this is another line
> ...#. oh, screw it!
> ... '''
> >>> publish_parts(t, writer_name='html')['body']
> u'\n\nthis is a
> test\nthis is another line\noh, screw
> it!\n\n\n'

Thanks for the response.  Must be a bug in my version:

Python 2.4.2 (#1, Feb 13 2006, 15:24:20)
[GCC 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from docutils.core import publish_parts
>>> t = '''
...
... 1. this is a test
... #. this is another line
... #. oh, screw it!
...
... '''
>>> publish_parts ( t, writer_name = 'html' ) [ 'body' ]
u'\n1. this is a test\n#. this is another line\n#. oh, screw
it!\n'

Guess I'll stick to HTML.

Regards,
Cliff
-- 

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


Re: ReStructuredText

2006-08-15 Thread Cliff Wells
On Tue, 2006-08-15 at 16:02 +0800, limodou wrote:
> On 8/15/06, Cliff Wells <[EMAIL PROTECTED]> wrote:
> > Thanks for the response.  Must be a bug in my version:
> 
> Which version of docutils you are using, in my computer is good.
> 
> u'\nthis is a test\nthis is
> another line\noh, screw it!\n\n'

>>> docutils.__version__
'0.3.7'
>>>

Regards,
Cliff

-- 

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


Re: ReStructuredText

2006-08-15 Thread Cliff Wells
On Tue, 2006-08-15 at 00:56 -0700, Cliff Wells wrote:


Ah, I got it.  From the docs:

(Auto-enumerated lists are new in Docutils 0.3.8.)

and I've got 0.3.7

Damn.  Thanks for the responses.

Regards,
Cliff

-- 

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


Re: ReStructuredText

2006-08-15 Thread Cliff Wells
On Tue, 2006-08-15 at 16:10 +0800, limodou wrote:
> On 8/15/06, Cliff Wells <[EMAIL PROTECTED]> wrote:
> > On Tue, 2006-08-15 at 16:02 +0800, limodou wrote:
> > > On 8/15/06, Cliff Wells <[EMAIL PROTECTED]> wrote:
> > > > Thanks for the response.  Must be a bug in my version:
> > >
> > > Which version of docutils you are using, in my computer is good.
> > >
> > > u'\nthis is a test\nthis is
> > > another line\noh, screw it!\n\n'
> >
> > >>> docutils.__version__
> > '0.3.7'
> > >>>
> >
> Oh, the newest version is 0.4

Yeah, right after you asked, I tried 0.4, but it failed with a
traceback.  I ended up installing 0.3.9 and it works fine (and didn't
require the list to be indented either, FWIW).

For anyone who cares, the traceback with 0.4 was:

Python 2.4.2 (#1, Feb 13 2006, 15:24:20)
[GCC 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from docutils.core import publish_parts
Traceback (most recent call last):
  File "", line 1, in ?
  File "/usr/lib/python2.4/site-packages/docutils/core.py", line 23,
in ?
from docutils import frontend, io, utils, readers, writers
  File "/usr/lib/python2.4/site-packages/docutils/readers/__init__.py",
line 15, in ?
from docutils.transforms import universal
  File
"/usr/lib/python2.4/site-packages/docutils/transforms/__init__.py", line
69, in ?
class Transformer(TransformSpec):
  File
"/usr/lib/python2.4/site-packages/docutils/transforms/__init__.py", line
78, in Transformer
default_transforms = (universal.Decorations,
AttributeError: 'module' object has no attribute 'FinalChecks'



Regards,
Cliff

-- 

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


Re: What do you want in a new web framework?

2006-08-22 Thread Cliff Wells
On Tue, 2006-08-22 at 08:15 +, Tim Roberts wrote:

> Ordinarily, I think the "do it yourself" nature of Python is a great thing,
> and I would never try to dissuade someone from reinventing something
> themselves.  However, in the case of web frameworks, I believe Marc is
> fundamentally correct: the web framework proliferation in Python is
> actually doing the language a huge disservice.

I disagree.  Even if most of the frameworks end up being nothing more
than research artifacts, the fact is they embody research.  Without
research the Python web framework space will be forever relegated to
runner-up (and probably has-been at some point).

> Consider Ruby.  If someone asks, "I'd like to do a web site with Ruby, what
> should I use?", the answer comes back loud, clear, and unanimous: Ruby on
> Rails.  

Or Wee. Or Nitro. Or Nemo. Or others that are surely to be written as
Ruby gains acceptance and experienced users capable of writing them.

> If someone asks, "I'd like to do a web site with Python, what
> should I use?", she gets 25 different answers.  "Look at HTMLGen, Cheetah,
> WebWare, CherryPy, Karrigell, Django, Pylons, Plone, Zope, TurboGears,
> etc., etc.", none of which are pre-installed in the typical Linux
> distribution.  To the non-programming decision maker, that kind of response
> makes Python look unprofessional -- a toy.

Ruby on Rails doesn't come preinstalled either.  I don't think it's
appropriate (and apparently most Linux distros currently agree) to
install web programming frameworks by default.

I will add that at least a few distros offer TurboGears, Django and
Pylons as add-ons.

> Now, please do not send me ugly emails accusing me of running down Python.
> I've been a Python believer since 1.52.  I've done web sites in at least 5
> of the frameworks, and I even wrote one of the wiki pages that compares web
> frameworks.  However, it is only the fact that I *AM* a true Python
> believer that gave me the patience and incentive to try 5 different
> frameworks.  If a corporate decision maker were involved, that would never
> happen.  Python would simply fall off of the list of options, and the job
> would get done in PHP or Ruby on Rails.

Yes, because PHP has only one web framework too ;-)

> I agree with Marc.  PLEASE do not create "yet another Python web
> framework."  Let's pick one, and join together to turn it into the One,
> True, Unquestioned Web Solution.

Yes, and for those of us who may not like your choice, we can move to
another language or write our own, so nothing will have changed.

I think the entire concept that Ruby on Rails is successful because it
happens to be the dominant solution on what was previously a practically
unknown language is just plain ridiculous. If that's the case then why
hasn't Eiffel taken over the world?  Or Lua?  Or Io?

No, the reason Rails is successful is due to being a decent, focused
product with *great* marketing (screencasts, anyone?).

We've had several good Python web frameworks for some time, but
practically zero marketing (except for Zope/Plone, which as it turns
out, weren't such great products, at least not for the "80% solution"
that Rails targets).  

Also the fact that Ruby doesn't suck isn't hurting Rails any either.  If
GvR wants to improve Python's status against Ruby, I suggest looking at
what people are *really* raving about in the Ruby world (despite how
they got there) and address those issues rather than getting sidetracked
with this nonsense.  


Regards,
Cliff
-- 

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


Re: Can I do this with list comprehension?

2006-08-22 Thread Cliff Wells
On Tue, 2006-08-22 at 21:07 -0700, [EMAIL PROTECTED] wrote:
> b = [2, 4, 6, 8, 10, 12]

>>> a = [0, 1, 0, 1, 1, 0]
>>> b = [2, 4, 6, 8, 10, 12]
>>> [ j for i, j in zip ( a, b ) if i ]
[4, 8, 10]


-- 

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


Re: What do you want in a new web framework?

2006-08-23 Thread Cliff Wells
On Wed, 2006-08-23 at 02:28 -0700, Paul Boddie wrote:
> Cliff Wells wrote:

> > No, the reason Rails is successful is due to being a decent, focused
> > product with *great* marketing (screencasts, anyone?).
> 
> Screencasts? Perhaps, like a great showman, they draw in the punters
> effectively enough, but I'd rather developers concentrate on writing
> decent documentation than stuffing the pipes of the Internet up with
> multi-megabyte proprietary blobs showing some individual developing
> "hello world" (and still having to practise slight-of-hand in order to
> make it "slick" enough).

Well, I think screencasts are pretty great for this type of thing.
Think about the primary complaint: "Which one do I choose?".  It can
take a while to wade through the various documentation (or lack of),
install, do some basic tests, etc and the whole process can be pretty
wearing on a newcomer.  A screencast on the other hand lets you lazily
sip coffee while you get a small feel for the framework.  I think it
also shows what someone who *knows* the framework can do (which can be
nearly impossible to know when you're testing it yourself).  The "20
minute wiki" screencast would be the "2 day trial and error" for someone
new to the framework. 

> 
> [...]
> 
> > Also the fact that Ruby doesn't suck isn't hurting Rails any either.  If
> > GvR wants to improve Python's status against Ruby, I suggest looking at
> > what people are *really* raving about in the Ruby world (despite how
> > they got there) and address those issues rather than getting sidetracked
> > with this nonsense.
> 
> First of all, I'd take the raving from the Ruby scene with a pinch of
> salt, given the tendency of the blog personalities doing the raving to
> breathlessly declare some kind of victory at every turn - as Steve
> Holden once said, these people are good at the "don't mention the
> weaknesses" style of marketing, and that's probably something various
> Python Web framework developers have picked up quite effectively. 

Oh sure.  And you have to also remind yourself that most of these guys
are coming from PHP where practically nothing sucks by comparison (and
there are *lots* of PHP people to convert).  

But there are interesting things in Ruby (and Ruby 2 should take care of
lots of warts Ruby 1.8 has) that Python could learn from.  All-in-all,
Ruby is mostly as good as Python in most ways and better than Python in
a couple key ways.  Add marketing to that (whatever kind it happens to
be) and you've got the recipe for success. 

When I suggest using Python to customers they tend to get nervous as if
it's some esoteric language that might disappear off the map next
weekend and is only known to 12 people.  I shouldn't need to reassure
people that it is what it is: one of the most popular languages in use
today.  That's the other kind of bad marketing that Python should avoid.

> I'd rather the Python core developers stopped chasing shadows and looked at
> the Python distribution in its entirety. Hopefully, the Python 3000
> exercise will see its focus shift into really removing the artifacts of
> legacy decisions in both the language and the library rather than
> shoehorning more wishlist items into the language.

My single wishlist item (which will probably never happen) is actually
the *removal* of a single "feature": the distinction between statements
and expressions.  Forget list comprehensions, ternary operators, etc.
You get them with no additional syntax in expression-based languages.  I
played with Logix a bit (but sadly the project appears dead) and the
expression-based Python syntax it provides gives me goose-bumps.

At this point in my life, inertia keeps me with Python (it's "good
enough" and I lack the time and energy to convert to another language),
but there's little doubt in my mind that this distinction will
eventually force me elsewhere *wipes away tear*.  


Regards,
Cliff

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


Re: What do you want in a new web framework?

2006-08-23 Thread Cliff Wells
On Wed, 2006-08-23 at 22:13 +0200, Peter Maas wrote:
> Alex Martelli wrote:
> > Indeed, it has been truthfully observed that Python's the only language
> > with more web frameworks than keywords.
> > 
> > I have already suggested to the BDFL that he can remedy this situation
> > in Py3k: all he has to do, of course, is to add a LOT more keywords.
> 
> Here is another remedy: he adds one of the frameworks to the standard
> library :)

That didn't help Tk maintain a monopoly on Python GUI toolkits.

Cliff

-- 

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


Re: Unicode/ascii encoding nightmare

2006-11-07 Thread Cliff Wells
On Tue, 2006-11-07 at 08:10 +0200, Hendrik van Rooyen wrote:
> "John Machin" <[EMAIL PROTECTED]> wrote:
> 
> 8<---
> 
> > I strongly suggest that you read the docs *FIRST*, and don't "tinker"
> > at all.
> >

>  This is *good* advice - its unlikely to be followed though, as the OP is 
> prolly
> just like most of us - you unpack the stuff out of the box and start 
> assembling
> it, and only towards the end, when it wont fit together, do you read the 
> manual
> to see where you went wrong...

I fall right into this camp(fire).  I'm always amazed and awed at people
who actually read the docs *thoroughly* before starting.  I know some
people do but frankly, unless it's a step-by-step tutorial, I rarely
read the docs beyond getting a basic understanding of what something
does before I start "tinkering".

I've always been a firm believer in the Chinese proverb:

I hear and I forget
I see and I remember
I do and I understand

Of course, I usually just skip straight to the third step and try to
work backwards as needed.  This usually works pretty well but when it
doesn't it fails horribly.  Unfortunately (for me), working from step
one rarely works at all, so that's the boat I'm stuck in.

I've always been a bit miffed at the RTFM crowd (and somewhat jealous, I
admit).  I *do* RTFM, but as often as not the fine manual confuses as
much as clarifies.  I'm not convinced this is the result of poor
documentation so much as that I personally have a different mental
approach to problem-solving than the others who find documentation
universally enlightening.  I also suspect that I'm not alone in my
approach and that the RTFM crowd is more than a little close-minded
about how others might think about and approach solving problems and
understanding concepts. 

Also, much documentation (including the Python docs) tends to be
reference-manual style.  This is great if you *already* understand the
problem and just need details, but does about as much for
*understanding* as a dictionary does for learning a language.  When I'm
perusing the Python reference manual, I usually find that 10 lines of
example code are worth 1000 lines of function descriptions and
cross-references.

Just my $0.02.

Regards,
Cliff


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


Re: Unicode/ascii encoding nightmare

2006-11-07 Thread Cliff Wells
On Mon, 2006-11-06 at 15:47 -0800, John Machin wrote:
> Gabriel Genellina wrote:
> > At Monday 6/11/2006 20:34, Robert Kern wrote:
> >
> > >John Machin wrote:
> > > > Indeed yourself. Have you ever considered reading posts in
> > > > chronological order, or reading all posts in a thread?
> > >
> > >That presumes that messages arrive in chronological order and
> > >transmissions are
> > >instantaneous. Neither are true.
> >
> > Sometimes I even got the replies *before* the original post comes.
> 
> What is in question is the likelihood that message B can appear before
> message A, when both emanate from the same source, and B was sent about
> 7 minutes after A.

Usenet, email, usenet/email gateways, internet in general...  all in
all, pretty likely.  I've often seen replies to my posts long before my
own post shows up.  In fact, I've seen posts not show up for several
hours.   

Regards,
Cliff



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


Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Cliff Wells
On Wed, 2006-11-08 at 06:49 -0800, Beliavsky wrote:
> Cliff Wells wrote:

> > The LA Times had a story that claimed that 64% of U.S. citizens use the
> > word "fuck" and that 74% of us have heard it in public (I'll assume the
> > remainder are your fellow AOL users).  I expect extrapolating these
> > results worldwide wouldn't be far off the mark (the Brits were quite
> > successful at spreading this versatile word).
> 
> If this is supposed to justify using bad language in a public forum, it
> is poorly reasoned. Having heard "f***" does not mean they were not
> annoyed. 
> 100% of people have seen trash on the street, but that does
> not justify littering. 

Poorly reasoned or not, it was clearly poorly read, since the article I
mentioned also claimed that the majority of people also used the word.
Odd, I'd think with your selective reading skills you'd simply be able
to ignore words you don't like.

Regardless, I think the idea that certain words are profanity is fairly
silly.  They are words.  It's the meaning and intent behind them that
can be offensive.  If someone says "fuck off" then I'd expect you to be
offended *since that was the intent of the message* (of course if you
manage to not be offended then that makes you the better man, but
apparently that's rarely strived for).  On the other hand if someone
says "that's fucking great" in a positive way and you are offended by
it, well I'd say that's *your* problem and your best bet is to turn off
your TV, your PC, your radio, stop reading and try to limit interactions
with other people lest you be overwhelmed by how they really speak and
act.

> If a group of people don't mind profanity, there
> is no harm in their swearing to each other. But Usenet is read by a
> wide range of people, and needlessly offending some of them is wrong.

I halfway agree with you.  I tend to limit my profanity in public forums
and when speaking to strangers, etc.  On the other hand, when in public
I also expect to hear that language from others and am not offended by
it.  

And expecting anyone to escape without offense on Usenet is pretty
unrealistic.

> The OP used "f**" just for emphasis. English is a rich language,
> and there are better ways of doing that.

Hm, lots of people disagree with you.  In fact, simply because that word
*does* happen to be less widely used in this group it gave it extra
emphasis and was probably the most effective word he could have used in
this particular instance.  I don't think anyone here will have forgotten
his endorsement anytime soon.

Incidentally, using  to disguise "profanity" when the intended word
is perfectly understood is pretty silly too.  I strongly suspect you'd
be just as offended if I said "f*** off" as if I'd typed it out.  Once
again, intent and meaning are what matter rather than a particular
sequence of characters.

Regards,
Cliff

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


Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Cliff Wells
On Wed, 2006-11-08 at 10:12 -0800, Carl J. Van Arsdall wrote:
> BartlebyScrivener wrote:

> > I agree. And Python is an extremely serious matter calling for decorum
> > and propriety.
> >   
> Lol, is it really now?  And I suppose its your definition of decorum and 
> not mine right?  Things like that are always relative.  I think decorum 
> would state that you should be an adult and not make a big deal out of 
> nothing.  But that's just me, and as I said, its all relative.

I think you missed the irony in his statement (or perhaps confused
BartlebyScrivener with Beliavsky, who was the original plaintiff).

Regards,
Cliff

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


Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Cliff Wells
On Wed, 2006-11-08 at 10:42 -0800, Paddy wrote:

> I too know your wrong Aahz. The written word is not the same as that
> spoken. People should make an effort to put across their meaning in a
> clear manner. If I were going to an interview I would be very careful
> about swearing and most likely not do it. People complain about the
> friendliness and tone of groups, and mention it when talking about
> programming languages.

But of course, this was never about "friendliness or tone".  The person
who uttered the dreaded word was actually speaking quite positively
about Pyro.  The complaint was about the use of a particular word, not
the intent of it.

> Not everyone swears like Eddy Murphy in Beverley Hills Cop, and a lot
> of those that do, would not do so when they want to impress, or
> communicate with a stranger.

But of course "not everyone" is a double-edged sword that can just as
easily be turned against either party.  If we limit ourselves to saying
what is going to be the most palatable for the widest audience we will
most likely find ourselves confined to discussing the weather. 

And of course, people who worry too much about impressing others rarely
do.  Just ask DHH of Ruby on Rails fame:

http://static.flickr.com/47/127984254_ddd4363d6a_m.jpg

Personally I find people trying to impose their personal beliefs on
others to be at least as offensive as any particular swear word and
about a million times as dangerous.  

> P.S. I did a google search and found 540,000 hits for python in c.l.p.
> and only 121 for f***. thats less than one in a thousand. Lets keep it
> that way please.

Well, I think that's a good point: the one instance we had that spawned
this thread fell well within this "one-in-a-thousand" boundary.  So
there was no indication that c.l.py was in danger of turning into a
sailor's bar.  

I'll apply an old software maxim (from sendmail?) to the topic of public
interaction: "Be liberal in what you accept, conservative in what you
send."  Applying this would suggest that both parties were equally at
fault in this situation, so perhaps we can just leave it at that.  

Regards,
Cliff


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


Re: profanity on comp.lang.python (was Re: Pyro stability)

2006-11-08 Thread Cliff Wells
On Wed, 2006-11-08 at 11:18 -0800, Aahz wrote:
> In article <[EMAIL PROTECTED]>,
>  <[EMAIL PROTECTED]> wrote:
> >
> >I'm with Beliavsky on this one.  I can't see any particular reason to curse
> >in a forum such as c.l.py.  It just coarsens the discussion with no obvious
> >positive benefit as far as I can see.
> 
> Actually, I do agree that profanity "should" be avoided on c.l.py; what
> I disagree with rather vociferously is having language police like
> Beliavsky.  I consider Beliavsky's offense far worse than the original
> post.

I think this sums up my point of view as well (although I would have
used around 3215 more words to say it). 

Cliff


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


Re: What do you want in a new web framework?

2006-08-23 Thread Cliff Wells
On Thu, 2006-08-24 at 04:04 +, Tim Roberts wrote:
> Cliff Wells <[EMAIL PROTECTED]> wrote:
> >
> >But there are interesting things in Ruby (and Ruby 2 should take care of
> >lots of warts Ruby 1.8 has) that Python could learn from.  All-in-all,
> >Ruby is mostly as good as Python in most ways and better than Python in
> >a couple key ways.
> 
> ...but you can't READ Ruby code.  

Yeah, that's one of the big reasons I haven't seriously considered
trying it.  It's expressive, got interesting features... and appears
unreadable to me.  I'm usually pretty good at deciphering most
languages, even if I haven't used them before, but Ruby is one of the
exceptions.

> One of the things I like best about
> Python is that, like Cobol, you can read Python code like prose (or poetry
> ;) and, for the most part, know what the code does, even without being a
> Python guru.  I have not had the same experience with Ruby.  There are
> special characters in there that make the program say something I can't
> immediately discern.

There's the line noise aspect, but also some things are just expressed
in what appears (to me) to be rather non-idiomatic ways.  But I suppose
it depends on your background.  A rather brilliant friend of mine with a
Smalltalk background thinks that the Ruby reads like a novel. Shrug. He
also reads Japanese, so maybe that's a factor ;-)

> To be sure, people whose opinions I trust (one of whom is Cliff Wells) have
> said that Ruby is great, so I suppose I need to look again.  I just haven't
> had the same "aha!" experience that I had with Python.

Thanks for the vote of confidence. I have lots of opinions, but even I
only trust a few of them ;-)

I think Ruby has great things and I'm certain it's a great fit for many
people.  But I'm with you 100% on Python's readability.  I just wish we
could have the great things from both.

This brings us back around to the web framework debates.  For many
people Ruby "fits" their brains and for others Python does.  I think
frameworks are similar.  I tried Django and while I thought it was a
great product, it simply didn't "fit" how I think about that problem
domain.  TurboGears on the other hand did, and really, it helped clarify
a few things I had vague notions about.  I think we'll do better not
trying to shoehorn people into one or the other.

Regards,
Cliff
-- 

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


Re: What do you want in a new web framework?

2006-08-24 Thread Cliff Wells
On Thu, 2006-08-24 at 04:28 -0700, Paul Boddie wrote:
> Cliff Wells wrote:
> > On Thu, 2006-08-24 at 04:04 +, Tim Roberts wrote:
> > > Cliff Wells <[EMAIL PROTECTED]> wrote:
> > > >
> > > >But there are interesting things in Ruby (and Ruby 2 should take care of
> > > >lots of warts Ruby 1.8 has) that Python could learn from.  All-in-all,
> > > >Ruby is mostly as good as Python in most ways and better than Python in
> > > >a couple key ways.
> 
> The big difference between Ruby and Python is the lifecycle phase that
> the languages/systems are in: Ruby arguably has room for a lot of basic
> improvements in the architecture of the virtual machine and presumably
> has a list of "must add" features that cover gaping holes with respect
> to certain audiences [1], whereas Python has been around for ages and
> has covered most of the critical gaps in the feature list (although we
> can always suggest things which bother our own part of the community).
> Whereas the Ruby people merely have to agree on how critical their
> missing features are and to move in one widely agreed direction, the
> Python people face a tougher choice as to what should be done next;
> strategies include a tidying-up exercise to make the language more
> coherent, a complete reimplementation, deep modifications to the
> runtime, the introduction of radical new semantics.

All true, but there's a more fundamental difference that's going to show
more as a larger number of people become used to Ruby's semantics: any
Ruby statement can be used as an expression.  This is firmly from the
Lisp family of languages whereas Python's statement-based syntax is
firmly in the Fortran branch.  With the exception of Lisp itself, no
language has seen the popularity of this style of programming until
Ruby.  I think this represents a real danger to Python's mindshare.
Once people have tried expression-based languages, they tend to be
loathe to return to statement-based languages.  To date,
expression-based languages have been mostly of interest in academia or
to a small group of elitists and so weren't practical to use for
day-to-day work.  Ruby has changed that and I think we're just starting
to see the fallout.  Rails may have brought them there, but Ruby itself
is keeping them there.  My fear is that the expression-based family of
languages is the Homo Sapiens to our statement-based Neanderthals and we
can either evolve or disappear.  Python is unique in many ways and I'd
hate to see those unique features lost because we're stuck on the wrong
evolutionary branch.

> The fewer obvious issues that a language has, the less energy there is
> in the community to deal with those issues thoroughly, I think. I guess
> the Perl community chose a bold new direction in line with the
> observation that a big vision can inspire much more in people than lots
> of incremental changes to an existing vision, but the energy required
> to follow through on such a vision can be immense. In addition to all
> this, a large existing community is more likely to want larger benefits
> for smaller levels of disruption because of the amount of existing
> code. Thus, the available energy for change is less in a mature project
> than in a growing project because people have to constantly monitor the
> breakage in their existing investments in the language.
> 
> > > ...but you can't READ Ruby code.
> >
> > Yeah, that's one of the big reasons I haven't seriously considered
> > trying it.  It's expressive, got interesting features... and appears
> > unreadable to me.  I'm usually pretty good at deciphering most
> > languages, even if I haven't used them before, but Ruby is one of the
> > exceptions.
> 
> My feeling is that I'd rather learn more about Lisp or Scheme than Ruby
> - the benefits are greater and for me Lisp and Scheme increasingly have
> the edge on readability. Perhaps I'm just not "tuned in" to
> Smalltalk-style syntaxes.

I'm in the same camp.  As I mentioned earlier, it's been mostly inertia
and the wealth of the Python community that's kept me with Python.
That's why I was so excited when I found Logix.  Lisp-like features with
Python's syntax that generates Python bytecode.  Actually Logix is
perhaps too far the other direction as it supports Lisp-style macros and
the creation of arbitrary syntax, which perhaps would justify some of
the fears people have of Lisp-like languages.  
The part I found appealing was having Python-like syntax in an
expression-based language, with the capability to integrate completely
with Python libraries.  Absolutely the best of both worlds.  I've been
trying to contact the author of 

Re: Python Syntax Highlighting Module

2006-08-24 Thread Cliff Wells
On Mon, 2006-08-21 at 08:19 -0700, gene tani wrote:
> [EMAIL PROTECTED] wrote:
> > Hello,
> > I have an idea for a project which involves an editor that supports
> > syntax highlighting.  This would be for any language, particularly php,
> > html, css, etc.  I would like to write this program using python.  It
> > would only make sense to base this upon existing open source code.  My
> > question is there a python module or examples on how to write a code
> > editor which supports modulated syntax highlighting?
> >
> > Thank you,
> > Blaine
> 
> just a *few* examples

If I were to start a GUI editor project, I'd undoubtedly start by
looking at Scintilla:

http://www.scintilla.org/

Also see:
http://scintilla.sourceforge.net/ScintillaRelated.html

Regards,
Cliff
-- 

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


Re: Out-dated compiled modules (*.pyc)?

2006-08-26 Thread Cliff Wells
On Sat, 2006-08-26 at 18:54 +, Dennis Lee Bieber wrote:

>   Normally, Python compares the date stamps of the files (and maybe
> some internal magic values) and only rebuilds the .pyc if the .py is
> newer.

Perhaps the OP should check both the system date on his PC and the
timestamp on the pyc files in question.

Cliff


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


Re: avoiding file corruption

2006-08-28 Thread Cliff Wells
On Sun, 2006-08-27 at 07:51 -0700, Amir Michail wrote:

> How often do you need to open a file multiple times for writing?

How often do you write code that you don't understand well enough to
fix?  This issue is clearly a problem within *your* application.

I'm curious how you could possibly think this could be solved in any
case.  What if you accidentally open two instances of the application?
How would Python know?  You are asking Python to perform an OS-level
operation (and a questionable one at that).

My suggestion is that you use a real database if you need concurrent
access.  If you don't need concurrent access then fix your application.

> As a high-level language, Python should prevent people from corrupting
> data as much as possible.

"Data" is application-specific.  Python has no idea how you intend to
use your data and therefore should not (even if it could) try to protect
you.

Regards,
Cliff

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


Re: Pros/Cons of Turbogears/Rails?

2006-08-31 Thread Cliff Wells
On Thu, 2006-08-31 at 23:31 +0200, BJörn Lindqvist wrote:
> On 8/31/06, Jorge Vargas <[EMAIL PROTECTED]> wrote:
> > On 31 Aug 2006 08:24:29 -0700, Adam Jones <[EMAIL PROTECTED]> wrote:
> >
> > Someone ones said on the mailing list TG is the Ubuntu of web
> > frameworks, and I think I'll add and you can strip down the kernel and
> > it wont break :)
> 
> But that is not really true. If you use Cheetah instead of Kid, you
> lose out: No widgets,

Untrue.  Even though I don't use widgets much myself, I wanted to make
sure they *could* be used with TurboStan, so I did a quick test with
Kevin's autocomplete widget.  Worked fine.  I can't see why Cheetah
would be any different.

>  no auto-generated code 

What auto-generated code?  The example templates that you get with 
quickstart?  Hardly a loss.

> and the (incomplete)
> documentation won't apply anymore (it assumes Kid templates ofcourse).

True.  However I've had little trouble translating from Kid to Stan (and
that's probably a longer jump than from Kid to Cheetah).

> If you use SQLAlchemy instead of SQLObject, no identity framework,

Completely false.

>  no administrative tools (tg-admin sql, 

True. 

> CatWalk etc

True.  

> ) and no documentation.

Partially true.  The documentation exists but some of it is out-of-date
and it was never very complete to begin with.  Of course, like many OSS
projects, the mailing list is your best resource and SQLAlchemy itself
has quite good documentation.

> If you use prototype instead of MochiKit... I have no idea what
> happens 

You get Prototype instead of MochiKit.

> and using another webserver than CherryPy isn't possible right
> now, I guess?

Not that I'm aware of.  Nor do I think it would make much sense since
CherryPy is the heart of TurboGears.  I typically use CherryPy to serve
the dynamic content and a real webserver (Nginx) to serve static files.
I've never felt this was a handicap.

> In fact, if you decide to replace so many modules that TurboGears
> depend on, what do you gain in using TurboGears at all? 

If you got to the point where you were replacing more parts than you
were using, then you'd certainly want to find a different framework as
TurboGears is clearly not for you.  I fail to see your point.

Personally I've chosen to go a different route on a couple things and
leave the rest intact.  I expect most people are the same.  With most
frameworks, there's typically one or two things most people don't like
and it's nice to be able to replace those things without a lot of fuss.
I don't see how that's a liability.

> It seems like
> the TurboGears developers have a lot of work to do, (and a lot of
> documentation to write) if they want to make their framework as easy
> to use as others (ie: Django) that takes a more holistic approach.

That's odd, because I've actually used both and found TurboGears far
easier to get started with (no mucking about with Apache and mod_python
for one thing, no need to setup explicit url regexes just to get "hello,
world" on a page).  

Judging from your above comments it sounds to me like you're mostly
speculating about TurboGears.

> TurboGears more seem to be like emacs than Ubuntu - infinitely
> customizable...

Not quite enough IMO, but close enough.

> In the future both Rails and TurboGears will probably be great. But
> since someone mentioned Rails moving to YARV, and TurboGears moving to
> SQLAlchemy and Markup, it seems to me that they are both in a state of
> flux and not quite ready yet.

TurboGears is certainly in a state of flux although from an outside
(i.e. API) standpoint it's not nearly as bad as you might think from the
changes that have gone on under the hood.  There's been only a few
breaking changes up til now (I converted a site I'd built on 0.8 to the
latest SVN last night and most of the issues I encountered were with my
own changes to TurboStan).

Regards,
Cliff

-- 

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

Re: Pros/Cons of Turbogears/Rails?

2006-08-31 Thread Cliff Wells
On Thu, 2006-08-31 at 09:04 -0700, Paul Boddie wrote:

> SkunkWeb (3.4.0), Zope (2.9.4 and 3.2.1), Plone (2.5), Karrigell (2.3),
> CherryPy (2.2.1), Spyce (2.1), QP (1.8), Cymbeline (1.3.1), Django
> (0.95), Webware (0.9.1), Pylons (0.9.1), TurboGears (0.8.9), PyLucid
> (v0.7.0RC4), Paste (0.4.1), web.py (.138)

And ironically, the one with the *lowest* version number (web.py) is
used to power some fairly large (and ambitious) public projects:

https://www.youos.com/ ( see http://blog.youos.com/?p=49 )
http://reddit.com/

I'd like to claim that in OSS, version numbers mean little, but I still
recall Windows NT 1.0 (er, I mean 3.1), so I guess they don't mean much
anywhere.  Version numbers are *picked* by project leads for varying
reasons, so comparing version numbers from different projects is pretty
pointless.  Is Windows 2000 more stable than Linux 2.6?  It ought to be
since it's 769 times more mature, right?  Even if you called it Windows
NT 5.0, I'd have to wonder if it's even twice as stable (I'm being
intentionally generous here, so bear with me).

Personally I tend to look at what the users (especially former users)
say about a project and what's been or being done with that project.  If
it seems promising, I try it.  I can't think of any other reasonable way
of making that decision.

Regards,
Cliff

-- 

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


Re: python-database

2006-09-03 Thread Cliff Wells
On Sun, 2006-09-03 at 21:30 -0700, sridhar wrote:
> is there any way to call stored procedures from python as in java?

I mostly use PostgreSQL, so perhaps it's different for some other
databases, but calling stored procedures doesn't require any special
support from the language or driver.  Usually you simply SELECT from the
stored procedure.

Also, you might be interested to know that with PostgreSQL you can also
*write* stored procedures in Python which I consider a huge plus.

Regards,
Cliff

-- 

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


Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread Cliff Wells
On Tue, 2006-09-12 at 13:01 +0200, Fredrik Lundh wrote:
> Mike Owens wrote:
> 
> > Crackpot? And now we get to why I took the flamebait -- wonderfully
> > constructive comments such as this.
> > 
> > I know SQLite's author. Besides being a nice and clearly very
> > intelligent person, he also holds a master's degree in electrical
> > engineering from Georgia Tech and a PhD in computer science from Duke
> > University. His "crackpot" software is used by Sun, Apple, Symbian,
> > Google, AOL, Philips, DLink, and I don't know how many other
> > companies, not to mention countless open source projects such as
> > Mozilla, PHP, and now Python.
> 
> but is he a member of Mensa?


Now *there's* a group of crackpots.


Cliff
-- 

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


Re: best small database?

2006-09-12 Thread Cliff Wells
On Mon, 2006-09-11 at 13:23 +, David Isaac wrote:
> I have no experience with database applications.
> This database will likely hold only a few hundred items,
> including both textfiles and binary files.
> 
> I would like a pure Python solution to the extent reasonable.

Since no one's mentioned it:

http://schevo.org/trac/wiki

-- 

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


Re: best small database?

2006-09-12 Thread Cliff Wells
On Tue, 2006-09-12 at 12:29 -0700, Kay Schluehr wrote:

> Just one stupid remark since the limits of my language are the limits
> of my world: I've not the slightest association with the seemingly
> nonsense word "buzhug" and don't even know how to pronounce it
> correctly. Would you have the kindness to enlighten me/us ?

I simply assumed it was "guhzub" backwards.

Cliff

-- 

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


  1   2   3   4   >