Re: Python dutch

2005-08-22 Thread Harald Massa
Sybren Stuvel ,

 I'd suggest learning English. The programming language is based on
 English anyway. 

There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.

To be even more exact, it would help to learn or even be Dutch to program 
in Python, as those quoted lines out of the ZEN might suggest.

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


Re: Py: a very dangerous language

2005-08-01 Thread Harald Massa
yoda 

 It was 6 a.m just one more lambda...I'll really sleep
 now...seriously... I've got to go to work in a few hours

I also love Python deeply, and really enjoyed the intense description of 
your experience. One experience I won and wanna share with you: allways go 
to bed exactly when you want to write the first lambda.

That has 2 benefits: you get sleep, and your programs less lambda.

Harald


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


Re: Java RMI-like services in Python

2005-07-18 Thread Harald Massa
Maurice LING [EMAIL PROTECTED] wrote in news:dbfmbq$e49$1
@domitilla.aioe.org:
 I am wondering if Python has services or frameworks that does the same 
 as Java RMI?

google for pyro

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


Re: Dealing with marketing types...

2005-06-10 Thread Harald Massa
 They want a 
 scalable, enterprise solution (though they don't really know what
 that means) and are going crazy throwing around the Java buzzwords
 (not to mention XML).
 
There is a very cheap solution: Ryan Tomayko debunkes all these myths.
You can google it up, astronaut architects 

There is a cheap solution: on this years EuroPython (www.europython.org)
there will be a special Slot in Social Skills track dealing with
Selling Python, giving you a Python Sales Pitch and two more excellent
seminars about persuading people. More than that, in Python in Business
Track we will do slots about using Python for real worthy enterprise
apps which scale and are FULLY buzzword-compatible. 

Join us!

Harald Armin Massa
GHUM Harald Massa
perusasion. python. postgresql.


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


Re: query progress bar

2005-05-16 Thread Harald Massa
 it's for wx, the problem isn't making the progress bar itself, it's 
 knowing how long the query is going to run for.
 i'm using pypgsql

It is quite easy:

from timemachine import oracle

guesser=oracle(guess=SQL)
guesser.set_hint(driver=pypgsql)
guesser.set_hint(gui=wx)

expected_runtime=guesser.estimate(put your query text here)

Only problem is that the timemachine module is currently only installed 
on Guidos and Tims Python.

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


Re: a=[ lambda t: t**n for n in range(4) ]

2005-04-23 Thread Harald Massa
Mage [EMAIL PROTECTED] wrote in news:mailman.2339.1114242211.1799.python-

 The lambda functions was an unclear part of the tutorial I read.
 Should I use them? Are they pythonic?
 As far I see they are good only for type less a bit.

And to obfusicate code. lambda is evil, do not play with it.

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


Re: Example Code - Named Pipes (Python 2.4 + ctypes on Windows)

2005-03-26 Thread Harald Massa
Srijit Kumar Bhadra [EMAIL PROTECTED] wrote in
 Here is an example of Multithreaded Pipe Server and Client using the
 excellent ctypes library (Windows).

Excellent. Maybe you would also like to post it to the

http://starship.python.net/crew/theller/moin.cgi/CtypesModule

Ctypes-Wiki for easier reference?

best regards,

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


Re: Beware complexity

2005-03-13 Thread Harald Massa
Philip,

more often than not, all needed was included in Python years ago. 

Especially:

 I wonder if anyone has any thoughts not on where Python should go but
 where it should stop?

The answer is included within the standard library. On any Python command 
prompt type:

import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

 Nothing wrong with coding conventions of course unless you:
 
So coding conventions are more or less rendered as something of ancient 
times; Python has its Zen. (of course, as I said, included in the 
standard library)

And: the fear that Python gets extended over sensible bounds maybe real. 
But: Just have a look within python.devel, what happens on any (pun 
intended) extension to builtins: It's a gentle and polite, nontheless 
strong and hard discussion; a real evolutionary survival test.

Python is a healthy tree: it grows. But Guido and the Bots are 
thoughtfull gardeneres: they are not afraid to cut bad branches.

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


Re: How to send browser to open a different URL

2005-03-12 Thread Harald Massa
Mike Wimpe [EMAIL PROTECTED] wrote in news:1110628448.532469.117000
@g14g2000cwa.googlegroups.com:

http://groups.google.de/groups?hl=delr=c2coff=1threadm=
2c60a528.0309251324.109d4af5%40posting.google.comrnum=5prev=/groups%3Fq%
3Dhttp%2520redirect%2520header%2520python%26hl%3Dde%26lr%3D%26c2coff%3D1%
26sa%3DN%26tab%3Dwg

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


