Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Alex Martelli
Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-06-12, Antoon Pardon <[EMAIL PROTECTED]> wrote: > > On 2007-06-11, Terry Reedy <[EMAIL PROTECTED]> wrote: > >> More so than supporters of most other languages, in particular > >> Scheme? > > > > Well to my knowledge (which could be vastly improved)

How to localize PyKaraoke ?

2007-06-15 Thread Eiwot
Hi all, Can I use PyKaraoke in another language such as German ? How to make a song lyrics that match with the song , any word break or phrase break algorithm required ? Thanks Eiwot http://pyarticles.blogspot.com/ http://pythonforge.blogspot.com

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Paul Rubin
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > Adding generator expressions, which look identical except that one > typically has () (or the () of an enclosing function call) while the > other must have [] just seems to add confusion to the world. I'll > abstain on "with"... Decorators I've

Re: Want to learn Python

2007-06-15 Thread Alex Martelli
7stud <[EMAIL PROTECTED]> wrote: ... > The reference book "Python in a Nutshell" is excellent, however its > index is so bad I hesitate to recommend it. A reference book should > have a thorough index--you shouldn't have to hunt through the chapters > trying to find the particular topic you are

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > > You are ignoring the fact that > This prefactory clause is false and as such it turns what was a true > statement into one that is not. Better to leave off such ad hominisms and > stick with the bare true statement. You went on about how Gerry Sus

Open Source Developers' Conference 2007 - Brisbane - Call for Papers

2007-06-15 Thread Richard Jones
Call for Papers Open Source Developers' Conference 2007 - Brisbane Australia "Success in Development & Business" OSDC is an Australian grass-roots conference providing Open Source developers with an opportunity to meet, share, learn, and of course show-off. OSDC focuses on Open Source develope

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Douglas Alan
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Fri, 15 Jun 2007 17:05:27 -0400, Douglas Alan wrote: >> You are ignoring the fact that Scheme has a powerful syntax extension >> mechanism (i.e., hygenic macros), which means that anyone in the world >> can basically extend Scheme to include practi

Re: Looking for a wxPython GUI builder

2007-06-15 Thread Jens Thiede
On Jun 16, 3:18 am, Dick Moores <[EMAIL PROTECTED]> wrote: > How about SPE? > > Any others? > > And which ones do people > actually use? Commercial or Freeware. > > Thanks, > > Dick Moores There's Boa Constructor... (http://boa-constructor.sourceforge.net/ Screenshots). I haven't actually used it

Custom wxPython Widget

2007-06-15 Thread Jens Thiede
What is the best source code to read? Any tips; suggestions? Thanks in advance Jens Thiede -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Terry Reedy
"Douglas Alan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | "Terry Reedy" <[EMAIL PROTECTED]> writes: | | > Here's the situation. Python is making inroads at MIT, Scheme home turf. | > The co-developer of Scheme, while writing about some other subject, tosses | > in an off-the

Re: Multiline lamba implementation in python.

