Re: generate tuples from sequence

2007-01-17 Thread Peter Otten
Alan Isaac wrote: > "Peter Otten" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> I like >> >> >>> items = range(9) >> >>> N = 3 >> >>> zip(*[iter(items)]*N) >> [(0, 1, 2), (3, 4, 5), (6, 7, 8)] > > Except that it is considered implementation dependent: > http://mail.python.org/p

More M2Crypto issues

2007-01-17 Thread John Nagle
I've been running M2Crypto successfully using Python 2.4 on Windows 2000, and now I'm trying to get it to work on Python 2.3.4 on Linux. Attempting to initialize a context results in Traceback (most recent call last): File "/www/htdocs/sitetruth.com/cgi/ratingdetails.cgi", line 46, in ?

Re: [Python-Dev] Deletion order when leaving a scope?

2007-01-17 Thread Paul McGuire
"Calvin Spealman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Absolutely an irrelevent side effect, especially when you take into > consideration the 4 and counting alternative implementations of the > language. > > None the less, I can explain why it is as it is, keeping in mind

Re: Class data members in C

2007-01-17 Thread Hendrik van Rooyen
"Nick Maclaren" <[EMAIL PROTECTED]> wrote: > > In article <[EMAIL PROTECTED]>, > "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > |> > > |> > Hmm. The extensions documentation describes how to add instance > |> > members to a class (PyMemberDef), but I want to add a class member. > |> > Yes,

Socket Error 106: 'Transport endpoint is already connected'

2007-01-17 Thread palmem
I am trying to write a simple FTP server in order to learn about sockets This is my first time trying sockets This code should take a connection on port 8110, dump it to a client "thread" (not a thread yet), print "Test\n" to the thread, and close everything. It fails on creating the client thread

Re: example from the book