Re: head for grouped data - looking for best practice

2005-03-12 Thread Harald Massa
Steve,


 Why don't you just pass a slice to itemgetter?
py for key, bereich in groupby(eingabe, itemgetter(slice(0, 2))):


WHOW, that is great! that makes it really simple, just have to structure 
the SQL to make a real cut first, serve first structure.

Thanks to all who helped!

also the function factory function bei Dietz was very helpfull; and 
Peters classes looked really impressive!

Thanks again... now my code will be even clearer.

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


Re: overwriting method in baseclass

2005-02-09 Thread Harald Massa
marc,

 So HOW can SVN be of any use for THIS prob?
 
 Take a look at the Subversion documentation (the book) and search
 for `Vendor branches`.
 
[...]
 The section deals specifically with the situation how to manage 3rd
 party source code with subversion which you want to update from time
 to time and even apply some modifications.

thank you very much for pointing this out! I did not even dare to hope to 
find sth. of this kind with a rcs for MY software.

So I did not even start searching.

Thank you,

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


Googling for wmi and python....

2005-02-06 Thread Harald Massa
I upgraded Python to 2.4

now the game really starts, looking all over the internet for all the 
packages ... I needed Tim Goldens WMI ... and googeld, dropping there:


http://www.microsoft.com/technet/scriptcenter/scripts/python/misc/wmi/defau
lt.mspx

With comment: Sample scripts for retrieving WMI configuration information. 
These sample scripts were written using Python for Windows. For sample 
scripts written using VBScript, please visit the Script Repository home 
page.


And that is above Tims GREAT WMI.module ... 

just wanted to drop that note.
-- 
http://mail.python.org/mailman/listinfo/python-list


overwriting method in baseclass

2005-02-06 Thread Harald Massa
Hello!

I am using a library (= code of so else) within Python. Somewhere in this 
library there is:

class foo:
def baa(self, parameters):
 print something
 self.baazanan(some other parameters)


class mirbo(foo):
  def baazanan(self, lalala):
  print heylo tada

class fujiko(foo):
  def baazanan(self, ltara):
  print sing a song with me





now I want to change the common baa-method. so that

def baa(self, parameters):
  print soemthing special
  self.baazanan(some other parameters)

Of course, I use a Python- and GPL-Licence compatible library, I can 
change the source of foo, and use my changed library.

But someday, it happened before, there will be an update by the publisher 
to that library and I have to do all again.

So, what is the most elegant solution to administer these changes? 

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


Re: py2exe problem

2005-01-26 Thread Harald Massa
Grant Edwards 

 LookupError: no codec search functions registered: can't find encoding
 Googling for the error message will find you the answer.  

http://starship.python.net/crew/theller/moin.cgi/Py2Exe

carries within encodings and encodings again receipes to get it 
working.

A software development system which REALLY solves the encodings problem 
WITHOUT creating a swarm of new ones could would challange even my 
devotedness to Python :

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


Re: py2exe problem

2005-01-26 Thread Harald Massa
Thomas Heller [EMAIL PROTECTED] wrote in
news:[EMAIL PROTECTED]: 


 A software development system which REALLY solves the encodings
 problem WITHOUT creating a swarm of new ones could would challange
 even my devotedness to Python :
 
 AFAIK, McMillan Installer solves this by including all the encodings
 stuff by default, and it has a --ascii flag to override this
 behaviour. Would that be a solution?

Thomas,

I solved the headaches with py2exe and encodings, again and again ...
even documented some of these steps within the wiki. 

But encodings still give me new pain any day: storing filenames to
databases, displaying filenames in windows-controls, sending
database-extracts to excel or word ... time on time encodings and/or
unicode errors pop up and cause me misery. 

So my cryout is for a solution for all encoding-problems like the python
for-loop or list-comprehensions: elegant, simple, robust, flexible. Easy
to use, easy to implement. 

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


Re: pyPgSQL giving error!

2005-01-13 Thread Harald Massa
 I am using Redhat 9.0/python2.3. I installed pyPgSQL-2.4.tar.gz and it
 was successfull. Now when I am trying to import that module, I got:
 Type help, copyright, credits or license for more information.
 from pyPgSQL import PgSQL
 Traceback (most recent call last):
   File stdin, line 1, in ?
   File pyPgSQL/PgSQL.py, line 391, in ?
 from libpq import *
   File pyPgSQL/libpq/__init__.py, line 23, in ?
 from libpq import *
 ImportError: No module named libpq

did you really do ./configure, make and make install?

where is libpq.*

was a postgres installation present while doing ./configure et all?

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