2007-06-15 Thread Josh Gilbert
On Wednesday 13 June 2007 4:04 am, Duncan Booth wrote: > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > But you already have "multiline" lambdas right now in that sense, no > > need to add anything. I think you were talking about lambdas *with* > > statements inside. > > > > bin = lambda x:((

Re: Should: "for k,v in **dictionary_instance" work?

2007-06-15 Thread Steven D'Aprano
On Fri, 15 Jun 2007 19:17:25 +, keithgabryelski wrote: > Does it make sense to provide this syntax for iterating key/value > pairs from a dictionary? > > for k,v in **dict(): >print k,v > > why is this not the same as: > > for k,v in dict().items(): > print k,v Because *t and **d alre

Re: Want to learn Python

2007-06-15 Thread BartlebyScrivener
On Jun 15, 6:41 am, Amol <[EMAIL PROTECTED]> wrote: > Hi, I want to learn Python in less than a month which resources should > I use. I prefer to read books . Please give me a list of *recognized* > resources. Thank You all Python Essential Reference, David Beazley, 3rd edition Feb 2006 great, esp

Re: Want to learn Python

2007-06-15 Thread Jack Crane
Amol <[EMAIL PROTECTED]> wrote in news:1181907696.878873.214760 @i13g2000prf.googlegroups.com: > Hi, I want to learn Python in less than a month which resources should > I use. I prefer to read books . Please give me a list of *recognized* > resources. Thank You all > http://www.pythonware.com/d

Re: Html parser

2007-06-15 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, Stephen R Laniel <[EMAIL PROTECTED]> wrote: > On Fri, Jun 15, 2007 at 07:11:56AM -0700, HMS Surprise wrote: > > Could you recommend an html parser that works with python (jython > > 2.2)? > > I'm new here, but I believe BeautifulSoup is the canonical > answer: >

Looking for a wxPython GUI builder

2007-06-15 Thread Dick Moores
How about SPE? Any others? And which ones do people actually use? Commercial or Freeware. Thanks, Dick Moores -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Steven D'Aprano
On Fri, 15 Jun 2007 17:05:27 -0400, Douglas Alan wrote: > You are ignoring the fact that Scheme has a powerful syntax extension > mechanism (i.e., hygenic macros), which means that anyone in the world > can basically extend Scheme to include practically any language > feature they might like it to

Re: Want to learn Python

2007-06-15 Thread 7stud
On Jun 15, 11:59 am, "Evan Klitzke" <[EMAIL PROTECTED]> wrote: > On 6/15/07, Amol <[EMAIL PROTECTED]> wrote: > > > Hi, I want to learn Python in less than a month which resources should > > I use. I prefer to read books . Please give me a list of *recognized* > > resources. Thank You all > > The Ap

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Kay Schluehr
On 15 Jun., 22:58, Douglas Alan <[EMAIL PROTECTED]> wrote: > For instance, I believe that Python is now too big, and that much of > what is in the language itself should be replaced with more general > Scheme-like features. > Then a good macro mechanism should be > implemented so that all the conv

Re: Should: "for k,v in **dictionary_instance" work?

2007-06-15 Thread Dustan
On Jun 15, 2:17 pm, [EMAIL PROTECTED] wrote: > Does it make sense to provide this syntax for iterating key/value > pairs from a dictionary? > > for k,v in **dict(): >print k,v > > why is this not the same as: > > for k,v in dict().items(): > print k,v > > for that matter, why the heck doesn't

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Douglas Alan
Kay Schluehr <[EMAIL PROTECTED]> writes: > On 15 Jun., 22:58, Douglas Alan <[EMAIL PROTECTED]> wrote: >> For instance, I believe that Python is now too big, and that much >> of what is in the language itself should be replaced with more >> general Scheme-like features. Then a good macro mechanis

Re: Should: "for k,v in **dictionary_instance" work?

2007-06-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, keithgabryelski wrote: > Does it make sense to provide this syntax for iterating key/value > pairs from a dictionary? > > for k,v in **dict(): >print k,v > > why is this not the same as: > > for k,v in dict().items(): > print k,v Why should it be? Why adding some

Re: Get the current date, python 2.2

2007-06-15 Thread Rob Williscroft
On Fri, 15 Jun 2007 14:46:20 -0700, nano wrote: > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > says... >> On Fri, 15 Jun 2007 14:30:36 -0700, nano wrote: >> >> > Using python 2.2 what is the simplest way to get the current date >> > value? I have looked in so many places. The question is o

Re: Priority Queue with Mutable Elements

2007-06-15 Thread Josiah Carlson
Chris Lasher wrote: > I am working with large graphs (~150,000 to 500,000 nodes) which I > need decompose node-by-node, in order of a node's value. A node's > value is determined by the sum of its edge weights. When a node is > removed from the graph, its neighbors' values must be updated to take >

Re: Get the current date, python 2.2

2007-06-15 Thread nano
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > On Fri, 15 Jun 2007 14:30:36 -0700, nano wrote: > > > Using python 2.2 what is the simplest way to get the current date value? > > I have looked in so many places. The question is often asked and the > > usual response indicates how to g

Re: Get the current date, python 2.2

2007-06-15 Thread Yongjian Xu
time.strftime('%Y-%m-%d', time.localtime()) gives you just the date format. Jim On 6/15/07, nano <[EMAIL PROTECTED]> wrote: Using python 2.2 what is the simplest way to get the current date value? I have looked in so many places. The question is often asked and the usual response indicates how

Re: Get the current date, python 2.2

2007-06-15 Thread Rob Williscroft
On Fri, 15 Jun 2007 14:30:36 -0700, nano wrote: > Using python 2.2 what is the simplest way to get the current date value? > I have looked in so many places. The question is often asked and the > usual response indicates how to get the current date and time like > > now = time.localtime() > > I

Get the current date, python 2.2

2007-06-15 Thread nano
Using python 2.2 what is the simplest way to get the current date value? I have looked in so many places. The question is often asked and the usual response indicates how to get the current date and time like now = time.localtime() I want just the date, like 2007-06-15. The value will go into

Re: a_list.count(a_callable) ?

2007-06-15 Thread Dustan
On Jun 15, 12:52 pm, Ping <[EMAIL PROTECTED]> wrote: > On 6 15 , 11 17 , Dustan <[EMAIL PROTECTED]> wrote: > > > > > On Jun 15, 9:15 am, Ping <[EMAIL PROTECTED]> wrote: > > > > > sum(1 for i in a_list if a_callable(i)) > > > > > -- > > > > Carsten Haesehttp://informixdb.sourceforge.net > > > > Th

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > Here's the situation. Python is making inroads at MIT, Scheme home turf. > The co-developer of Scheme, while writing about some other subject, tosses > in an off-the-wall slam against Python. Someone asks what we here think. > I think that the comme

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > My only point was that Sussman is an odd person to be criticizing > (somewhat mistakingly) Python for being minimalist. I think that being a language minimalist is very different from believing that there should be exactly one obvious way to do everythi

Priority Queue with Mutable Elements

2007-06-15 Thread Chris Lasher
Hello, I am working with large graphs (~150,000 to 500,000 nodes) which I need decompose node-by-node, in order of a node's value. A node's value is determined by the sum of its edge weights. When a node is removed from the graph, its neighbors' values must be updated to take into account the remo

Re: Html parser

2007-06-15 Thread Lee Hinde
On Jun 15, 7:11 am, HMS Surprise <[EMAIL PROTECTED]> wrote: > Could you recommend an html parser that works with python (jython > 2.2)? HTMLParser does not seem to be in this library. To test some > of our browser based (mailnly php) code I seek for field names and > values associated with them.

Should: "for k,v in **dictionary_instance" work?

2007-06-15 Thread keithgabryelski
Does it make sense to provide this syntax for iterating key/value pairs from a dictionary? for k,v in **dict(): print k,v why is this not the same as: for k,v in dict().items(): print k,v for that matter, why the heck doesn't a dictionary default to returning a tuple k,v pair from its iter

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Douglas Alan
"Terry Reedy" <[EMAIL PROTECTED]> writes: > Try suggesting on a Lisp or Scheme group that having only one type > of syntax (prefix expressions) lacks something and that they should > add variety in the form of statement syntax ;-) Hint: some Lispers > have bragged here about the simplicity of 'one

PIL cutting off letters

2007-06-15 Thread Matt Haggard
I'm using PIL (Python Imaging Library) to generate button images. They consist of a left end image, a middle, repeating image and a right side image anyway, that's not important I'm using a TTF font for the text of the button (Verdana.TTF) and it keeps cutting the bottom part of the the g's q'

Re: a_list.count(a_callable) ?

2007-06-15 Thread Carsten Haese
On Fri, 2007-06-15 at 14:39 -0400, Carsten Haese wrote: > class WhereTrue(object): > def __init__(self, func): > self.func = func > def __eq__(self, other): > return self.func(other) > > list1.count(WhereTrue(callable1)) > list2.count(WhereTrue(callable2)) P.S: Note, howev

Re: Want to learn Python

2007-06-15 Thread Christof Winter
Amol wrote: > Hi, I want to learn Python in less than a month which resources should > I use. I prefer to read books . Please give me a list of *recognized* > resources. Thank You all This is an excellent resource: http://rgruet.free.fr/PQR24/PQR2.4.html Although it's quite different from a book,

Re: a_list.count(a_callable) ?

2007-06-15 Thread Carsten Haese
On Fri, 2007-06-15 at 17:55 +, Ping wrote: > On 6 16 , 12 33 , Carsten Haese <[EMAIL PROTECTED]> wrote: > > Did you see my alternative example on this thread? It allows you to use > > list.count in almost exactly that way, except that instead of passing > > the callable directly, you pass an

Re: a_list.count(a_callable) ?

2007-06-15 Thread BJörn Lindqvist
On 6/15/07, Ping <[EMAIL PROTECTED]> wrote: > > > > sum(1 for i in a_list if a_callable(i)) > > > > -- > > Carsten Haesehttp://informixdb.sourceforge.net > > This works nicely but not very intuitive or readable to me. > > First of all, the generator expression makes sense only to > trained eyes. S

Re: Output of HTML parsing

2007-06-15 Thread Stefan Behnel
Jackie wrote: > I want to get the information of the professors (name,title) from the > following link: > > "http://www.economics.utoronto.ca/index.php/index/person/faculty/"; That's even XHTML, no need to go through BeautifulSoup. Use lxml instead. http://codespeak.net/lxml > Ideally, I'd lik

Re: a_list.count(a_callable) ?

2007-06-15 Thread Ping
On 6 16 , 12 33 , Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-06-15 at 14:15 +, Ping wrote: > > using sum(1 ...) to mean count() isn't very intuitive > > I find it very intuitive, but then again, my years of studying Math may > have skewed my intuition. > > > I would still prefer

Re: Want to learn Python

2007-06-15 Thread Evan Klitzke
On 6/15/07, Amol <[EMAIL PROTECTED]> wrote: > Hi, I want to learn Python in less than a month which resources should > I use. I prefer to read books . Please give me a list of *recognized* > resources. Thank You all The Apress "Beginning Python" book is the one that I recommend to people who want

Re: a_list.count(a_callable) ?

2007-06-15 Thread Ping
On 6 15 , 11 17 , Dustan <[EMAIL PROTECTED]> wrote: > On Jun 15, 9:15 am, Ping <[EMAIL PROTECTED]> wrote: > > > > sum(1 for i in a_list if a_callable(i)) > > > > -- > > > Carsten Haesehttp://informixdb.sourceforge.net > > > This works nicely but not very intuitive or readable to me. > > > First o

Re: Subprocess Not Working on Solaris

2007-06-15 Thread MrJean1
FWIIW, on my Solaris 10 (Opteron) machine, there are no import subprocess errors, not with Python 2.4.3 nor with Python 2.5. /Jean Brouwers PS) Python 2.4.3 is the ActivePython Solaris build 11 from ActivState. Python 2.5 was built from source using SUN compilers, not GNU. There is an ActivePyt

