Zope 3.2.0 beta 2 released!

2005-12-26 Thread Stephan Richter
The Zope 3 development team is proud to announce Zope 3.2.0 beta 2. Zope 3 is the next major Zope release and has been written from scratch based on the latest software design patterns and the experiences of Zope 2. It is our opinion that Zope 3 is more than ready for production use, which is

Re: python coding contest

2005-12-26 Thread Peter Otten
Simon Hengel wrote: Is it necessary to keep the input parameter as 'input'? Reducing that to a single character drops the length of a program by at least 8 characters. Technically it changes the interface of the function, so it's a little bogus, but test.py doesn't check. (Personally I prefer

Re: libxml2 and mindom

2005-12-26 Thread ankit
Hi Paul, Now I am fixed with libxml2 and libxml2dom. but can you tell me to what extent libxml2dom supports minidom. because I want minidom for traversing. Where I can find the documentation of libxml2dom. -- http://mail.python.org/mailman/listinfo/python-list

Beautiful Python

2005-12-26 Thread Gekitsuu
I've been reading a lot of python modules lately to see how they work and I've stumbled across something that's sort of annoying and wanted to find out of there was a good reason behind it. In a Perl program when you're calling other modules you'll add use statements at the beginning of your

Re: python coding contest

2005-12-26 Thread anonymous
taroso at gmail.com writes: Currently I'm on 149 characters in urgh one line - 128 without spaces/newlines. (it'd be three characters shorter if it didn't have to end with a \n) -T. unclean... unclean... are you importing zlib or bz2 ? --

Re: python coding contest

2005-12-26 Thread Brian Beck
anonymous wrote: are you importing zlib or bz2 ? I don't think either of these would help in this case. While the length of the compressed string might be significantly shorter than your solution, the resulting string *literal* you decompress will contain a bunch of \-escaped characters, so it

Re: python coding contest

2005-12-26 Thread Brian Beck
I don't think either of these would help in this case. While the length of the compressed string might be significantly shorter than your solution, the resulting string *literal* you decompress will contain a bunch of \-escaped characters, so it will end up being longer. PS: I'm at 155, damn

Re: Beautiful Python

2005-12-26 Thread Jarek Zgoda
Gekitsuu napisal(a): use strict; use WWW::Mechanize; use CGI; This seems to be the de facto standard in the Perl community but in python it seems most of the code I look at has import statements everywhere in the code. Is there a sound reason for putting the imports there are are

Re: Indentation/whitespace

2005-12-26 Thread jussij
i think you can't call an editor python capable unless it shows you clearly hard (yuck)or soft tabs like View / Show Invisibles in textmate, View / view whitespace in komodo. Zeus for Windows has this View / View whitespace feature: http://www.zeusedit.com Note: Zeus is shareware (45

Windows and python execution

2005-12-26 Thread Mark Carter
What I would like to do it type something like myscript.py instead of python myscript.py on a Windows console. I know its possible because Ruby scripts manage to do this - I just don't know the registry settings that need to be tweaked to enable it. Any ideas (I'd prefer to know the registry

Re: Windows and python execution

2005-12-26 Thread BartlebyScrivener
Well, can't help with the registry, but I suppose you could search google for edit system variables path registry and find the hard way. The easy way is: You need to add the path of the directory where you keep myscript.py to your system path. You do this by going to Control Panel | System |

PyHtmlGUI Project is looking for developers

2005-12-26 Thread phoenixathell
Hi all, the PyHtmlGUI Project (http://www.sourceforge.net/projects/pyhtmlgui) is looking for developers that want to join. The aim of the project is to create a web application framework. The API of PyHtmlGUI wants to be close to Trolltechs famous Qt API but incooperates the idea of a text based

changing ethernet mac

2005-12-26 Thread joe smith
Has anyone got a tip on how to control the source and destination ethernet macs using python?I am trying to test a bridge-like device. I have tried to use dnet and some of the other modules from Dugsong, but without success. I am using a win2000 os, so my options are more limited than in the *nix

Re: Windows and python execution

2005-12-26 Thread Tim Williams (gmail)
On 26/12/05, Mark Carter [EMAIL PROTECTED] wrote: What I would like to do it type something like myscript.pyinstead of python myscript.py Open an explorer window or open My Computer Click on TOOLS then FOLDER OPTIONS Select the FILE TYPES tab and click on NEW Enter PY as the file

Re: python coding contest

2005-12-26 Thread taroso
(Current status: 147 characters) Nope - no imports at all. The horrible thing is it's NOT the the most unpleasant piece of Python I've written. -T. A gentleman is someone who knows how to play the bagpipes but doesn't -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-26 Thread André Malo
* anonymous wrote: are you importing zlib or bz2 ? Haha, I've tried that myself. Funnily the bz2 result had exactly the same length as the original. Code with that entropy is... nasty ;) Still 179. It seems, I need to rethink the algorithm ;-) nd -- die (eval q-qq:Just Another Perl Hacker

Re: Windows and python execution

2005-12-26 Thread rzed
Mark Carter [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: What I would like to do it type something like myscript.py instead of python myscript.py on a Windows console. I know its possible because Ruby scripts manage to do this - I just don't know the registry settings that need to

Re: Indentation/whitespace

2005-12-26 Thread Robert Hicks
No, it is that simple. You don't want it to be is all. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Beautiful Python

2005-12-26 Thread Steven D'Aprano
On Mon, 26 Dec 2005 02:01:07 -0800, Gekitsuu wrote: Is there a sound reason for putting the imports there are are developers just loading modules in as they need them. I own Damian Conway's book of Perl Best Practices and it seems from a maintainability standpoint that having all the modules

Fwd: oddness question for threading in pyw

2005-12-26 Thread limodou
I forward this letter from wxPython maillist, because it seems that no one answers my question, so I want to ask somebody for help in here. Thanks. -- Forwarded message -- From: limodou [EMAIL PROTECTED] Date: 2005-12-26 下午3:06 Subject: oddness question for threading in pyw To:

Re: Windows and python execution

2005-12-26 Thread Mark Carter
rzed wrote: Mark Carter [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: What I would like to do it type something like myscript.py instead of python myscript.py As another poster points out, be sure that your Python is on your path. And there is a PATHEXT environment variable,

Re: build curiosities of svn head (on WinXP)

2005-12-26 Thread Steve Holden
David Murmann wrote: hi all! i just built revision 41809 under winxp using a rather uncommon setup (at least i think so). since i have no visual studio here, i only used freely available tools: cygwin to get the source, the microsoft compiler/linker and NAnt (nant.sf.net) as the build tool

Re: Windows and python execution

2005-12-26 Thread BartlebyScrivener
What you need to do is include the following line in autoexec.bat: set .py=c:\python24\python.exe Whatever works for you. I don't have that command in my autoexec.bat file and my python scripts execute from any location because the directory they are stored in is in my PATH variable. --

Re: Windows and python execution

2005-12-26 Thread rbt
Mark Carter wrote: rzed wrote: Mark Carter [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: What I would like to do it type something like myscript.py instead of python myscript.py As another poster points out, be sure that your Python is on your path. And there is a PATHEXT

Re: build curiosities of svn head (on WinXP)

2005-12-26 Thread Steve Holden
Steve Holden wrote: David Murmann wrote [...] apart from that everything went fine, and i could reproduce the expected failure (ATM) of the regression test suite: http://mail.python.org/pipermail/python-dev/2005-December/059033.html btw, if anyone is interested in the (rather small)

Re: python coding contest

2005-12-26 Thread Bengt Richter
On Sun, 25 Dec 2005 16:39:47 +0100, Simon Hengel [EMAIL PROTECTED] wrote: Hello, we are hosting a python coding contest an we even managed to provide a price for the winner... ^ How much are you going to sell him or her for? ;-) Regards, Bengt Richter --

Re: Windows and python execution

2005-12-26 Thread BartlebyScrivener
The installer can put python.exe in his PATH but if he's storing his scripts in some oddball place then he has to tell Windows where to find them. rpd -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-26 Thread Tim Hochberg
[EMAIL PROTECTED] wrote: Currently I'm on 149 characters in urgh one line - 128 without spaces/newlines. (it'd be three characters shorter if it didn't have to end with a \n) It'll be interesting to see what the short 1-line answers look like. I have a hard time seeing how that's done.

Re: Windows and python execution

2005-12-26 Thread Mark Carter
BartlebyScrivener wrote: The installer can put python.exe in his PATH but if he's storing his scripts in some oddball place then he has to tell Windows where to find them. I think you're misunderstanding what I was after. python.exe is already in my PATH. What I was trying to do was execute a

Re: PyHtmlGUI Project is looking for developers

2005-12-26 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: The aim of the project is to create a web application framework. The API of PyHtmlGUI wants to be close to Trolltechs famous Qt API but incooperates the idea of a text based renderengine instead of the pixel based one. The obviouse target is html/css but

Re: build curiosities of svn head (on WinXP)

2005-12-26 Thread Tim Peters
[David Murmann] ... second, the build order in pcbuild.sln for elementtree seems to be wrong, nant tried to build elementtree before pythoncore (which failed). i fixed this by building elementtree separately. [Steve Holden] Yes, the elementtree module is a new arrival for 3.5, so the build

Re: python coding contest

2005-12-26 Thread André Malo
* Tim Hochberg wrote: Currently, I'm down to 137 characters now in 6 lines. There's very little left to trim at this point, so I don't know that I'll be able to knock it down any further using my current approach. And since I don't have any other approaches in the wings, I may be about washed

Re: Windows and python execution

2005-12-26 Thread BartlebyScrivener
What I was trying to do was execute a python script without having to type the word python explicitly. For that, you need the set command that I listed in a previous post. I'm not confused and I like to keep my scripts in oddball places too. Namely d:\python. All I'm saying is I don't use the

Re: python coding contest

2005-12-26 Thread Yaccck
You guys are pretty agressive! -- http://mail.python.org/mailman/listinfo/python-list

PyArg_ParseTuple exception catching

2005-12-26 Thread x0rster
Hi, I'm getting an error when using PyArg_ParseTuple and I don't know why...In the documentation I've read that PyArg_ParseTuple raise an appropriate exception : on failure, it returns false and raises the appropriate exception. How can I get the exception in C ? because I've checked the

Re: Beautiful Python

2005-12-26 Thread Chip Turner
On 2005-12-26 05:01:07 -0500, Gekitsuu [EMAIL PROTECTED] said: I've been reading a lot of python modules lately to see how they work and I've stumbled across something that's sort of annoying and wanted to find out of there was a good reason behind it. In a Perl program when you're calling

Re: PyArg_ParseTuple exception catching

2005-12-26 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I'm getting an error when using PyArg_ParseTuple and I don't know why...In the documentation I've read that PyArg_ParseTuple raise an appropriate exception : on failure, it returns false and raises the appropriate exception. How can I get the exception in C ?

Re: python coding contest

2005-12-26 Thread Dody Suria Wijaya
omg, how do you guys do it? after 4 hours, i'm stucked at 182 chars, 8 lines. hint please... :D André Malo wrote: * Tim Hochberg wrote: Currently, I'm down to 137 characters now in 6 lines. There's very little left to trim at this point, so I don't know that I'll be able to knock it down

Re: deal or no deal

2005-12-26 Thread james . moughan
[snip] What I would really like to know, is how they calculate the offer. Obviously, they set the upper limit at the average of the still standing offers, but I wonder if and how they take subsequent rounds into consideration. Is there a Monty Hall

Hypergeometric distribution

2005-12-26 Thread Raven
Hi to all, I need to calculate the hpergeometric distribution: choose(r, x) * choose(b, n-x) p(x; r,b,n) = - choose(r+b, n) choose(r,x) is the binomial coefficient I use the factorial to calculate the above

Re: python coding contest

2005-12-26 Thread Claudio Grondi
Peter Otten wrote: Simon Hengel wrote: Is it necessary to keep the input parameter as 'input'? Reducing that to a single character drops the length of a program by at least 8 characters. Technically it changes the interface of the function, so it's a little bogus, but test.py doesn't check.

Re: python coding contest

2005-12-26 Thread Tim Hochberg
Claudio Grondi wrote: Peter Otten wrote: [SNIP] How good is good for import test_vectors seven_seg = test_vectors.test_vectors.get or code using the test suite in general? Peter This started to remind myself about the story of the contest where the shortest program beeing able to output

PIL and ImageMagick scalability

2005-12-26 Thread Sebastjan Trepca
Hi everyone! I have a question about image processing. We have a website which will process a lot of images a day.It will be running Apache(worker) with mod_python. My question is what should we use for processing. If we use PIL the processing will be done with the same process that handles other

Re: Beautiful Python

2005-12-26 Thread sconce
Gekitsuu wrote: I've been reading a lot of python modules lately to see how they work and I've stumbled across something that's sort of annoying and wanted to find out of there was a good reason behind it. In a Perl program when you're calling other modules you'll add use statements at the

Re: Hypergeometric distribution

2005-12-26 Thread Robert Kern
Raven wrote: Hi to all, I need to calculate the hpergeometric distribution: choose(r, x) * choose(b, n-x) p(x; r,b,n) = - choose(r+b, n) choose(r,x) is the binomial coefficient I use the factorial to

Re: build curiosities of svn head (on WinXP)

2005-12-26 Thread David Murmann
Tim Peters schrieb: [David Murmann] ... second, the build order in pcbuild.sln for elementtree seems to be wrong, nant tried to build elementtree before pythoncore (which failed). i fixed this by building elementtree separately. [Steve Holden] Yes, the elementtree module is a new arrival

Re: python coding contest

2005-12-26 Thread Duncan Booth
Tim Hochberg wrote: [EMAIL PROTECTED] wrote: Currently I'm on 149 characters in urgh one line - 128 without spaces/newlines. (it'd be three characters shorter if it didn't have to end with a \n) It'll be interesting to see what the short 1-line answers look like. I have a hard time

Re: deal or no deal

2005-12-26 Thread Chip Turner
On 2005-12-26 15:05:21 -0500, [EMAIL PROTECTED] said: I believe not; the Monty Hall problem is biased by the fact that the presenter knows where the prize is, and eliminates one box accordingly. Where boxes are eliminated at random, it's impossible for any given box to have a higher

Re: Windows and python execution

2005-12-26 Thread Bengt Richter
On Mon, 26 Dec 2005 14:53:28 +, Mark Carter [EMAIL PROTECTED] wrote: rzed wrote: Mark Carter [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: What I would like to do it type something like myscript.py instead of python myscript.py As another poster points out, be sure that your

Re: Hypergeometric distribution

2005-12-26 Thread Gerard Flanagan
Raven wrote: Hi to all, I need to calculate the hpergeometric distribution: choose(r, x) * choose(b, n-x) p(x; r,b,n) = - choose(r+b, n) choose(r,x) is the binomial coefficient I use the factorial to

help with lists and writing to file in correct order

2005-12-26 Thread homepricemaps
hey folks, have a logic question for you. appreciate the help in advance. i am scraping 3 pieces of information from the html namely the food name , store name and price. and i am doing this for many different food items found ni the html including pizza, burgers, fries etc. what i want is to

Re: Windows and python execution

2005-12-26 Thread Mark Carter
Bengt Richter wrote: And there is a PATHEXT environment variable, Aha. You'bve provided a significant clue. What you need to do is include the following line in autoexec.bat: set .py=c:\python24\python.exe This will achieve the desired result. I'm suprised more people don't use it. I

__slots__ and copy again: why does it work?

2005-12-26 Thread fortepianissimo
I remember from painful experience that copy.copy() won't really copy __slots__ members. But I have trouble explaning why the following code works: --- START--- #!/usr/bin/env python import copy class Foo (object): __slots__ = 'i' def __init__ (self): self.i = 10 class Bar (Foo):

Re: __slots__ and copy again: why does it work?

2005-12-26 Thread fortepianissimo
I should've mentioned this was tested on Python 2.4.2. fortepianissimo wrote: I remember from painful experience that copy.copy() won't really copy __slots__ members. But I have trouble explaning why the following code works: --- START--- #!/usr/bin/env python import copy class Foo

Re: build curiosities of svn head (on WinXP)

2005-12-26 Thread Fredrik Lundh
David Murmann wrote: here i have problems. some tests fail more or less randomly. after some testing, i found that it seems to be related to the parsing of float literals in python code (wild guess). for example, test_pow failed giving me this traceback: Traceback (most recent call last):

closing stdin, stdout and stderr

2005-12-26 Thread Martijn Brouwer
I am writing a unix daemon in python, so I want to close stdin, stdout and stderr. My first attempt was to the standard file descriptors using their close() methods. After closing stdout, I could not print anymore, so this seemed to work. However, later I noticed that they were not really closed.

Re: closing stdin, stdout and stderr

2005-12-26 Thread Robin Becker
Martijn Brouwer wrote: I am writing a unix daemon in python, so I want to close stdin, stdout and stderr. My first attempt was to the standard file descriptors using their close() methods. After closing stdout, I could not print anymore, so this seemed to work. However, later I noticed that

Re: closing stdin, stdout and stderr

2005-12-26 Thread Robin Becker
Robin Becker wrote: Martijn Brouwer wrote: I am writing a unix daemon in python, so I want to close stdin, stdout and stderr. My first attempt was to the standard file descriptors using their close() methods. After closing stdout, I could not print anymore, so this seemed to work. However,

Re: Windows and python execution

2005-12-26 Thread rzed
Mark Carter [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Bengt Richter wrote: And there is a PATHEXT environment variable, Aha. You'bve provided a significant clue. What you need to do is include the following line in autoexec.bat: set .py=c:\python24\python.exe This will achieve

Re: Windows and python execution

2005-12-26 Thread Mark Carter
rzed wrote: I should have asked which Windows version you had. XP Pro My bad. On Win2k or XP, adding .py (for instance) to the PATHEXT variable means that you can execute myNeatProgram.py with this command-line: promptmyNeatProgram Oh, now I see! It's beginning to make sense to me. I'll

XPath-like filtering for ElementTree

2005-12-26 Thread Gerard Flanagan
Pseudo-XPath support for ElementTree with the emphasis on 'Pseudo'. http://gflanagan.net/site/python/pagliacci/ElementFilter.html It's an approach suggested by the Specification Pattern eg. http://www.martinfowler.com/apsupp/spec.pdf Not tested beyond what follows (no time for more at

Re: python coding contest

2005-12-26 Thread Malte Dik
Tim Hochberg wrote: Claudio Grondi wrote: Peter Otten wrote: [SNIP] How good is good for import test_vectors seven_seg = test_vectors.test_vectors.get or code using the test suite in general? Peter This started to remind myself about the story of the contest where the shortest program

Re: Indentation/whitespace

2005-12-26 Thread James Tanis
On 26 Dec 2005 04:10:11 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: i think you can't call an editor python capable unless it shows you clearly hard (yuck)or soft tabs like View / Show Invisibles in textmate, View / view whitespace in komodo. Zeus for Windows has this View / View

Re: closing stdin, stdout and stderr

2005-12-26 Thread Martijn Brouwer
On Mon, 2005-12-26 at 23:13 +, Robin Becker wrote: Martijn Brouwer wrote: I am writing a unix daemon in python, so I want to close stdin, stdout and stderr. My first attempt was to the standard file descriptors using their close() methods. After closing stdout, I could not print

Re: closing stdin, stdout and stderr

2005-12-26 Thread Martijn Brouwer
On Mon, 2005-12-26 at 23:15 +, Robin Becker wrote: Robin Becker wrote: Martijn Brouwer wrote: I am writing a unix daemon in python, so I want to close stdin, stdout and stderr. My first attempt was to the standard file descriptors using their close() methods. After closing

Re: python coding contest

2005-12-26 Thread Steven D'Aprano
On Mon, 26 Dec 2005 13:33:42 -0700, Tim Hochberg wrote: Claudio Grondi wrote: I am currently at 39 bytes following the requirements and the principle given above (my module passes the test). Anyone able to beat that? Wow! It'll be interesting to see how to do that. The obvious way gives

Re: Beautiful Python

2005-12-26 Thread rbt
[EMAIL PROTECTED] wrote: Gekitsuu wrote: I've been reading a lot of python modules lately to see how they work and I've stumbled across something that's sort of annoying and wanted to find out of there was a good reason behind it. In a Perl program when you're calling other modules you'll add

Re: python coding contest

2005-12-26 Thread Christian Tismer
Steven D'Aprano wrote: On Mon, 26 Dec 2005 13:33:42 -0700, Tim Hochberg wrote: Claudio Grondi wrote: I am currently at 39 bytes following the requirements and the principle given above (my module passes the test). Anyone able to beat that? Wow! It'll be interesting to see how to do that.

Re: python coding contest

2005-12-26 Thread Tim Hochberg
Steven D'Aprano wrote: On Mon, 26 Dec 2005 13:33:42 -0700, Tim Hochberg wrote: Claudio Grondi wrote: I am currently at 39 bytes following the requirements and the principle given above (my module passes the test). Anyone able to beat that? Wow! It'll be interesting to see how to do

Re: python coding contest

2005-12-26 Thread Christian Tismer
Tim Hochberg wrote: import test;seven_seg=test.test_vectors.get Oupps, good (being blinded after all the other from imports and __import__(...) ) -- Christian Tismer :^) mailto:[EMAIL PROTECTED] tismerysoft GmbH : Have a break! Take a ride on

Re: python coding contest

2005-12-26 Thread Tim Hochberg
Tim Hochberg wrote: [CHOP] import test;seven_seg=test.test_vectors.get This works if you run test. It fails if you try to run it standalone since the import order is wrong. [CHOP] Or maybe not. An earlier version did, but this one seems OK. -tim --

Re: Hypergeometric distribution

2005-12-26 Thread Steven D'Aprano
On Mon, 26 Dec 2005 12:18:55 -0800, Raven wrote: Hi to all, I need to calculate the hpergeometric distribution: choose(r, x) * choose(b, n-x) p(x; r,b,n) = - choose(r+b, n) choose(r,x) is the

Re: help with lists and writing to file in correct order

2005-12-26 Thread Steven D'Aprano
On Mon, 26 Dec 2005 13:54:37 -0800, homepricemaps wrote: hey folks, have a logic question for you. appreciate the help in advance. i am scraping 3 pieces of information from the html namely the food name , store name and price. and i am doing this for many different food items found ni

Re: help with lists and writing to file in correct order

2005-12-26 Thread homepricemaps
sorry guys, here is the code for incident in bs('a', {'class' : 'price'}): price = for oText in incident.fetchText( oRE): price += oText.strip() + ',' for incident in bs('div', {'class' : 'store'}): store = for oText in

Re: python coding contest

2005-12-26 Thread Justin Azoff
Tim Hochberg wrote: In the 130's is definately possible, but I haven't heard of anyone doing better than that. I have a version that is 127, but only if you strip extra whitespace :-( -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: help with lists and writing to file in correct order

2005-12-26 Thread Steven D'Aprano
On Mon, 26 Dec 2005 17:44:43 -0800, homepricemaps wrote: sorry guys, here is the code for incident in bs('a', {'class' : 'price'}): price = for oText in incident.fetchText( oRE): price += oText.strip() + ',' for incident in bs('div', {'class' :

Re: python coding contest

2005-12-26 Thread Remi Villatel
Tim Hochberg wrote: I am currently at 39 bytes following the requirements and the principle given above (my module passes the test). Anyone able to beat that? Wow! It'll be interesting to see how to do that. The obvious way gives 53 bytes. Hmmm, I'll have to see what can be done... 39

Re: python coding contest

2005-12-26 Thread Christian Tismer
Remi Villatel wrote: 39 bytes... 53 bytes... It gives me the impression to follow a jet plane with a bike with my 179 bytes! There isn't a single superfluous byte. My code is so compressed that the syntactic colorizer can't cope any more. I definitively need a new algorythm. g You

how-to POST form data to ASP pages?

2005-12-26 Thread livin
I need to post form data to an ASP page that looks like this on the page itself... form method='POST'input src=\icons\devices\coffee-on.gif type='image' align='absmiddle' width=16 height=16 title='Off'input type='hidden' value='Image' name='Action'input type='hidden' value='hs.ExecX10ByName

Re: __slots__ and copy again: why does it work?

2005-12-26 Thread fortepianissimo
More weird observations: the following code does not work until you change the name of the member 'longer' to a one-char name, for example, 'j': --- START --- #!/usr/bin/env python import copy class Foo (object): __slots__ = 'i' class Bar (Foo): __slots__ = 'longer' #__slots__ = 'j'

Re: help with lists and writing to file in correct order

2005-12-26 Thread homepricemaps
here is the write part: out = open(test.txt, 'a') out.write (store+ food+ price + \n) out.close() Steven D'Aprano wrote: On Mon, 26 Dec 2005 17:44:43 -0800, homepricemaps wrote: sorry guys, here is the code for incident in bs('a', {'class' : 'price'}):

Re: XPath-like filtering for ElementTree

2005-12-26 Thread Jean-Paul Calderone
On 26 Dec 2005 15:42:56 -0800, Gerard Flanagan [EMAIL PROTECTED] wrote: Pseudo-XPath support for ElementTree with the emphasis on 'Pseudo'. http://gflanagan.net/site/python/pagliacci/ElementFilter.html [snip] ns = xmlns1 path = r{%s}To/[EMAIL PROTECTED]'Mrs Jones' and @test==3] %

Re: python coding contest

2005-12-26 Thread Scott David Daniels
Remi Villatel wrote: Tim Hochberg wrote: I am currently at 39 bytes following the requirements and the principle given above (my module passes the test). Anyone able to beat that? Wow! It'll be interesting to see how to do that. The obvious way gives 53 bytes. Hmmm, I'll have to see

Re: build curiosities of svn head (on WinXP)

2005-12-26 Thread David Murmann
Fredrik Lundh schrieb: try setting the locale (via the locale module) from the interactive prompt, and see if Python still handles floating point values correctly. well, it does not: import locale locale.setlocale(locale.LC_ALL, '') 'German_Germany.1252' 3.141592 3.0 so this is where the

Re: help with lists and writing to file in correct order

2005-12-26 Thread homepricemaps
the problem with writing to teh file immidiately is that it ends up writing all food items together, and then all store items and then all prices i want food, store, price food, store, price -- http://mail.python.org/mailman/listinfo/python-list

Re: build curiosities of svn head (on WinXP)

2005-12-26 Thread David Murmann
David Murmann schrieb: i will try building 2.4.2 with nant later and see what that does... FYI i did this now and it worked fine, all tests passed. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hypergeometric distribution

2005-12-26 Thread Alex Martelli
Raven [EMAIL PROTECTED] wrote: Hi to all, I need to calculate the hpergeometric distribution: choose(r, x) * choose(b, n-x) p(x; r,b,n) = - choose(r+b, n) choose(r,x) is the binomial coefficient I

Re: help with lists and writing to file in correct order

2005-12-26 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: the problem with writing to teh file immidiately is that it ends up writing all food items together, and then all store items and then all prices i want food, store, price food, store, price Well, if it all fits in memory, append each to its own list, and then

Re: __slots__ and copy again: why does it work?

2005-12-26 Thread fortepianissimo
Mystery solved - when there's only one slot I should've used __slots__ = ('i', ). Duh! So in short, __slots__ and copy.copy() work fine in Python 2.4.2. -- http://mail.python.org/mailman/listinfo/python-list

Re: __slots__ and copy again: why does it work?

2005-12-26 Thread limodou
26 Dec 2005 20:33:35 -0800, fortepianissimo [EMAIL PROTECTED]: Mystery solved - when there's only one slot I should've used __slots__ = ('i', ). Duh! So in short, __slots__ and copy.copy() work fine in Python 2.4.2. Hard works, but very useful :) -- I like python! My Blog:

Re: __slots__ and copy again: why does it work?

2005-12-26 Thread fortepianissimo
To be complete, the first code snippet, when modified as follows, works fine in Python 2.4.2: --- START --- #!/usr/bin/env python import copy class Foo (object): __slots__ = ('i', ) def __init__ (self): self.i = 10 class Bar (Foo): __slots__ = ('j', ) def __init__ (self):

Re: help with lists and writing to file in correct order

2005-12-26 Thread homepricemaps
sorry for asking such beginner questions but i tried this and nothing wrote to my text file for food, price, store in bs(food, price, store): out = open(test.txt, 'a') out.write (food + price + store) out.close() while if i write

Re: how-to POST form data to ASP pages?

2005-12-26 Thread Mike Meyer
livin livin@@cox.net writes: I need to post form data to an ASP page that looks like this on the page itself... form method='POST'input src=\icons\devices\coffee-on.gif type='image' align='absmiddle' width=16 height=16 title='Off'input type='hidden' value='Image' name='Action'input

Re: email package and line ending

2005-12-26 Thread Tim Roberts
Manlio Perillo [EMAIL PROTECTED] wrote: The problem is this code: import email.Message msg = email.Message.Message() msg[subject] = email bug msg[from] = Manlio Perillo print repr(msg.as_string()) 'subject: email bug\nfrom: Manlio Perillo\n\n' Why line ending is '\n' and not '\r\n' ?

Re: help with lists and writing to file in correct order

2005-12-26 Thread bonono
[EMAIL PROTECTED] wrote: sorry for asking such beginner questions but i tried this and nothing wrote to my text file for food, price, store in bs(food, price, store): out = open(test.txt, 'a') out.write (food + price + store)

Plone Setup on Https

2005-12-26 Thread madhusudand
Hi Gays, I have setup plone , its workingon port 8080 , now i need to plone work on secure layer, ie on https, my apache is configure ssl and localhost is also working on https , but plone is not working Any ideas how to setup on https plone Madhu --

Re: Windows and python execution

2005-12-26 Thread Tim Roberts
Mark Carter [EMAIL PROTECTED] wrote: rzed wrote: Mark Carter [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: What I would like to do it type something like myscript.py instead of python myscript.py As another poster points out, be sure that your Python is on your path. And

MySQLdb Python API: Unable to connect

2005-12-26 Thread Mondal
Hi, I am using MySQL 5.0 beta and Active Python 2.4. I have the correct version of MySQLdb installed. The problem is that I can't connect to MySQL through the Active Python interactive window. Here is a sample error:

problem with libxml2dom

2005-12-26 Thread ankit
Hi I am using libxml2dom package for DOM support in libxml2. There are some test programs in the package when I try to run that samples it give me following error: Traceback (most recent call last): File prettyprint.py, line 7, in ? d = libxml2dom.parse(sys.argv[1]) File

problems with libxml2dom

2005-12-26 Thread ankit
Hi, I am working with libxml2dom package for having DOM support with libxml2. There are some test examples are given along with the package but when I try to run that, it gives me following error: Traceback (most recent call last): File namespaces.py, line 23, in ? document =

  1   2   >