Re: usage of .encode('utf-8','xmlcharrefreplace')?

2008-02-18 Thread J Peyret
On Feb 18, 10:54 pm, 7stud <[EMAIL PROTECTED]> wrote: > One last point: you can't display a unicode string. The very act of > trying to print a unicode string causes it to be converted to a > regular string. If you try to display a unicode string without > explicitly encode()'ing it first, i.e.

Py_Finalize ERROR!

2008-02-18 Thread zaley
Py_Finalize ERROR! In my C++ program ,python is embeded . I create one win thread to run embedded Python code . So at the begin of thread function I call "Py_Initialize" and at the end of thread function call "Py_Finalize" . But after I began thread several times,the program crashed in function

Re: average of PIL images

2008-02-18 Thread Gabriel Genellina
En Tue, 19 Feb 2008 04:01:04 -0200, vaneric <[EMAIL PROTECTED]> escribió: > On Feb 19, 1:38 am, Robert Kern <[EMAIL PROTECTED]> wrote: >> Averaging color >> images is tricky; you really shouldn't do it in the RGB colorspace. > > hi, > thanx for the guidance and detailed replies..I tried to pac

Re: Threading the Python interpreter

2008-02-18 Thread Martin v. Löwis
MooJoo wrote: > I've read that the Python interpreter is not thread-safe Just to counter this misconception: the Python interpreter *is* thread-safe. It's just that it won't run in parallel with itself on multiple CPUs in a single process. Regards, Martin -- http://mail.python.org/mailman/listin

Re: usage of .encode('utf-8','xmlcharrefreplace')?

2008-02-18 Thread 7stud
To clarify a couple of points: On Feb 18, 11:38 pm, 7stud <[EMAIL PROTECTED]> wrote: > A unicode string looks like this: > > s = u'\u0041' > > but your string looks like this: > > s = 'he Company\xef\xbf\xbds ticker' > > Note that there is no 'u' in front of your string.   > That means your strin

Re: Why must implementing Python be hard unlike Scheme?

2008-02-18 Thread George Sakkis
On Feb 19, 1:15 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm learning Scheme and I am amazed how easy it is to start building a > half baked Scheme implementation that somewhat works. > > After knowing Python for *years* I have no idea how to actually > implement the darn thing. >From

Re: usage of .encode('utf-8','xmlcharrefreplace')?

2008-02-18 Thread 7stud
On Feb 18, 10:52 pm, "Carsten Haese" <[EMAIL PROTECTED]> wrote: > On Mon, 18 Feb 2008 21:36:17 -0800 (PST), J Peyret wrote > > > > > Well, as usual I am confused by unicode encoding errors. > > > I have a string with problematic characters in it which I'd like to > > put into a postgresql table. >

Re: The big shots

2008-02-18 Thread George Sakkis
On Feb 19, 12:08 am, [EMAIL PROTECTED] wrote: > The problem did not seem to be miscommunication, rather bias. IMHO it's partly because of the obscurity of the ideas and the code you suggest, and partly because of the poor job you do to explain them. By the way, you may have noticed that you have

Re: usage of .encode('utf-8','xmlcharrefreplace')?

2008-02-18 Thread J Peyret
OK, txs a lot. I will have to think a bit more about you said, what I am doing and how encode/decode fits in. You are right, I am confused about unicode. Guilty as charged. I've seen the decode+encode chaining invoked in some of the examples, but not the rationale for it. Also doesn't help that

Re: Understanding While Loop Execution

2008-02-18 Thread Tim Roberts
Gary Herron <[EMAIL PROTECTED]> wrote: > >So in the following code, the list named full does not have 3 copies of >sub in it, but rather it has 3 *references* to the single list named >sub. Since we are being picky here, it's more accurate to say that the list "full" contains 3 references to the

Why must implementing Python be hard unlike Scheme?

2008-02-18 Thread [EMAIL PROTECTED]
I'm learning Scheme and I am amazed how easy it is to start building a half baked Scheme implementation that somewhat works. After knowing Python for *years* I have no idea how to actually implement the darn thing. Does this have to be true? Beneath the more complex syntax are there a few core d

Re: The big shots