Re:

2007-06-15 Thread David Wahler
On 6/15/07, Wiley Thomas <[EMAIL PROTECTED]> wrote: > I'm trying to write a script to open a file on our (windows) network. The > file is located on a machine that is not part of the domain and requires a > separate user id and password to access. I tried using urllib2 and the > password_manager

Re: problem on waiting exit thread and write on file

2007-06-15 Thread Flyzone
Marc 'BlackJack' Rintsch ha scritto: > for thread in threads: > thread.join() > > Much shorter, isn't it!? :-) If i do like you tell, all thread will run together right? So i'll get troubles! I have a list of hostname, i run a network program and then i need to write some of the outpu

Re: Re printing on same line.

2007-06-15 Thread Robert Bauck Hamar
Jerry Hill wrote: > On 6/15/07, HMS Surprise <[EMAIL PROTECTED]> wrote: >> I want to print a count down timer on the same line. I tried >> >> print '\r', timeLeft, >> >> which just appends to the same line. > > Sounds to me like whatever you're printing to doesn't do what you > expect when it

Re: global destructor not called?

2007-06-15 Thread Neal Becker
Bruno Desthuilliers wrote: > Neal Becker a écrit : >> To implement logging, I'm using a class: > > If I may ask : any reason not to use the logging module in the stdlib ? Don't exactly recall, but needed some specific behavior and it was just easier this way. > >> class logger (object): >>