2007-01-17 Thread Paul McGuire
"questions?" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am a little confused by an example in python book: > > class wrapper: >def __init__(self,object): >self.wrapped=object >def __getattr__(self,attrname): >print "Trace:",attrname (<<

Re: generate tuples from sequence

2007-01-17 Thread Alan Isaac
"Peter Otten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I like > > >>> items = range(9) > >>> N = 3 > >>> zip(*[iter(items)]*N) > [(0, 1, 2), (3, 4, 5), (6, 7, 8)] Except that it is considered implementation dependent: http://mail.python.org/pipermail/python-list/2005-February

Re: Projects anyone?

2007-01-17 Thread placid
Thanks for all the help. I have some projects that i will look into and see if i can contribute anything Cheers Ben Finney wrote: > "placid" <[EMAIL PROTECTED]> writes: > > > I'm looking for anyone who is working on a project at the moment that > > needs help (volunteer). > > The Volunteer Opport

example from the book

2007-01-17 Thread questions?
I am a little confused by an example in python book: class wrapper: def __init__(self,object): self.wrapped=object def __getattr__(self,attrname): print "Trace:",attrname print getattr(self.wrapped,attrname) (*) return getattr(self.wrapped,attrname)

Re: Asyncore select statement problem

2007-01-17 Thread MrJean1
Try using another ascyncore example and see if that works for you. Maybe, first one without threading, like Asyncore worked fine on my application on Linux, but haven't tried that on MacOS. /Jean Brouwers JamesHoward wr

1, 2, 3, 5, 7... PRIME Numbers

2007-01-17 Thread newstips6706
1, 2, 3, 5, 7... PRIME Numbers [ Mathematics / Physics / Engineering ] Definitions What is a PRIME Number ? A PRIME number is a number whose only positive divisors are one and itself. What is a MAGIC SQUARE? A magic square is an arrangement of numbers in a sq

Re: [Python-Dev] Deletion order when leaving a scope?

2007-01-17 Thread Calvin Spealman
Absolutely an irrelevent side effect, especially when you take into consideration the 4 and counting alternative implementations of the language. None the less, I can explain why it is as it is, keeping in mind its not like that on purpose, its just how it is. Locals are optimized into an array fo

Re: The proper use of QSignalMapper

2007-01-17 Thread borntonetwork
Thanks, David, for you help. When I change the slot function to what you show in your second example, I get the same results: nothing. When I change it to what you have in your first example, I get the following: Object::connect: No such slot QApplication::map() Object::connect: (sender name:

import vs. subdirectory search

2007-01-17 Thread John Nagle
Some obscure import issues: I'm running Python 2.3.4 from a CGI script on a shared hosting Linux system. The CGI program is being executed from Apache, as "nobody". I have some local modules installed in "~myname/lib/python"; these include "MySQLdb" and "M2Crypto". Since this is running

Re: Units of measurement

2007-01-17 Thread Robert Kern
Russ wrote: > Robert Kern wrote: >> And there was another one announced here sometime in the past year or so, >> IIRC, >> but I don't recall the name of it or that of the author. :-( > > Perhaps you are referring to the scalar class at > http://RussP.us/scalar.htm Yup, you're the one. -- Rob

PyMeld for html templates?

2007-01-17 Thread Sean Schertell
I'm trying to decide which template system to get married to. I think I've narrowed it down to PyMeld, Cheetah, or Jinja but leaning heavily toward PyMeld because I love the idea that your templates are *totally* clean and that get manipulated from behind the scenes. This seems to be elega

Re: Units of measurement

2007-01-17 Thread Russ
Robert Kern wrote: > Paul Rubin wrote: > > I'm sure this has been done before, but it just struck my fancy, an > > example of Python's "emulating numeric types", inspired by the old > > Unix "units" utility, and the Frink language. > > Oh yeah, it's been done before. Several times over, in fact.

aligning ElementTrees to text

2007-01-17 Thread Steven Bethard
I'm trying to align an XML file with the original text file from which it was created. Unfortunately, the XML version of the file has added and removed some of the whitespace. For example:: >>> plain_text = ''' ... Pacific First Financial Corp. said shareholders approved its ... a

Re: Anyone has a nice "view_var" procedure ?

2007-01-17 Thread Gabriel Genellina
At Wednesday 17/1/2007 19:46, Stef Mientki wrote: > for key,value in count: > line += ' %s=%d' % (key, value) > I didn't succeed to use value as a enumerator, and I had to typecast key into a string (and skipping some redundant information, but then it works great, thanks !! Ouc

Re: How can I create a linked list in Python?

2007-01-17 Thread Paul Rubin
"sturlamolden" <[EMAIL PROTECTED]> writes: > Actually, nesting tuples or lists doesn't really duplicate Lisp cons, > as one can only create a stack-like object with the nesting. Python > really need a cons type like Lisp. I think it is time to write one, in > a plain C extension. But that's what L

Re: Making a simple script standalone

2007-01-17 Thread Gabriel Genellina
At Wednesday 17/1/2007 16:05, Rikishi 42 wrote: >>What I want to do is to compile/bundle/prepare/whatever_term a simple >>Python script for deployment on a Windows machine. Installing Python >>itself on that machine, is not an option. Ideally I would like to obtain >>a single executable file, bu

Asyncore select statement problem

2007-01-17 Thread JamesHoward
I have a problem with python's asyncore module throwing a bad file descriptor error. The code might be difficult to copy here, but the problem is essentially: The server wants to sever the connection of an open Asyncore socket. Calling the socket.close() nor the socket.shutdown(2) calls seem to w

Re: How can I create a linked list in Python?

2007-01-17 Thread sturlamolden
Bruno Desthuilliers wrote: > Have you considered using tuples ? If you go the FP way, why not use an > immutable type ? Well, good question. Tuples are immutable, which means they are immutable. So you cannot use a cursor to change an element inside the list. So instead of changing the original

Re: Anyone has a nice "view_var" procedure ?

2007-01-17 Thread Stef Mientki
hi Gabriel, > It appears that you're a number crunching guy - you absolutely ignore > all types except numeric ones! :) Is there anything else than numbers ? ;-) But indeed I forgot the else statement, which should look like this: else: line = 'UNKNOWN: ' + type(V) print line li

Re: Making a simple script standalone

2007-01-17 Thread David Brochu
Hi, I'm new to this group. I've tried finding my answer in existing messages, but no such luck. What I want to do is to compile/bundle/prepare/whatever_term a simple Python script for deployment on a Windows machine. Installing Python itself on that machine, is not an option. Ideally I would like

Re: Would a Dutch speaker please check this wiki page please?

2007-01-17 Thread Stef Mientki
[EMAIL PROTECTED] wrote: > Got a note about a new page on the Python Wiki: > >> "Wade" == Wade McDaniel <[EMAIL PROTECTED]> writes: > > http://wiki.python.org/moin/Selcuk_Altun > > I suspect it's junk since it doesn't seem to mention Python and the website > it mentions doesn't seem to e

Re: Units of measurement

2007-01-17 Thread Robert Kern
Paul Rubin wrote: > I'm sure this has been done before, but it just struck my fancy, an > example of Python's "emulating numeric types", inspired by the old > Unix "units" utility, and the Frink language. Oh yeah, it's been done before. Several times over, in fact. Unum http://home.tiscali.be/be0

Re: Would a Dutch speaker please check this wiki page please?

2007-01-17 Thread Paul Rubin
[EMAIL PROTECTED] writes: > http://wiki.python.org/moin/Selcuk_Altun > > I suspect it's junk since it doesn't seem to mention Python and the website > it mentions doesn't seem to exist. Still, just in case... I'm not a dutch speaker but treating it as garbled german-english "captcha", I thin

Re: Would a Dutch speaker please check this wiki page please?

2007-01-17 Thread Gian Mario Tagliaretti
[EMAIL PROTECTED] wrote: > Got a note about a new page on the Python Wiki: > >> "Wade" == Wade McDaniel <[EMAIL PROTECTED]> writes: > > http://wiki.python.org/moin/Selcuk_Altun > > I suspect it's junk since it doesn't seem to mention Python and the > website it says: Welcome on my sit

Re: predefined empty base class ??

2007-01-17 Thread Gabriel Genellina
At Wednesday 17/1/2007 15:34, Dennis Lee Bieber wrote: > is there an predefined empty base class > which I can instanziate to have an > container i can copy attributes in? I think that's a two-liner... >>> class EmptyBase(object): ... pass Do you want a one liner? class EmptyBas

Units of measurement

2007-01-17 Thread Paul Rubin
I'm sure this has been done before, but it just struck my fancy, an example of Python's "emulating numeric types", inspired by the old Unix "units" utility, and the Frink language. The language reference for these features is somewhat unclear and I'll enter some sourceforge items. Maybe I'll writ

Would a Dutch speaker please check this wiki page please?

2007-01-17 Thread skip
Got a note about a new page on the Python Wiki: > "Wade" == Wade McDaniel <[EMAIL PROTECTED]> writes: http://wiki.python.org/moin/Selcuk_Altun I suspect it's junk since it doesn't seem to mention Python and the website it mentions doesn't seem to exist. Still, just in case... Thx, Ski

Re: why scipy cause my program slow?

2007-01-17 Thread Travis Oliphant
Robert Kern wrote: > HYRY wrote: > >>Why the exec time of test(readdata()) and test(randomdata()) of >>following program is different? >>my test file 150Hz10dB.wav has 2586024 samples, so I set randomdata >>function >>to return a list with 2586024 samples. >>the exec result is: >>2586024 >> >>10.8

Re: Making a simple script standalone

2007-01-17 Thread robert
Rikishi 42 wrote: > Hi, > I'm new to this group. I've tried finding my answer in existing messages, > but no such luck. > > What I want to do is to compile/bundle/prepare/whatever_term a simple > Python script for deployment on a Windows machine. Installing Python > itself on that machine, is not

Re: 2.3-2.5 what improved?

2007-01-17 Thread Gabriel Genellina
At Wednesday 17/1/2007 10:29, billie wrote: > Python 2.5 became quite fat. For bare CGI the Python load/init > time eats all improvements. Smaller scripts even loose lot of speed. What do you mean? Fat of libraries or fat itself? I tought that 2.5 was faster than precedent versions! :-\ It run

Re: *POLL* How many sheeple believe in the 911 fairy tale and willingto accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread xyzl
http://www.thebestpageintheuniverse.net/c.cgi?u=911_morons -- http://mail.python.org/mailman/listinfo/python-list

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread Carl G.
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] ... Please explain what 911 conspiracy theories have to do with the Python computer language? If this is to be taken seriously, why is it being cross-posted to sci.math, sci.physics, sci.chem, sci.optics, and comp.lang.python? Such

OT: Apology

2007-01-17 Thread Carroll, Barry
Greetings: I've been trying to get the contributors to this thread to move their discussion to a more appropriate forum, but the unintended result has been more spam on this forum. My apologies to the regular readers of this newsgroup. This will be my last public post on this subject. I just ho

Re: How can I create a linked list in Python?

2007-01-17 Thread Bruno Desthuilliers
sturlamolden a écrit : > Bruno Desthuilliers wrote: > > >>Implementing linked lists in Python is not a great deal - it just >>doesn't make much sens. > > > It does make sence, Oh Yec ?-) sorry... > as there are memory constraints related to it. > Python lists are arrays under the hood. This

Re: XLM prolgoue

2007-01-17 Thread Martin v. Löwis
fscked schrieb: > How do I go about creating the XML prologue like I want it to be? print " % (version, encoding) Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Conflicting needs for __init__ method

2007-01-17 Thread Ben Finney
Chuck Rhode <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > > I recommend, instead, separate factory functions for separate > > input types. > > Uh, how 'bout separate subclasses for separate input types? The resulting object in each case would be the same type ('Rational'), with the same beh

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread st911
David Bostwick wrote: > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > > > >David Bostwick wrote: > > [...] > > >Indeed, the 19 hijacker theory is a fairy tale based on illogical > >forensic investigation. > >As for dissent, Bush is on video record to utter, "Lets not tolerate > >any c

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread David Bostwick
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > >David Bostwick wrote: [...] >Indeed, the 19 hijacker theory is a fairy tale based on illogical >forensic investigation. >As for dissent, Bush is on video record to utter, "Lets not tolerate >any conspiracy theories." >The video is floati

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread st911
Hix, look at links on this link/page for pop mech: http://mail.python.org/pipermail/python-list/2006-September/403442.html it has v v goood links [EMAIL PROTECTED] wrote: > Robert Hicks wrote: > > [EMAIL PROTECTED] wrote: > > > Robert Hicks wrote: > > > > Please, none of the real facts points to

RE: *POLL* How many sheeple believe in the 911 fairy tale and willingto accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread Carroll, Barry
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 17, 2007 11:12 AM > To: python-list@python.org > Subject: Re: *POLL* How many sheeple believe in the 911 fairy tale and > willingto accept an Orwellian doublespeak and enslavement world ? >

RE: *POLL* How many sheeple believe in the 911 fairy tale and willingto accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread Carroll, Barry
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 17, 2007 11:05 AM > To: python-list@python.org > Subject: Re: *POLL* How many sheeple believe in the 911 fairy tale and > willingto accept an Orwellian doublespeak and enslavement world ? >

Re: XLM prolgoue

2007-01-17 Thread Sébastien Boisgérault
fscked wrote: > How do I go about creating the XML prologue like I want it to be? > Specifically, I am trying to add encoding and some namespace stuff. The XML declaration and the DTD that may appear in the prolog are optional. [22]prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? [23]XMLD

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread st911
Robert Hicks wrote: > [EMAIL PROTECTED] wrote: > > Robert Hicks wrote: > > > Please, none of the real facts points to anything else except what > > > actually happened. Two planes hit two towers and they came down. > > > > The issue is the causality of the towers coming down. > > > > A magician pu

RE: *POLL* How many sheeple believe in the 911 fairy tale and willingto accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread Carroll, Barry
> -Original Message- > From: David Bostwick [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 17, 2007 10:43 AM > To: python-list@python.org > Subject: Re: *POLL* How many sheeple believe in the 911 fairy tale and > willingto accept an Orwellian doublespeak and enslavement world ? > > I

Re: Python-list Digest, Vol 40, Issue 215

2007-01-17 Thread David Brochu
How is it that when I try to send out a valid response to help someone with their python issue I get flagged, but this guy can send out something totally useless to the python community? -- Forwarded message -- From: [EMAIL PROTECTED] (David Bostwick) To: python-list@python.o

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread st911
David Bostwick wrote: > In article <[EMAIL PROTECTED]>, "Robert Hicks" <[EMAIL PROTECTED]> wrote: > >Please, none of the real facts points to anything else except what > >actually happened. Two planes hit two towers and they came down. > > > > You're talking to the wind. This is a conspiracy prec

Re: Making a simple script standalone

2007-01-17 Thread Rikishi 42
On Wednesday 17 January 2007 00:48, Larry Bates wrote: >> There is nothing graphical, nothing fancy about the script. >> The only imports are: os, stat, string and time. >> >> Any suggestions on an - easy and clear - path to follow ? > I use py2exe and inno installer. Works great. Thanks, I wil

Re: Making a simple script standalone

2007-01-17 Thread Rikishi 42
On Wednesday 17 January 2007 00:22, James Stroud wrote: >> There is nothing graphical, nothing fancy about the script. >> The only imports are: os, stat, string and time. >> >> Any suggestions on an - easy and clear - path to follow ? > > > pyinstaller + innosetup. I will look into it, thanks!

Re: Making a simple script standalone

2007-01-17 Thread Rikishi 42
On Wednesday 17 January 2007 03:33, Gabriel Genellina wrote: > At Tuesday 16/1/2007 19:49, Rikishi 42 wrote: > >>What I want to do is to compile/bundle/prepare/whatever_term a simple >>Python script for deployment on a Windows machine. Installing Python >>itself on that machine, is not an option.

Re: A note on heapq module

2007-01-17 Thread Steven Bethard
Antoon Pardon wrote: > For me, your class has the same drawback as the heappush, heappop > procedurers: no way to specify a comparision function. Agreed. I'd love to see something like ``Heap(key=my_key_func)``. STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread st911
Robert Hicks wrote: > Please, none of the real facts points to anything else except what > actually happened. Two planes hit two towers and they came down. The issue is the causality of the towers coming down. A magician pulls appears to cast a spell and out comes a rabbit out of his hat. There

Re: Check a windows service

2007-01-17 Thread awel
Thanks for all 'cause you've really helped me Just one thing in the last line for the specific service, you' ve writted : >print service but I think it is : >print service.Caption Tim Golden a écrit : > awel wrote: > > Sorry, but could you give me an example with a real service 'cause

Re: question about module resolution

2007-01-17 Thread Emin
I put the lines you suggested in baz.py, but got an error: Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import baz Traceback (most recent call last): File "", line 1, in File "baz.

Re: *POLL* How many sheeple believe in the 911 fairy tale and willingto accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread Robert Hicks
> > Regards, > > Barry > [EMAIL PROTECTED] > 541-302-1107 > > We who cut mere stones must always be envisioning cathedrals. > > -Quarry worker's creed Sure, but did you actually post your phone number on USENET? Robert -- http://mail.python.org/mailman/listinfo/python-

RE: *POLL* How many sheeple believe in the 911 fairy tale and willingto accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread Carroll, Barry
> -Original Message- > From: Robert Hicks [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 17, 2007 10:33 AM > To: python-list@python.org > Subject: Re: *POLL* How many sheeple believe in the 911 fairy tale and > willingto accept an Orwellian doublespeak and enslavement world ? > > Ple

RE: *POLL* How many sheeple believe in the 911 fairy tale and willingto accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread Carroll, Barry
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 17, 2007 10:23 AM > To: python-list@python.org > Subject: Re: *POLL* How many sheeple believe in the 911 fairy tale and > willingto accept an Orwellian doublespeak and enslavement world ? >

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread David Bostwick
In article <[EMAIL PROTECTED]>, "Robert Hicks" <[EMAIL PROTECTED]> wrote: >Please, none of the real facts points to anything else except what >actually happened. Two planes hit two towers and they came down. > You're talking to the wind. This is a conspiracy precisely because people deny the cra

Re: predefined empty base class ??

2007-01-17 Thread robert
robert wrote: > iwl wrote: >> Hi, >> >> is there an predefined empty base class >> which I can instanziate to have an container i can copy attributes in? >> > > you are not the only one missing such class > > http://groups.google.com/group/comp.lang.python/msg/3ff946e7da13dba9 > > RFE SF #163792

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread Robert Hicks
Please, none of the real facts points to anything else except what actually happened. Two planes hit two towers and they came down. -- http://mail.python.org/mailman/listinfo/python-list

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread st911
> ... buildings collapse all the time when you design to the cold-formed > strength rather than the hot-formed strength of a material, then heat > the material removing its tempered strength (which for steel occurs at > much lower than usual flame temeratures). Actually, modern steel frame buildi

Re: Distributed computation of jobs

2007-01-17 Thread robert
Paul Boddie wrote: > A.T.Hofkamp skrev: >> Let me add a few cents to the discussion with this announcement: > > [Notes about exec_proxy, batchlib and rthread] > > I've added entries for these modules, along with py.execnet, to the > parallel processing solutions page on the python.org Wiki: > >

Re: predefined empty base class ??

2007-01-17 Thread robert
iwl wrote: > Hi, > > is there an predefined empty base class > which I can instanziate to have an > container i can copy attributes in? > you are not the only one missing such class http://groups.google.com/group/comp.lang.python/msg/3ff946e7da13dba9 RFE SF #1637926 Robert -- http://mail.p

XLM prolgoue

2007-01-17 Thread fscked
How do I go about creating the XML prologue like I want it to be? Specifically, I am trying to add encoding and some namespace stuff. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: Capture traceback message to string?

2007-01-17 Thread Chris Mellon
On 17 Jan 2007 15:31:03 GMT, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Sean Schertell wrote: > > > Hello! > > > > I'm new to Python and this is my first post to the list. > > > > I'm trying to simply capture exception text to a few strings which > > can be passed to a PSP page to display a prett

Re: predefined empty base class ??

2007-01-17 Thread Diez B. Roggisch
> is there an predefined empty base class > which I can instanziate to have an > container i can copy attributes in? No, but you can always do class Foo(object): pass foo = Foo() foo.attribute = value Diez -- http://mail.python.org/mailman/listinfo/python-list

predefined empty base class ??

2007-01-17 Thread iwl
Hi, is there an predefined empty base class which I can instanziate to have an container i can copy attributes in? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to write unicode to a txt file?

2007-01-17 Thread Facundo Batista
Frank Potter wrote: > But it seems that python can't directly write unicode to a file, You need to use the method open from module codecs: >>> import codecs >>> a = codecs.open("pru_uni.txt", "w", "utf-8") >>> txt = unicode("campeón\n", "utf-8") >>> a.write(txt) >>> a.close() >>> So, then, fro

Re: urrlib2 multithreading error

2007-01-17 Thread Facundo Batista
[EMAIL PROTECTED] wrote: > I'm using urllib2 to retrieve some data usign http in a multithreaded > application. > Here's a piece of code: > req = urllib2.Request(url, txdata, txheaders) > opener = urllib2.build_opener() > opener.addheaders = [('User-agent

Re: 2.3-2.5 what improved?

2007-01-17 Thread Bruno Desthuilliers
billie a écrit : > robert wrote > >> Robin Becker wrote: >>> A large cgi based web Python-2.3 application needs to be speed improved. >>> experiments show the following under reasonable testing (these are 2 >>> second reportlab pdf productions) >>> >>> 1) 2.3 --> 2.5 improvement small 1-2% >>> 2)

Re: Globbing files by their creation date

2007-01-17 Thread Jean-Paul Calderone
On 17 Jan 2007 08:31:07 -0800, [EMAIL PROTECTED] wrote: > >Thanks a mill - os.path.getctime(f) is what I needed. Unfortunately, my >attempts to turn the integer it returns into a date have failed. > os.path.getctime(fn)#fn was created today, 1/17/2007 >1168955503 > >I tried to convert this

Re: how to write unicode to a txt file?

2007-01-17 Thread Jean-Paul Calderone
On 17 Jan 2007 08:28:14 -0800, Frank Potter <[EMAIL PROTECTED]> wrote: >I want to change an srt file to unicode format so mpalyer can display >Chinese subtitles properly. >I did it like this: > >txt=open('dmd-guardian-cd1.srt').read() >txt=unicode(txt,'gb18030') >open('dmd-guardian-cd1.srt','w').wr

Re: Python Web Frameworks

2007-01-17 Thread Bruno Desthuilliers
Shortash a écrit : > Hi Gurus, > > I want to build a Python web app but im not sure which one to go for. I > prefer something like asp.Net , which would allow me to fully seperate > the presentation layer from the logic. Please advise? Django, Turbogears, Pylons(HQ), web.py, etc, etc, etc... Wel

Re: how to write unicode to a txt file?

2007-01-17 Thread Peter Otten
Frank Potter wrote: > I want to change an srt file to unicode format so mpalyer can display > Chinese subtitles properly. > I did it like this: > > txt=open('dmd-guardian-cd1.srt').read() > txt=unicode(txt,'gb18030') > open('dmd-guardian-cd1.srt','w').write(txt) > > But it seems that python can'

cannot import libxml2 python module on windoze using activePerl or Python IDLE

2007-01-17 Thread Andrew Marlow
guys, I have been using libxml2 with python with no problems for just over a week but now I come to see if my script will work in someone else's environment and the libxml2 import fails. I am using the python that comes with cygwin. When I try using ActivePython (2.3) or Python IDLE (2.5) there do

Re: Globbing files by their creation date

2007-01-17 Thread tkpmep
Thanks a mill - os.path.getctime(f) is what I needed. Unfortunately, my attempts to turn the integer it returns into a date have failed. >>> os.path.getctime(fn)#fn was created today, 1/17/2007 1168955503 I tried to convert this to a date object by typing >>>datetime.date.fromordinal(1168955

how to write unicode to a txt file?

2007-01-17 Thread Frank Potter
I want to change an srt file to unicode format so mpalyer can display Chinese subtitles properly. I did it like this: txt=open('dmd-guardian-cd1.srt').read() txt=unicode(txt,'gb18030') open('dmd-guardian-cd1.srt','w').write(txt) But it seems that python can't directly write unicode to a file, I g

Re: question about module resolution

2007-01-17 Thread Peter Otten
Emin wrote: > I often find myself wanting to have a child module get some parameters > defined in a parent module. For example, imagine I have the following > directory structure and want something in baz.py to look at a value in > config.py. I end up putting in things like import sys; > sys.path

Re: Python Web Frameworks

2007-01-17 Thread Andrey Khavryuchenko
Shortash, "S" == Shortash wrote: S> I want to build a Python web app but im not sure which one to go for. I S> prefer something like asp.Net , which would allow me to fully seperate S> the presentation layer from the logic. Please advise? Django? http://www.djangoproject.com -- Andrey V K

question about module resolution

2007-01-17 Thread Emin
Dear Experts, I often find myself wanting to have a child module get some parameters defined in a parent module. For example, imagine I have the following directory structure and want something in baz.py to look at a value in config.py. I end up putting in things like import sys; sys.path.append(

Re: 2.3-2.5 what improved?

2007-01-17 Thread Robin Becker
[EMAIL PROTECTED] wrote: > Robin Becker a écrit : > > > AFAIK, most of the speedup comes from optimization of the builtin dict > type, which is the central > data structure in Python. But anyway, as Robert pointed out, using CGI > means lauching > a new Python process for each and every HT

Re: 2.3-2.5 what improved?

2007-01-17 Thread Robin Becker
[EMAIL PROTECTED] wrote: > Robin> I sort of remember claims being made about 2.5 being 10% faster > Robin> than 2.4/2.3 etc etc. Can anyone say where the speedups were? > > What's New might be enlightening: > > http://www.google.com/search?q=what%27s+new+site%3Apython.org > > Skip th

Re: The proper use of QSignalMapper

2007-01-17 Thread David Boddie
borntonetwork wrote: > I am trying to implement QTCore.QSignalMapper using PyQT. I finally got > to a point where I don't receive any compile or runtime error messages, > but I also do not see the final slot function fire off. Here is a > snippet of the code: > > self.signalMapper = QtCore

Re: Python Web Frameworks

2007-01-17 Thread Diez B. Roggisch
Shortash wrote: > Python Web Frameworks weak google skills you have, young friend. http://wiki.python.org/moin/WebFrameworks Diez -- http://mail.python.org/mailman/listinfo/python-list

Python Web Frameworks

2007-01-17 Thread Shortash
Hi Gurus, I want to build a Python web app but im not sure which one to go for. I prefer something like asp.Net , which would allow me to fully seperate the presentation layer from the logic. Please advise? thanks, "Shortash' -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: Capture traceback message to string?

2007-01-17 Thread Thomas Guettler
Sean Schertell wrote: > Hello! > > I'm new to Python and this is my first post to the list. > > I'm trying to simply capture exception text to a few strings which > can be passed to a PSP page to display a pretty error message. The > problem is that I just can't seem to figure out how to get t

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-17 Thread dlzc
Dear schoenfeld: > After 6 years we still have a situation where almost all > the worlds physicists, engineers, and other so called > "academics" promote the idea that a few minor fires > can cause two towers to free fall. Why should physics and mechanics be any different than it is for 12 story

Re: IMAP SEARCH Error

2007-01-17 Thread Thomas Guettler
Roopesh wrote: > I am using the imaplib to fetch mails. There is an error thrown in the > search function, which I am not able to comprehend. I had difficulties with the imaplib, too. It is very low level. You need to know some parts of the IMAP protocol. I solved my problems by checking with et

Re: Distributed computation of jobs (was: Parallel Python)

2007-01-17 Thread Paul Boddie
A.T.Hofkamp skrev: > > Let me add a few cents to the discussion with this announcement: [Notes about exec_proxy, batchlib and rthread] I've added entries for these modules, along with py.execnet, to the parallel processing solutions page on the python.org Wiki: http://wiki.python.org/moin/Parall

Re: IMAP SEARCH Error

2007-01-17 Thread jean-michel bain-cornu
> imaplib.abort: command: SEARCH => unexpected response: '*' > > Can anyone tell me why this happens ? It looks like a server problem. What kind of server are you using ? Exchange, Cyrus ? Did you try with two different Imap servers ? If it is a unix server, did you have a look in /var/log ? Or

Re: Conflicting needs for __init__ method

2007-01-17 Thread Chuck Rhode
Ben Finney wrote this on Wed, Jan 17, 2007 at 08:27:54PM +1100. My reply is below. > I recommend, instead, separate factory functions for separate input > types. Uh, how 'bout separate subclasses for separate input types? -- .. Chuck Rhode, Sheboygan, WI, USA .. Weather: http://LacusVeris.co

The proper use of QSignalMapper

2007-01-17 Thread borntonetwork
Hi. I am trying to implement QTCore.QSignalMapper using PyQT. I finally got to a point where I don't receive any compile or runtime error messages, but I also do not see the final slot function fire off. Here is a snippet of the code: self.signalMapper = QtCore.QSignalMapper(window)

Re: 2.3-2.5 what improved?

2007-01-17 Thread skip
Robin> I sort of remember claims being made about 2.5 being 10% faster Robin> than 2.4/2.3 etc etc. Can anyone say where the speedups were? What's New might be enlightening: http://www.google.com/search?q=what%27s+new+site%3Apython.org Skip -- http://mail.python.org/mailman/listinf

Re: How can i eval subindex on list[ ][ ] ?

2007-01-17 Thread raghu
its working for me i think its better to mention the value of i and j for both lists or you might have done mistake while formatting strings it should be %s for strings and %d for numbers if any subelement in lists does not formatted properly it may lead to error -- http://mail.python.org/mailma

Re: generate tuples from sequence

2007-01-17 Thread M�ta-MCI
Hi! r=iter(range(9)) print zip(r,r,r) But, it's few like Peter... -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Number methods

2007-01-17 Thread Nick Maclaren
I can't find any description of these. Most are obvious, but some are not. Note that this is from the point of view of IMPLEMENTING them, not USING them. Specifically: Does Python use classic division (nb_divide) and inversion (nb_invert) or are they entirely historical? Note that I can very

  1   2   >