2008-02-18 Thread Gabriel Genellina
En Tue, 19 Feb 2008 01:14:10 -0200, <[EMAIL PROTECTED]> escribió: > I'm a little dissatisfied, and just thinking aloud. > > Some of the ideas that have been proposed on Python-ideas as well as > Python, have received partial evaluation from the alphas. (Note that I'm not a Python alpha, I don't v

Re: average of PIL images

2008-02-18 Thread vaneric
On Feb 19, 1:38 am, Robert Kern <[EMAIL PROTECTED]> wrote: >Averaging color > images is tricky; you really shouldn't do it in the RGB colorspace. hi, thanx for the guidance and detailed replies..I tried to pack the r,g,b into a single value like below(something a member posted in the past) def

Re: usage of .encode('utf-8','xmlcharrefreplace')?

2008-02-18 Thread Carsten Haese
On Mon, 18 Feb 2008 21:36:17 -0800 (PST), J Peyret wrote > Well, as usual I am confused by unicode encoding errors. > > I have a string with problematic characters in it which I'd like to > put into a postgresql table. > That results in a postgresql error so I am trying to fix things with > .encod

Re: Seemingly odd 'is' comparison.

2008-02-18 Thread Terry Reedy
"Asun Friere" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | So was that a yes or no? I mean is it even possible for the identity | behaviour of mutables to vary between implementations? I can't see | how they can possibly be interned, but is there some other factor I'm | missing

Re: name of client module

2008-02-18 Thread Jeff Schwab
Ben Finney wrote: > Nick Stinemates <[EMAIL PROTECTED]> writes: > >> Ah, I snipped because I was only replying to that specific part and >> thought there was an archive of the rest. If that is unconventional >> I'll stop. > > Please continue snipping the parts that aren't relevant to your reply.

Re: name of client module

2008-02-18 Thread Ben Finney
Nick Stinemates <[EMAIL PROTECTED]> writes: > Ah, I snipped because I was only replying to that specific part and > thought there was an archive of the rest. If that is unconventional > I'll stop. Please continue snipping the parts that aren't relevant to your reply. The convention in this forum

Re: Double underscores -- ugly?

2008-02-18 Thread benhoyt
> [Terry Jan Reedy] > No, the reservered special names are supposed to be ugly ;-) -- or at least > to stand out. However, since special methods are almost always called > indirectly by syntax and not directly, only the class writer or reader, but > not users, generally see them. Fair enough, bu

usage of .encode('utf-8','xmlcharrefreplace')?

2008-02-18 Thread J Peyret
Well, as usual I am confused by unicode encoding errors. I have a string with problematic characters in it which I'd like to put into a postgresql table. That results in a postgresql error so I am trying to fix things with .encode >>> s = 'he Company\xef\xbf\xbds ticker' >>> print s he Company�s

Re: How to get current module object

2008-02-18 Thread Alex
Gabriel Genellina wrote: > En Mon, 18 Feb 2008 14:49:02 -0200, Alex <[EMAIL PROTECTED]> escribió: >> That's what I've been searching for, thanks. By the way, I know it might >> be trivial question... but function and class namespaces have __name__ >> attribute too. Why is global one always returned

Re: The big shots

2008-02-18 Thread castironpi
On Feb 18, 11:22 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Feb 18, 10:26 pm, [EMAIL PROTECTED] (Aahz) wrote: > >> In article <[EMAIL PROTECTED]>, > >> Paul Rubin   wrote: > > >>> [EMAIL PROTECTED] (Aahz) writes: > [EMAIL PROTECTED]:

Re: The big shots

2008-02-18 Thread Carsten Haese
On Mon, 18 Feb 2008 21:08:42 -0800 (PST), castironpi wrote > What part of, "No one took the train before it was invented," do you > not understand? Actually, no one took the train before it was built. And no one built the train before it was feasible to do so. To take this analogy back into the w

Re: The big shots

2008-02-18 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Feb 18, 10:26 pm, [EMAIL PROTECTED] (Aahz) wrote: >> In article <[EMAIL PROTECTED]>, >> Paul Rubin wrote: >> >>> [EMAIL PROTECTED] (Aahz) writes: [EMAIL PROTECTED]: > Some of the ideas that have been proposed on Python-ideas as well

Re: pyinstall and matplotlib