Do U have anything to share with this students

2007-06-15 Thread slvslv89
This is a network of students. Find the people of your kind there http://tinyurl.com/33uvla Click and register to access millions of students. -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamically generated runtime methods & reflection

2007-06-15 Thread Bruno Desthuilliers
Alex Martelli a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> > wrote: > >> Josiah Carlson a écrit : >> (snip) >>> Well, the particular operation is typically called 'currying a >>> function', >> >> it's not 'currying' but 'partial application'. >> >> Currying is somehow the reverse of part

Re: Re printing on same line.

2007-06-15 Thread Jerry Hill
On 6/15/07, HMS Surprise <[EMAIL PROTECTED]> wrote: > I want to print a count down timer on the same line. I tried > > print '\r', timeLeft, > > which just appends to the same line. Sounds to me like whatever you're printing to doesn't do what you expect when it encounters a carriage return (\

Re: Want to learn Python

2007-06-15 Thread Simon Brunning
On 6/15/07, Amol <[EMAIL PROTECTED]> wrote: > Hi, I want to learn Python in less than a month which resources should > I use. I prefer to read books . Please give me a list of *recognized* > resources. Thank You all One other invaluable resource: http://mail.python.org/mailman/listinfo/tutor Chee

Re: a_list.count(a_callable) ?

2007-06-15 Thread Carsten Haese
On Fri, 2007-06-15 at 14:15 +, Ping wrote: > using sum(1 ...) to mean count() isn't very intuitive I find it very intuitive, but then again, my years of studying Math may have skewed my intuition. > I would still prefer an expression like a_list.count(a_callable), > which is short, clean, and

Re: Serialization across languages?

2007-06-15 Thread Simon Brunning
On 15 Jun 2007 09:02:34 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > Any idea if a C implementation is available? I mean Python-callable. There's a fairly in-detail comparison of a number of JSON translators here: http://tinyurl.com/39zgw4 Cheers, Simon B. [EMAIL PROTECTED] http:/

Re: Serialization across languages?

2007-06-15 Thread Paul Rubin
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > Then I'd second Simon's suggestion to use JSON. Any idea if a C implementation is available? I mean Python-callable. -- http://mail.python.org/mailman/listinfo/python-list

Re: global destructor not called?

2007-06-15 Thread Bruno Desthuilliers
Neal Becker a écrit : > To implement logging, I'm using a class: If I may ask : any reason not to use the logging module in the stdlib ? > class logger (object): > def __init__ (self, name): > self.name = name > self.f = open (self.name, 'w') > def write (self, stuff): >

[no subject]

2007-06-15 Thread Wiley Thomas
I'm trying to write a script to open a file on our (windows) network. The file is located on a machine that is not part of the domain and requires a separate user id and password to access. I tried using urllib2 and the password_manager to authenticate but as some point urllib2 sees I'm trying to

Re: MySQL - Jython2.2

2007-06-15 Thread HMS Surprise
Thanks, everyone. I will give it a try. Don't know a lot about mySQL (or any flavor SQL) but from some minute exposure to the ODBC connector I am guessing that jdbc provides a connector. Wish me luck jh -- http://mail.python.org/mailman/listinfo/python-list

Re: IndentationError: unexpected indent

2007-06-15 Thread Bjoern Schliessmann
"Wim Vogelaar" wrote: > You have possibly unvisible tab characters in your file. > Just copy your lines to the simple MS notepad and try again. How is he supposed to run MS notepad on X11? :) Regards, Björn P.S.: YES, I know there is wine. -- BOFH excuse #126: it has Intel Inside -- htt

Re: poking around a running program

2007-06-15 Thread Bjoern Schliessmann
Paul Rubin wrote: > Is this kind of thing common? Has it been done before and are > there some recipes? The Twisted framework offers an interactive Python shell inside the application (Twisted manhole). Regards, Björn -- BOFH excuse #249: Unfortunately we have run out of bits/bytes/whate

Re: Re printing on same line.

2007-06-15 Thread HMS Surprise
>... ruining the > output? > ? None. -- http://mail.python.org/mailman/listinfo/python-list

Re: Re printing on same line.

2007-06-15 Thread Gabriel Genellina
En Fri, 15 Jun 2007 12:21:01 -0300, HMS Surprise <[EMAIL PROTECTED]> escribió: > I want to print a count down timer on the same line. I tried > > print '\r', timeLeft, > > > which just appends to the same line. It works OK for me. Don't you have any other print statement ruining the outpu

Re: Subprocess Not Working on Solaris

2007-06-15 Thread Paul Boddie
On 15 Jun, 17:00, Lee <[EMAIL PROTECTED]> wrote: > Has anyone ran into this problem? I've done extensive googling and > research and I cannot seem to find the answer. > > I downloaded the source for 2.5.1 from python.org compiled and > installed it on a Solaris box, Aren't there additional linking