2008-02-18 Thread John Henry
On Feb 18, 8:04 pm, John Henry <[EMAIL PROTECTED]> wrote: > On Feb 18, 7:34 pm, John Henry <[EMAIL PROTECTED]> wrote: > > > > > On Feb 17, 11:50 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > > > > hi John, > > > > John Henry wrote: > > > > Anybody willing to help? > > > > I struggled the past few d

Re: The big shots

2008-02-18 Thread castironpi
On Feb 18, 10:26 pm, [EMAIL PROTECTED] (Aahz) wrote: > In article <[EMAIL PROTECTED]>, > Paul Rubin   wrote: > > >[EMAIL PROTECTED] (Aahz) writes: > >>[EMAIL PROTECTED]: > > >>>Some of the ideas that have been proposed on Python-ideas as well as > >>>Python, have received

Re: ROUNDING???

2008-02-18 Thread Asun Friere
On Feb 19, 2:05 pm, 7stud <[EMAIL PROTECTED]> wrote: > An integer divided by an integer produces an integer. In computer > programming, that's called 'integer arithmetic', and any fractional > part of the result is chopped off(not rounded). In case you care, the "chopped off" bit is given by the

Re: average of PIL images

2008-02-18 Thread vaneric
On Feb 19, 1:38 am, Robert Kern <[EMAIL PROTECTED]> wrote: >Averaging color > images is tricky; you really shouldn't do it in the RGB colorspace. hi, thanx for the guidance and detailed replies..I tried to pack the r,g,b into a single value like below(something a member posted in the past) def r

Re: The big shots

2008-02-18 Thread Aahz
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: >[EMAIL PROTECTED] (Aahz) writes: >>[EMAIL PROTECTED]: >>> >>>Some of the ideas that have been proposed on Python-ideas as well as >>>Python, have received partial evaluation from the alphas. >> >> What do you mean by "a

Re: ROUNDING???

2008-02-18 Thread subeen
You can use the round() function. And if you want to print, use %0.2f regards, Subeen. http://love-python.blogspot.com/ On Feb 19, 9:36 am, [EMAIL PROTECTED] (Aahz) wrote: > In article <[EMAIL PROTECTED]>, > katie smith <[EMAIL PROTECTED]> wrote: > > > > >in python im doing the problem 255/494

Re: Seemingly odd 'is' comparison.

2008-02-18 Thread Asun Friere
On Feb 19, 1:45 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Asun Friere" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | The advice not to identity test strings and numbers (since they are > | interred in the main implementation), > > They may or may not be. Obviously, and

Re: pyinstall and matplotlib

2008-02-18 Thread John Henry
On Feb 18, 7:34 pm, John Henry <[EMAIL PROTECTED]> wrote: > On Feb 17, 11:50 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > > > > > hi John, > > > John Henry wrote: > > > Anybody willing to help? > > > I struggled the past few days with the same problem, > > and with the help of Werner Bruhin (wxPyt

Re: The big shots

2008-02-18 Thread Paul Rubin
[EMAIL PROTECTED] (Aahz) writes: > >Some of the ideas that have been proposed on Python-ideas as well as > >Python, have received partial evaluation from the alphas. > > What do you mean by "alphas"? Alpha test releases are the round of test distributions before the beta tests, which come before

Re: The big shots

2008-02-18 Thread Aahz
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: > >I'm a little dissatisfied, and just thinking aloud. What exactly are you dissatisfied with? This post reminds me of one reason why your ideas have not been well received: it is difficult to understand what your point is. Perhaps Engl

Re: The big shots

2008-02-18 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I'm a little dissatisfied, and just thinking aloud. > > Some of the ideas that have been proposed on Python-ideas as well as > Python, have received partial evaluation from the alphas. > > Lesser individuals than they could not have invented Python, and would > be liabl

Re: ROUNDING???

2008-02-18 Thread Aahz
In article <[EMAIL PROTECTED]>, katie smith <[EMAIL PROTECTED]> wrote: > >in python im doing the problem 255/494 > >it keeps giving me 0 instead of .51 >what am i doing wrong? >>> from __future__ import division >>> 2/5 0.40002 In addition: >>> division _Feature((2, 2, 0, 'alpha

Re: pyinstall and matplotlib

2008-02-18 Thread John Henry
On Feb 17, 11:50 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > hi John, > > John Henry wrote: > > Anybody willing to help? > > I struggled the past few days with the same problem, > and with the help of Werner Bruhin (wxPython list) I found a solution. > I had 2 problems: > - not finding mpl data

Re: name of client module

2008-02-18 Thread Jeff Schwab
Nick Stinemates wrote: > Jeff Schwab wrote: >> Nick Stinemates wrote: >> I'm not saying I don't want to do that. I'm saying that, in addition to what you've written, I want foo to know it's being imported, and by whom. >> Please don't snip so much. >> >> >>> You're sti

Re: Passing a callable object to Thread

2008-02-18 Thread castironpi
> a= object() > (a,) is a > > False > > (a,) is not identical with a. > > (a,) is (a,) > > False > > The tuple on the left is not identical with the tuple on the right, even > though they are equivalent. > > a is a > > True > > The variable on the left is identical with the one

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-18 Thread Daniel Fetchinson
On 2/18/08, SPE - Stani's Python Editor <[EMAIL PROTECTED]> wrote: > I'm pleased to announce the release of Phatch which is a > powerful batch processor and renamer. Phatch exposes a big part of the > Python Imaging Library through an user friendly GUI. (It is using > python-pyexiv2 to offer more e

Re: Double underscores -- ugly?

2008-02-18 Thread Raymond Hettinger
[benhoyt] > Is it just me that thinks "__init__" is rather ugly? I also find it unattractive and unpleasant to type. In Py3.0, I would support a single underscore convention, _init_ or somesuch. I'm not sure what the aesthetic reasons are, but somehow the change from double underscores to single

Re: name of client module

2008-02-18 Thread Nick Stinemates
Jeff Schwab wrote: > Nick Stinemates wrote: > >>> I'm not saying I don't want to do that. I'm saying that, in addition to >>> what you've written, I want foo to know it's being imported, and by whom. >>> > > Please don't snip so much. > > >> You're still not explaining a real example

The big shots

2008-02-18 Thread castironpi
I'm a little dissatisfied, and just thinking aloud. Some of the ideas that have been proposed on Python-ideas as well as Python, have received partial evaluation from the alphas. Lesser individuals than they could not have invented Python, and would be liable to ban me merely for this post. Notw

Re: ROUNDING???

2008-02-18 Thread Jeff Schwab
7stud wrote: > On Feb 18, 7:57 pm, katie smith <[EMAIL PROTECTED]> wrote: >> in python im doing the problem 255/494 >> >> it keeps giving me 0 instead of .51 >> what am i doing wrong? >> >> please help me I have been looking for hours >> >> >>

Re: ROUNDING???

2008-02-18 Thread Daniel Fetchinson
> in python im doing the problem 255/494 Try this: >>> 255.0/494.0 0.51619433198380571 >>> float(255)/float(494) 0.51619433198380571 > it keeps giving me 0 instead of .51 > what am i doing wrong? Nothing, integer division is not wrong :) > please help me I have been looking for hours

Re: name of client module

2008-02-18 Thread Jeff Schwab
Nick Stinemates wrote: >> I'm not saying I don't want to do that. I'm saying that, in addition to >> what you've written, I want foo to know it's being imported, and by whom. Please don't snip so much. > You're still not explaining a real example of what this could be used for. Why would you s

Re: ROUNDING???

2008-02-18 Thread 7stud
On Feb 18, 7:57 pm, katie smith <[EMAIL PROTECTED]> wrote: > in python im doing the problem 255/494 > > it keeps giving me 0 instead of .51 > what am i doing wrong? > > please help me I have been looking for hours > >       >

Re: Understanding While Loop Execution

2008-02-18 Thread 7stud
On Feb 18, 4:53 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > Brad wrote: > > Hi folks, > > > I'm still fairly new to programming in python and programming in > > general. a = [1, 2, 3] b = a print a print b print a[0] = 100 print a print b --output:-- [1, 2, 3] [1, 2, 3] [100, 2, 3] [100, 2, 3]

ROUNDING???

2008-02-18 Thread katie smith
in python im doing the problem 255/494 it keeps giving me 0 instead of .51 what am i doing wrong? please help me I have been looking for hours Never miss a thing. Make Yahoo your home page. http://

Re: Passing a callable object to Thread

2008-02-18 Thread castironpi
On Feb 18, 5:23 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Feb 18, 4:26 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > >> Lie wrote: > >>> On Feb 16, 12:29 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > Jeff Schwab <[EMAIL PROTECTED]> wri

Re: name of client module

2008-02-18 Thread Nick Stinemates
> I'm not saying I don't want to do that. I'm saying that, in addition to > what you've written, I want foo to know it's being imported, and by whom. > You're still not explaining a real example of what this could be used for. Oh well, here's an example of an implementation of what you want

Re: Seemingly odd 'is' comparison.

2008-02-18 Thread Terry Reedy
"Asun Friere" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Feb 19, 9:44 am, Steven D'Aprano <[EMAIL PROTECTED] | cybersource.com.au> wrote: | | > Except for documented singletons such as modules and None, which objects | > have the same identity is platform dependent, version

Re: Threading the Python interpreter

2008-02-18 Thread Gabriel Genellina
En Mon, 18 Feb 2008 22:47:40 -0200, MooJoo <[EMAIL PROTECTED]> escribió: > I've read that the Python interpreter is not thread-safe but are there > any issues in creating threads that create new processes (not threads) > that run new instantiations of python? What I'm doing is subclassing the >

Re: name of client module

2008-02-18 Thread Jeff Schwab
Nick Stinemates wrote: > Jeff Schwab wrote: >> Q1: When a module is imported, is there any way for the module to >> determine the name of the client code's module? >> > Why would you ever want to do this? >> Q2: My understanding is that the code in a module is executed only on >> the first imp

Re: Python ASP Error

2008-02-18 Thread Nick Stinemates
NoName wrote: > I want continuie this topic > http://groups.google.com/group/comp.lang.python/browse_thread/thread/6cc8f4154369abf2/df299ebaa5a2144c?hl=ru&lnk=st&q=Python+ASP+HTTP%2F1.1+500+Server+Error#df299ebaa5a2144c > > I have same problem > > Pythonwin's "Tools->Remote Trace Collector" show me

Re: Double underscores -- ugly?

2008-02-18 Thread Terry Reedy
"benhoyt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi guys, | | I've been using Python for some time now, and am very impressed with | its lack of red tape and its clean syntax -- both probably due to the | BDFL's ability to know when to say "no". | | Most of the things that

Re: name of client module

2008-02-18 Thread Nick Stinemates
Jeff Schwab wrote: > Q1: When a module is imported, is there any way for the module to > determine the name of the client code's module? > Why would you ever want to do this? > Q2: My understanding is that the code in a module is executed only on > the first import of that module. Is there an

Re: Seemingly odd 'is' comparison.

2008-02-18 Thread Asun Friere
On Feb 19, 9:44 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Except for documented singletons such as modules and None, which objects > have the same identity is platform dependent, version dependent, and even > dependent on the execution history of your code. The advice no

Re: Threading the Python interpreter

2008-02-18 Thread Nick Stinemates
MooJoo wrote: > I've read that the Python interpreter is not thread-safe but are there > any issues in creating threads that create new processes (not threads) > that run new instantiations of python? What I'm doing is subclassing the > threading.Thread and, in the run method, I'm making a call

Re: Seemingly odd 'is' comparison.

2008-02-18 Thread Asun Friere
On Feb 19, 12:27 pm, Asun Friere <[EMAIL PROTECTED]> wrote: > But given the nature of immutables I meant to write "given the nature of mutables" of course ... :/ -- http://mail.python.org/mailman/listinfo/python-list

Re: XML pickle

2008-02-18 Thread castironpi
> from lxml import etree > > class XMLable: >         cname= '' >         Text= object() >         class CTor: >                 def __init__( self, *ar ): >                         self.ar, self.kwar= ar, dict( ar ) >         ctor= CTor() >         FTor= dict >         ftor= {} >         def __ini

Re: Threading the Python interpreter

2008-02-18 Thread Steve Holden
MooJoo wrote: > I've read that the Python interpreter is not thread-safe but are there > any issues in creating threads that create new processes (not threads) > that run new instantiations of python? What I'm doing is subclassing the > threading.Thread and, in the run method, I'm making a call

Re: Double underscores -- ugly?

2008-02-18 Thread Asun Friere
benhoyt wrote: > Is it just me that thinks "__init__" is rather ugly? I used to hate looking at and having the type out all those underscores (surely two leading or one on either side would do?), but I've gotten so used to it by now the eyes don't see and the fingers work by themselves. > Not to

Re: Seemingly odd 'is' comparison.

2008-02-18 Thread Asun Friere
On Feb 19, 9:44 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Except for documented singletons such as modules and None, which objects > have the same identity is platform dependent, version dependent, and even > dependent on the execution history of your code. The advice no

Re: Garbage collection

2008-02-18 Thread Aahz
In article <[EMAIL PROTECTED]>, Ken <[EMAIL PROTECTED]> wrote: >Simon Pickles wrote: >> >> For instance, I have a manager looking after many objects in a dict. >> When those objects are no longer needed, I use del manager[objectid], >> hoping to force the garbage collector to perform the delete.

Re: TRAC - Trac, Project Leads, Python, and Mr. Noah Kantrowitz (sanitizer)

2008-02-18 Thread George Sakkis
On Feb 18, 6:56 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > Dear Ilias, > > > Post in a single reply. > > He has to, in hopes to gain the traction he desires Was the pun intended ? ;-) -- http://mail.python.org/mailm

Threading the Python interpreter

2008-02-18 Thread MooJoo
I've read that the Python interpreter is not thread-safe but are there any issues in creating threads that create new processes (not threads) that run new instantiations of python? What I'm doing is subclassing the threading.Thread and, in the run method, I'm making a call to os.system, passing

name of client module

2008-02-18 Thread Jeff Schwab
Q1: When a module is imported, is there any way for the module to determine the name of the client code's module? Q2: My understanding is that the code in a module is executed only on the first import of that module. Is there any way to have a hook invoked on subsequent imports, and for that h

The __name__ == '__main__' hack (was: Double underscores -- ugly?)

2008-02-18 Thread Ben Finney
benhoyt <[EMAIL PROTECTED]> writes: > Not to mention "if __name__ == '__main__': ..."? Unlike the double-underscore attribute names for signalling "special meaning", that particular hack is IMO unnecessarily ugly. I don't, however, think it's likely to go away any time soon. If that's the uglies

Re: Passing a callable object to Thread

2008-02-18 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> I think you're a little confused about the meaning of "numeric >> literal." (5+1) is not a numeric literal. Neither is >> (99+1). >> >> The flyweight pattern does not guarantee that all equivalent instances

Re: Passing a callable object to Thread

2008-02-18 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > I think you're a little confused about the meaning of "numeric > literal." (5+1) is not a numeric literal. Neither is > (99+1). > > The flyweight pattern does not guarantee that all equivalent instances > of an object type will

Python ASP Error

2008-02-18 Thread NoName
I want continuie this topic http://groups.google.com/group/comp.lang.python/browse_thread/thread/6cc8f4154369abf2/df299ebaa5a2144c?hl=ru&lnk=st&q=Python+ASP+HTTP%2F1.1+500+Server+Error#df299ebaa5a2144c I have same problem Pythonwin's "Tools->Remote Trace Collector" show me: IOError: [Errno 13] P

Re: Double underscores -- ugly?

2008-02-18 Thread Berwyn
> Is it just me that thinks "__init__" is rather ugly? Not to mention > "if __name__ == '__main__': ..."? That ugliness has long been my biggest bugbear with python, too. The __name__ == '__main__' thing is something I always have to look up, every time I use it, too ... awkward. I'd settle for:

Re: Passing a callable object to Thread

2008-02-18 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: In CS, a tuple is a kind of data structure that is specifically not identical with any of its elements. That's the sort of tuple used in Python. > > The usual CS meaning of "tuple" is more like the physics meaning than > l

Re: Passing a callable object to Thread

2008-02-18 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > >> In CS, a tuple is a kind of data structure that is specifically not > >> identical with any of its elements. That's the sort of tuple used in > >> Python. The usual CS meaning of "tuple" is more like the physics meaning than like the Python meaning, I

Re: TRAC - Trac, Project Leads, Python, and Mr. Noah Kantrowitz (sanitizer)

2008-02-18 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Dear Ilias, > > Post in a single reply. He has to, in hopes to gain the traction he desires - as otherwise he's pretty much ignored these days. Which is a good thing of course... Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding While Loop Execution

2008-02-18 Thread Gary Herron
Brad wrote: > Hi folks, > > I'm still fairly new to programming in python and programming in > general. A friend of mine is in a CompSci 101 course and was working > on a slider game when he encountered a problem. We eventually figured > out what the problem was and built a test case to help solve

Re: Double underscores -- ugly?

2008-02-18 Thread Ben Finney
benhoyt <[EMAIL PROTECTED]> writes: > I realise that double underscores make the language conceptually > cleaner in many ways (because fancy syntax and operator overloading > are just handled by methods), but they don't *look* nice. That's a good thing, in that it draws attention to the names. Th

Re: flattening a dict

2008-02-18 Thread Jeff Schwab
Arnaud Delobelle wrote: > On Feb 18, 10:22 pm, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: > [...] >> The problem with lambdas comes from people trying to hammer multi- >> expression functions into a single-expression lambda, hence obfuscating >> the algorithm. That's no differe

Re: Passing a callable object to Thread

2008-02-18 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 18, 4:26 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Lie wrote: >>> On Feb 16, 12:29 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> Why not? They seem intuitive to me. I would find it weird

Re: flattening a dict

2008-02-18 Thread Arnaud Delobelle
On Feb 18, 10:22 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: [...] > The problem with lambdas comes from people trying to hammer multi- > expression functions into a single-expression lambda, hence obfuscating > the algorithm. That's no different from people who obfuscate mult

Re: Seemingly odd 'is' comparison.

2008-02-18 Thread Steven D'Aprano
On Mon, 18 Feb 2008 14:11:53 +0100, Christian Heimes wrote: > Tobiah wrote: > print float(3.0) is float(3.0) >> True > print float(3.0 * 1.0) is float(3.0) >> False > > > Thumb rule: Never compare strings, numbers or tuples with "is". Only > compare an object with a singl

Re: Passing a callable object to Thread

2008-02-18 Thread castironpi
On Feb 18, 4:26 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Lie wrote: > > On Feb 16, 12:29 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > >> Paul Rubin wrote: > >>> Jeff Schwab <[EMAIL PROTECTED]> writes: > Why not?  They seem intuitive to me.  I would find it weird if you > couldn't have

Re: Linux/Python Issues

2008-02-18 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > > [EMAIL PROTECTED] wrote: >> IOW: all this is assumed to be >> common *n*x knowledge. > > Both GNOME and KDE put Windows to shame. An old Windows guy, like me, > can just start using either one without needing 'common *n*x > knowledge.' Too bad the *n*x community isn

Double underscores -- ugly?

2008-02-18 Thread benhoyt
Hi guys, I've been using Python for some time now, and am very impressed with its lack of red tape and its clean syntax -- both probably due to the BDFL's ability to know when to say "no". Most of the things that "got me" initially have been addressed in recent versions of Python, or are being ad

Re: Python Memory Manager

2008-02-18 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > > Paul Rubin wrote: >> The problem here is with a high allocation rate, you have to GC a lot >> more often, which typically involves copying live data. > > This is last century's issue. Copying data, RAM to RAM, is nearly free > using the Intel architecture. What's "th

Understanding While Loop Execution

2008-02-18 Thread Brad
Hi folks, I'm still fairly new to programming in python and programming in general. A friend of mine is in a CompSci 101 course and was working on a slider game when he encountered a problem. We eventually figured out what the problem was and built a test case to help solve it, but I can't for the

Re: Passing a callable object to Thread

2008-02-18 Thread Jeff Schwab
Lie wrote: > On Feb 16, 12:29 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Paul Rubin wrote: >>> Jeff Schwab <[EMAIL PROTECTED]> writes: Why not? They seem intuitive to me. I would find it weird if you couldn't have 0-tuple, and even weirder if you couldn't have a 1-tuple. Maybe

RE: Question

2008-02-18 Thread Blubaugh, David A.
I have already solved that problem. Sorry for not alerting you as to me of solving this issue. Thank you very much for the help. I was wondering if you would be interested in helping in the development of a Scipy / MyHDL hybrid. The advantage of this would be to develop FPGA logic with the ease

Re: flattening a dict

2008-02-18 Thread Steven D'Aprano
On Mon, 18 Feb 2008 14:03:20 +, Duncan Booth wrote: > Why, why, why, why are you using lambda here? It only makes the code > harder to read (and it is bad enough without that). A lambda which is > assigned directly to a variable is a bad code smell. Oh come on. I don't get this allergy to lam

Re: Is there any Generic RSS/ATOM generator in Python?

2008-02-18 Thread Christopher Arndt
On 11 Feb., 15:47, js <[EMAIL PROTECTED]> wrote: > I'm looking for RSS/ATOM generator I can use in Python. > I searched on pypi and the other places but I couldn't find any > options on this. (I found many parsers, though) > Is there any de-fact standard RSS/ATOM generator? (especially, I'd > like

Re: Python Memory Manager

2008-02-18 Thread rbossy
Quoting Steve Holden <[EMAIL PROTECTED]>: > [...] > Not only that, but all pointers to an object have to be updated when it > is relocated. "Any problem in computer science can be solved by another level of indirection" -- David John Wheeler ;-) RB -- http://mail.python.org/mailman/listinfo/py

Re: Garbage collection

2008-02-18 Thread Ken
Simon Pickles wrote: > Hi, > > I'm building a server with python, but coming from a c++ background, > garbage collection seems strange. > > For instance, I have a manager looking after many objects in a dict. > When those objects are no longer needed, I use del manager[objectid], > hoping to for

Re: Passing a callable object to Thread

2008-02-18 Thread Lie
On Feb 16, 12:29 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > Jeff Schwab <[EMAIL PROTECTED]> writes: > >> Why not? They seem intuitive to me. I would find it weird if you > >> couldn't have 0-tuple, and even weirder if you couldn't have a > >> 1-tuple. Maybe my brain has

Re: Python Memory Manager

2008-02-18 Thread Steve Holden
[EMAIL PROTECTED] wrote: > > Paul Rubin wrote: >> The problem here is with a high allocation rate, you have to GC a lot >> more often, which typically involves copying live data. > > This is last century's issue. Copying data, RAM to RAM, is nearly free > using the Intel architecture. > > This s

Garbage collection

2008-02-18 Thread Simon Pickles
Hi, I'm building a server with python, but coming from a c++ background, garbage collection seems strange. For instance, I have a manager looking after many objects in a dict. When those objects are no longer needed, I use del manager[objectid], hoping to force the garbage collector to perform

Re: Linux/Python Issues

2008-02-18 Thread MartinRinehart
Paul Boddie wrote: > The whole CNR stuff and the > proprietary software slant of Linspire obscures the solution, in my > opinion. Thanks for all your help, Paul. CNR, which is now free, is absolutely marvelous when it's got what you need. If Python2.5 were in the warehouse, I'd have clicked, go

Re: Question

2008-02-18 Thread Gabriel Genellina
En Mon, 18 Feb 2008 17:48:57 -0200, Blubaugh, David A. <[EMAIL PROTECTED]> escribi�: > Dan, > I have been working with examples within the Scipy and Numpy framework. > Those are the examples that I have been working with at this time, > including the FFT example. The following command: > python

Re: Python Memory Manager

2008-02-18 Thread MartinRinehart
Paul Rubin wrote: > The problem here is with a high allocation rate, you have to GC a lot > more often, which typically involves copying live data. This is last century's issue. Copying data, RAM to RAM, is nearly free using the Intel architecture. This short article, http://www.martinrinehart.

Re: average of PIL images

2008-02-18 Thread 7stud
On Feb 18, 2:05 pm, 7stud <[EMAIL PROTECTED]> wrote: > num = arr[1:, 2:] > > That says to get all elements from row 1 to the bottom that are in > from column 2 to the end of the row. err.. That says to get all elements from row 1 to the last row which are in column 2, column 3, etc. to the end of

Re: average of PIL images

2008-02-18 Thread 7stud
On Feb 18, 1:58 pm, 7stud <[EMAIL PROTECTED]> wrote: > On Feb 18, 10:18 am, vaneric <[EMAIL PROTECTED]> wrote: > > > > > hi > > i have a set of RGB images of diff faces (of people )as a 2 dim > > numpyarray > > ..something like > > threefaces=array([[xa1,xa2,xa3], > >        [xb1,xb2,xb3], > >    

  1   2   >