Re: Html parser

2007-06-15 Thread HMS Surprise
Thanks, jh -- http://mail.python.org/mailman/listinfo/python-list

Re printing on same line.

2007-06-15 Thread HMS Surprise
I want to print a count down timer on the same line. I tried print '\r', timeLeft, which just appends to the same line. thanx, jh -- http://mail.python.org/mailman/listinfo/python-list

Re: a_list.count(a_callable) ?

2007-06-15 Thread Dustan
On Jun 15, 9:15 am, Ping <[EMAIL PROTECTED]> wrote: > > sum(1 for i in a_list if a_callable(i)) > > > -- > > Carsten Haesehttp://informixdb.sourceforge.net > > This works nicely but not very intuitive or readable to me. > > First of all, the generator expression makes sense only to > trained eyes.

Re: FTP Date Format Function

2007-06-15 Thread samuraisam
On Jun 14, 10:53 pm, billiejoex <[EMAIL PROTECTED]> wrote: > On 14 Giu, 19:25, samuraisam <[EMAIL PROTECTED]> wrote: > > > > > FTP LST/LIST/NLST date field formatting function for all those seekers > > out there... > > > import time > > import datetime > > > def ftpdateformat(value): > > """For

Subprocess Not Working on Solaris

2007-06-15 Thread Lee
Has anyone ran into this problem? I've done extensive googling and research and I cannot seem to find the answer. I downloaded the source for 2.5.1 from python.org compiled and installed it on a Solaris box, uname -a returns SunOS unicom5 5.8 Generic_117350-26 sun4u sparc SUNW,Sun-Fire-V210 Whe

Re: MySQL - Jython2.2

2007-06-15 Thread Ant
On Jun 15, 3:31 pm, HMS Surprise <[EMAIL PROTECTED]> wrote: > I thought I had a winner mySql-python but it require2 python 2.3-5 and > the tool I am using (maxq) is based on jython 2.2. Is there another > way that I could perform queries from python? If you want to query via Jython, use the jdbc d

global destructor not called?

2007-06-15 Thread Neal Becker
To implement logging, I'm using a class: class logger (object): def __init__ (self, name): self.name = name self.f = open (self.name, 'w') def write (self, stuff): self.f.write (stuff) def close (self): self.f.close() def flush (self): self.f.

Re: MySQL - Jython2.2

2007-06-15 Thread Paul Boddie
On 15 Jun, 16:31, HMS Surprise <[EMAIL PROTECTED]> wrote: > I thought I had a winner mySql-python but it require2 python 2.3-5 and > the tool I am using (maxq) is based on jython 2.2. Is there another > way that I could perform queries from python? For Jython you should use the JDBC driver for the

Re: huge dictionary -> bsddb/pickle question

2007-06-15 Thread Alex Martelli
lazy <[EMAIL PROTECTED]> wrote: ... > key1=>{key11=>[1,2] , key12=>[6,7] , } ... > Im processesing HUGE(~100M inserts into the dictionary) data. What will you need from the "saved" version later? If you need lookups by single keys or key pairs then a relational DB may be best; if you

Re: dynamically generated runtime methods & reflection

2007-06-15 Thread Alex Martelli
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Josiah Carlson a écrit : > (snip) > > Well, the particular operation is typically called 'currying a > > function', > > > it's not 'currying' but 'partial application'. > > Currying is somehow the reverse of partial : it's a way of building a >

Re: MySQL - Jython2.2

2007-06-15 Thread Carsten Haese
On Fri, 2007-06-15 at 07:31 -0700, HMS Surprise wrote: > I thought I had a winner mySql-python but it require2 python 2.3-5 and > the tool I am using (maxq) is based on jython 2.2. Is there another > way that I could perform queries from python? The low version number is not your main problem. The

MySQL - Jython2.2

2007-06-15 Thread HMS Surprise
I thought I had a winner mySql-python but it require2 python 2.3-5 and the tool I am using (maxq) is based on jython 2.2. Is there another way that I could perform queries from python? thanx, jh -- http://mail.python.org/mailman/listinfo/python-list

Re: Html parser

2007-06-15 Thread Stephen R Laniel
On Fri, Jun 15, 2007 at 07:11:56AM -0700, HMS Surprise wrote: > Could you recommend an html parser that works with python (jython > 2.2)? I'm new here, but I believe BeautifulSoup is the canonical answer: http://www.crummy.com/software/BeautifulSoup/ -- Stephen R. Laniel [EMAIL PROTECTED] Cell:

Re: a_list.count(a_callable) ?

2007-06-15 Thread Ping
> > sum(1 for i in a_list if a_callable(i)) > > -- > Carsten Haesehttp://informixdb.sourceforge.net This works nicely but not very intuitive or readable to me. First of all, the generator expression makes sense only to trained eyes. Secondly, using sum(1 ...) to mean count() isn't very intuitive

Re: Output of HTML parsing

2007-06-15 Thread Sebastian Wiesner
[ Jackie <[EMAIL PROTECTED]> ] > 1.The code above assume that each Prof has a tilte. If any one of them > does not, the name and title will be mismatched. How to program to > allow that title can be empty? > > 2.Is there any easier way to get the data I want other than using > list? Use BeautifulS

Html parser

2007-06-15 Thread HMS Surprise
Could you recommend an html parser that works with python (jython 2.2)? HTMLParser does not seem to be in this library. To test some of our browser based (mailnly php) code I seek for field names and values associated with them. Thanks, jh -- http://mail.python.org/mailman/listinfo/python-l

RE: Questions about mathematical and statistical functionality in Python

2007-06-15 Thread Talbot Katz
Thank you to all who replied online or offline. This has been quite helpful. -- TMK -- 212-460-5430home 917-656-5351cell >From: "John Krukoff" <[EMAIL PROTECTED]> >To: "'Talbot Katz'" <[EMAIL PROTECTED]> >CC: >Subject: RE: Questions about mathematical and statistical functionality

Output of HTML parsing

2007-06-15 Thread Jackie
Hi, all, I want to get the information of the professors (name,title) from the following link: "http://www.economics.utoronto.ca/index.php/index/person/faculty/"; Ideally, I'd like to have a output file where each line is one Prof, including his name and title. In practice, I use the CSV module.

Re: Want to learn Python

2007-06-15 Thread Joe Riopel
I am still learning and this is a great resource: http://diveintopython.org/index.html You can buy it or read it online for free. -- http://mail.python.org/mailman/listinfo/python-list

Re: unsupported operand type(s) for ^: 'float' and 'float'

2007-06-15 Thread benc
On Jun 15, 9:21 am, Florian Lindner <[EMAIL PROTECTED]> wrote: > >>> 5.3^4.3 > > Traceback (most recent call last): > File "", line 1, in ? > TypeError: unsupported operand type(s) for ^: 'float' and 'float' That operator... I do not think it means what you think it means. >>> hex(0x1010^0x0110

Re: Want to learn Python

2007-06-15 Thread Eric
On Jun 15, 7:41 am, Amol <[EMAIL PROTECTED]> wrote: > Hi, I want to learn Python in less than a month which resources should > I use. I prefer to read books . Please give me a list of *recognized* > resources. Thank You all I started here: http://docs.python.org/tut/tut.html -- http://mail.pytho

Re: Want to learn Python

2007-06-15 Thread Sergio Monteiro Basto
On Fri, 2007-06-15 at 11:41 +, Amol wrote: > Hi, I want to learn Python in less than a month which resources should > I use. I prefer to read books . Please give me a list of *recognized* > resources. Thank You all > Books : Learning Python 2nd Edition (ISBN 0-596-00281-5) or above Python in

Re: Want to learn Python

2007-06-15 Thread Bruno Desthuilliers
Amol a écrit : > Hi, I want to learn Python in less than a month which resources should > I use. Your brain ?-) (actually, a computer with Python installed on it may help too...) > I prefer to read books . Books are fine, but won't be of much help unless you actually *code* in Python. > Pleas

Re: dynamically generated runtime methods & reflection

2007-06-15 Thread Bruno Desthuilliers
Josiah Carlson a écrit : (snip) > Well, the particular operation is typically called 'currying a > function', it's not 'currying' but 'partial application'. Currying is somehow the reverse of partial : it's a way of building a multiple-args function from single-args functions. -- http://mai

PythonWin crash - works only once after installation

2007-06-15 Thread Ze'ev
Hi, I've installed Python 2.5 and PythonWin (pywin32-210.win32-py2.5) on my new XP machine. The first time I run PythonWin after installation it runs normally but if I close it and try to run it again it crashes ("PyWin32 has encountered a problem and needs to close") every time. If I re-install

Re: using Mac OS X CoreGraphics via ctypes

2007-06-15 Thread Daniel
> > # the next line causes a segfault - what's the right way to do this? > > #GCS_RGB = cglib.kCGColorSpaceGenericRGB() > > Usually, things in the OSX lib that start with k* are a constant - not a > function. As is this. > > Diez That's what I thought too. But when I try passing it directly as if

Re: Want to learn Python

2007-06-15 Thread jitudon
On Jun 15, 4:41 pm, Amol <[EMAIL PROTECTED]> wrote: > Hi, I want to learn Python in less than a month which resources should > I use. I prefer to read books . Please give me a list of *recognized* > resources. Thank You all http://python.org/doc/ JItendra Nair -- http://mail.python.org/mailman/

Want to learn Python

2007-06-15 Thread Amol
Hi, I want to learn Python in less than a month which resources should I use. I prefer to read books . Please give me a list of *recognized* resources. Thank You all -- http://mail.python.org/mailman/listinfo/python-list

Re: Serialization across languages?

2007-06-15 Thread Steve Howell
--- Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Tobiah a écrit : > > I want to do SOAP like calls from a device who's > libraries > > don't include SOAP. I'm thinking of using simple > HTTP posts, > > but I'm going to want to send arrays and hashes. > > Then I'd second Simon's suggestion t

Re: Serialization across languages?

2007-06-15 Thread Bruno Desthuilliers
Tobiah a écrit : > I want to do SOAP like calls from a device who's libraries > don't include SOAP. I'm thinking of using simple HTTP posts, > but I'm going to want to send arrays and hashes. Then I'd second Simon's suggestion to use JSON. -- http://mail.python.org/mailman/listinfo/python-list

Re: save class

2007-06-15 Thread Diez B. Roggisch
> of having to keep track of a separate dictionary file. I am new to > this, but I thought that this would be a regular thing to do in > python, because people must make classes in the interactive console > and then export them somehow for later use. No. That's not how things work. One does dabble

Re: huge dictionary -> bsddb/pickle question

2007-06-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, lazy wrote: > I have a dictionary something like this, > > key1=>{key11=>[1,2] , key12=>[6,7] , } > For lack of wording, I will call outer dictionary as dict1 and its > value(inner dictionary) dict2 which is a dictionary of small fixed > size lists(2 items) > > The

WebThumb

2007-06-15 Thread Johny
How can I get a website thumbnail? I would like to allow visitors to add their URLs to our pages with the thumbnail of their website. Can anyone suggest a solution for web thumbnails? Thanks L. -- http://mail.python.org/mailman/listinfo/python-list

Re: Serialization across languages?

2007-06-15 Thread Simon Brunning
On 6/14/07, Tobiah <[EMAIL PROTECTED]> wrote: > I want to do SOAP like calls from a device who's libraries > don't include SOAP. I'm thinking of using simple HTTP posts, > but I'm going to want to send arrays and hashes. > > First, what do I need to be aware of when sending arbitrary > data by a P

huge dictionary -> bsddb/pickle question

2007-06-15 Thread lazy
Hi, I have a dictionary something like this, key1=>{key11=>[1,2] , key12=>[6,7] , } For lack of wording, I will call outer dictionary as dict1 and its value(inner dictionary) dict2 which is a dictionary of small fixed size lists(2 items) The key of the dictionary is a string and value is a

Re: Help with PAM and ctypes

2007-06-15 Thread Lenard Lindstrom
Chris AtLee wrote: > On Jun 11, 6:01 pm, Lenard Lindstrom <[EMAIL PROTECTED]> wrote: > [snip snip snip] >>> if __name__ == "__main__": >>> import getpass, os, sys >>> @conv_func >>> def my_conv(nMessages, messages, pResponse, appData): >>> # Create an array of nMessages response

  1   2   >