Re: @property decorator doesn't raise exceptions

2008-10-25 Thread Rafe
On Oct 24, 1:47 am, Rafe <[EMAIL PROTECTED]> wrote: > Hi, > > I've encountered a problem which is making debugging less obvious than > it should be. The @property decorator doesn't always raise exceptions. > It seems like it is bound to the class but ignored when called. I can > see the attribute u

Re: [Numpy-discussion] [SciPy-user] ANN: Python programs for epidemic modelling

2008-10-25 Thread Alan G Isaac
On 10/25/2008 6:07 PM I. Soumpasis wrote: The programs are GPL licensed. More info on the section of copyrights > http://wiki.deductivethinking.com/wiki/Deductive_Thinking:Copyrights. I hope it is ok, Well, that depends what you mean by "ok". Obviously, the author picks the license s/he pref

Re: Limit between 0 and 100

2008-10-25 Thread Steven D'Aprano
On Sat, 25 Oct 2008 13:42:08 -0700, chemicalclothing wrote: > Hi. I'm very new to Python, and so this is probably a pretty basic > question, but I'm lost. I am looking to limit a float value to a number > between 0 and 100 (the input is a percentage). Before I answer that, I'm going to skip to s

Re: Improving interpreter startup speed

2008-10-25 Thread Terry Reedy
Pedro Borges wrote: Hi guys, Is there a way to improve the interpreter startup speed? In my machine (cold startup) python takes 0.330 ms and ruby takes 0.047 ms, after cold boot python takes 0.019 ms and ruby 0.005 ms to start. You of course mean CPython, but Version, version, what Version?

Re: SendKeys-0.3.win32-py2.1.exe

2008-10-25 Thread Benjamin Kaplan
On Sat, Oct 25, 2008 at 5:33 PM, Jesse <[EMAIL PROTECTED]> wrote: > cant seem to install this, using python 2.6, any known errors that > wont let me select the python installation to use, just opens a blank > dialog and wont let me continue..do i need to downgrade python?? > > thanks in advance >

Re: Ordering python sets

2008-10-25 Thread Terry Reedy
Lie Ryan wrote: On Sat, 25 Oct 2008 18:20:46 -0400, Terry Reedy wrote: a = list([1, 2, 3, 4, 5], implementation = 'linkedlist') For this to work, the abstract list would have to know about all implementations of the abstraction. /the exact syntax isn't really important/ /abstract type and i

Re: set/dict comp in Py2.6

2008-10-25 Thread Benjamin
On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: > I'd like to know why Python 2.6 doesn't have the syntax to create sets/ > dicts of Python 3.0, like: Because nobody bothered to backport them. > > {x*x for x in xrange(10)} > {x:x*x for x in xrange(10)} > > Bye, > bearophile -- http://mail.python.or

Re: set/dict comp in Py2.6

2008-10-25 Thread Benjamin
On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: > I'd like to know why Python 2.6 doesn't have the syntax to create sets/ > dicts of Python 3.0, like: Because nobody bothered to backport them. > > {x*x for x in xrange(10)} > {x:x*x for x in xrange(10)} > > Bye, > bearophile -- http://mail.python.org

Re: Improving interpreter startup speed

2008-10-25 Thread BJörn Lindqvist
2008/10/25 Pedro Borges <[EMAIL PROTECTED]>: > Is there a way to improve the interpreter startup speed? > > In my machine (cold startup) python takes 0.330 ms and ruby takes > 0.047 ms, after cold boot python takes 0.019 ms and ruby 0.005 ms to > start. How are you getting those numbers? 330 μs is

You Want To Earn 10000$ see My Blog.

2008-10-25 Thread chinu
hai, i am srinu from india. i am sending a blog url for yours use. Right side Of The Blog Awsurvey Banner will appear. click on the banner and get a free signup with 6$ bonus and you will get more surveys. once you have completed one survey you will get minimem 4$ and more left side of the blog

Re: is it "legal" to pace the module's doc string after some imports ?

2008-10-25 Thread Steven D'Aprano
On Sun, 26 Oct 2008 02:31:01 +0200, Stef Mientki wrote: > hello, > > I wonder if it's "legal" to pace the module's doc string after some > imports ? > > I mean something like this: > > from language_support import _ > __doc__ = _(0, """ > some documentation > """ Doc strings are normal objec

Re: Improving interpreter startup speed

2008-10-25 Thread Steven D'Aprano
On Sat, 25 Oct 2008 12:32:07 -0700, Pedro Borges wrote: > Hi guys, > > > Is there a way to improve the interpreter startup speed? Get a faster computer? > In my machine (cold startup) python takes 0.330 ms and ruby takes 0.047 > ms, after cold boot python takes 0.019 ms and ruby 0.005 ms to s

Re: Ordering python sets

2008-10-25 Thread Steven D'Aprano
On Sat, 25 Oct 2008 21:53:10 +, Lie Ryan wrote: > On Sat, 25 Oct 2008 09:21:05 +, Steven D'Aprano wrote: > >> On Sat, 25 Oct 2008 08:58:18 +, Lie Ryan wrote: >> >>> >>> Since python is dynamic language, I think it should be possible to do >>> something like this: >>> >>> a = list([

Re: @property decorator doesn't raise exceptions

2008-10-25 Thread greg
Rafe wrote: The docs seem to suggest this is impossible: "Called when an attribute lookup has not found the attribute in the usual places (i.e. it is not an instance attribute nor is it found in the class tree for self). Getting an AttributeError is the way that the interpreter machinery tells

is it "legal" to pace the module's doc string after some imports ?

2008-10-25 Thread Stef Mientki
hello, I wonder if it's "legal" to pace the module's doc string after some imports ? I mean something like this: from language_support import _ __doc__ = _(0, """ some documentation """ thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread greg
Glenn Linderman wrote: On approximately 10/25/2008 12:01 AM, came the following characters from the keyboard of Martin v. Löwis: If None remains global, then type(None) also remains global, and type(None),__bases__[0]. Then type(None).__bases__[0].__subclasses__() will yield "interesting" resu

Re: Limit between 0 and 100

2008-10-25 Thread Marc 'BlackJack' Rintsch
On Sat, 25 Oct 2008 13:42:08 -0700, chemicalclothing wrote: > Hi. I'm very new to Python, and so this is probably a pretty basic > question, but I'm lost. I am looking to limit a float value to a number > between 0 and 100 (the input is a percentage). > > I currently have: > > integer = int() W

Re: big objects and avoiding deepcopy?

2008-10-25 Thread Aaron Brady
On Oct 24, 1:11 pm, Reckoner <[EMAIL PROTECTED]> wrote: > I am writing an algorithm that takes objects (i.e. graphs with > thousands of nodes) into a "hypothetical" state. I need to keep a > history of these  hypothetical objects depending on what happens to > them later. Note that these hypothetic

Re: Consequences of importing the same module multiple times in C++?

2008-10-25 Thread Aaron Brady
On Oct 24, 2:23 pm, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > I'm currently using boost::python::import() to import Python modules, > so I'm not sure exactly which Python API function it is calling to > import these files. I posted to the Boost.Python mailing list with > this question and

Re: Building truth tables

2008-10-25 Thread Aaron Brady
On Oct 24, 5:53 am, andrea <[EMAIL PROTECTED]> wrote: > On 26 Set, 20:01, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> > wrote: > > > > > Good idea.  If you want prefixed operators: 'and( a, b )' instead of > > 'a and b', you'll have to write your own.  ('operator.and_' is bitwise > > only.)  I

Re: Ordering python sets

2008-10-25 Thread Lie Ryan
On Sat, 25 Oct 2008 18:20:46 -0400, Terry Reedy wrote: > Lie Ryan wrote: > > >> >> Since python is dynamic language, I think it should be possible to do >> something like this: >> >> a = list([1, 2, 3, 4, 5], implementation = 'linkedlist') > > For this to work, the abstract list would have to

Re: Ordering python sets

2008-10-25 Thread Lie Ryan
On Sat, 25 Oct 2008 18:20:46 -0400, Terry Reedy wrote: > Lie Ryan wrote: > > >> >> Since python is dynamic language, I think it should be possible to do >> something like this: >> >> a = list([1, 2, 3, 4, 5], implementation = 'linkedlist') > > For this to work, the abstract list would have to

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Rhamphoryncus
On Oct 25, 12:29 am, greg <[EMAIL PROTECTED]> wrote: > Rhamphoryncus wrote: > > A list > > is not shareable, so it can only be used within the monitor it's > > created within, but the list type object is shareable. > > Type objects contain dicts, which allow arbitrary values > to be stored in them.

Re: Consequences of importing the same module multiple times in C++?

2008-10-25 Thread Lie Ryan
On Fri, 24 Oct 2008 12:23:18 -0700, Robert Dailey wrote: > Hi, > > I'm currently using boost::python::import() to import Python modules, so > I'm not sure exactly which Python API function it is calling to import > these files. I posted to the Boost.Python mailing list with this > question and th

Re: Ordering python sets

2008-10-25 Thread Terry Reedy
Lie Ryan wrote: Since python is dynamic language, I think it should be possible to do something like this: a = list([1, 2, 3, 4, 5], implementation = 'linkedlist') For this to work, the abstract list would have to know about all implementations of the abstraction. b = dict({'a': 'A'},

Re: PIL: Getting a two color difference between images

2008-10-25 Thread Lie Ryan
> Kevin D. Smith: >> What I want is a two color output image: black where the image wasn't >> different, and white where it was different.< Use the ImageChops.difference, which would give a difference image. Then map all colors to white except black using Image.point() -- http://mail.python.org

Re: [Numpy-discussion] [SciPy-user] ANN: Python programs for epidemic modelling

2008-10-25 Thread I. Soumpasis
2008/10/25 Alan G Isaac <[EMAIL PROTECTED]> > On 10/25/2008 4:14 PM I. Soumpasis apparently wrote: > > http://blog.deductivethinking.com/?p=29 > > This is cool. > But I do not see a license. > May I hope this is released under the new BSD license, > like the packages it depends on? > > The program

Re: How can I handle the char immediately after its input, without waiting an endline?

2008-10-25 Thread Lie Ryan
On Sat, 25 Oct 2008 15:27:32 +, Steven D'Aprano wrote: > On Sat, 25 Oct 2008 16:30:55 +0200, Roel Schroeven wrote: > >> Steven D'Aprano schreef: >>> I can't think of any modern apps that use one character commands like >>> that. One character plus a modifier (ctrl or alt generally) perhaps, >

Re: [SciPy-user] ANN: Python programs for epidemic modelling

2008-10-25 Thread Alan G Isaac
On 10/25/2008 4:14 PM I. Soumpasis apparently wrote: http://blog.deductivethinking.com/?p=29 This is cool. But I do not see a license. May I hope this is released under the new BSD license, like the packages it depends on? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-l

Re: Ordering python sets

2008-10-25 Thread Lie Ryan
On Sat, 25 Oct 2008 09:21:05 +, Steven D'Aprano wrote: > On Sat, 25 Oct 2008 08:58:18 +, Lie Ryan wrote: > >> >> Since python is dynamic language, I think it should be possible to do >> something like this: >> >> a = list([1, 2, 3, 4, 5], implementation = 'linkedlist') b = dict({'a': >>

Re: set/dict comp in Py2.6

2008-10-25 Thread bearophileHUGS
Sorry for the answering delay, Google Groups is slow today. Steven D'Aprano: >Personally, I don't see the advantage of set and dict comprehensions. I think >the value of them is very marginal, not worth the additional syntax.< If it's worth in 3.0 then it's worth in 2.6 too. If it isn't worth i

SendKeys-0.3.win32-py2.1.exe

2008-10-25 Thread Jesse
cant seem to install this, using python 2.6, any known errors that wont let me select the python installation to use, just opens a blank dialog and wont let me continue..do i need to downgrade python?? thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Andy O'Meara
> Andy O'Meara wrote: > > I would definitely agree if there was a context (i.e. environment) > > object passed around then perhaps we'd have the best of all worlds. > > Moreover, I think this is probably the *only* way that > totally independent interpreters could be realized. > > Converting the w

Re: arange randomly words in a list

2008-10-25 Thread BJörn Lindqvist
2008/10/20 william paul <[EMAIL PROTECTED]>: > I have a list that looks like: > > name = name1 name2 name3 name4 > > and I would like to be able to arrange randomly this list, like: > > name = name 2 name 1 name3 name4 > name = name4 name2 name1 name3 > > > I have tried with random.shuffle, bu

Re: Limit between 0 and 100

2008-10-25 Thread Benjamin Kaplan
On Sat, Oct 25, 2008 at 4:42 PM, <[EMAIL PROTECTED]> wrote: > Hi. I'm very new to Python, and so this is probably a pretty basic > question, but I'm lost. I am looking to limit a float value to a > number between 0 and 100 (the input is a percentage). > > I currently have: > > integer = int() > ru

Re: Improving interpreter startup speed

2008-10-25 Thread Lie Ryan
On Sat, 25 Oct 2008 12:32:07 -0700, Pedro Borges wrote: > Hi guys, > > > Is there a way to improve the interpreter startup speed? > > In my machine (cold startup) python takes 0.330 ms and ruby takes 0.047 > ms, after cold boot python takes 0.019 ms and ruby 0.005 ms to start. > > > TIA um.

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Andy O'Meara
On Oct 24, 10:24 pm, Glenn Linderman <[EMAIL PROTECTED]> wrote: > > > And in the case of hundreds of megs of data > > ... and I would be surprised at someone that would embed hundreds of > megs of data into an object such that it had to be serialized... seems > like the proper design is to point at

Limit between 0 and 100

2008-10-25 Thread chemicalclothing
Hi. I'm very new to Python, and so this is probably a pretty basic question, but I'm lost. I am looking to limit a float value to a number between 0 and 100 (the input is a percentage). I currently have: integer = int() running = True while running: try: per_period_interest_rate = float(ra

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Andy O'Meara
On Oct 24, 9:40 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > It seems to me that the very simplest move would be to remove global > > static data so the app could provide all thread-related data, which > > Andy suggests through references to the QuickTime API. This would > > suggest compili

Re: @property decorator doesn't raise exceptions

2008-10-25 Thread Rafe
On Oct 24, 9:58 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Rafe wrote: > > On Oct 24, 2:21 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > >> Rafewrote: > >> > Hi, > > >> > I've encountered a problem which is making debugging less obvious than > >> > it should be. The @property decorator doesn'

Re: big objects and avoiding deepcopy?

2008-10-25 Thread Robert Kern
Reckoner wrote: I am writing an algorithm that takes objects (i.e. graphs with thousands of nodes) into a "hypothetical" state. I need to keep a history of these hypothetical objects depending on what happens to them later. Note that these hypothetical objects are intimately operated on, changed

ANN: Python programs for epidemic modelling

2008-10-25 Thread I. Soumpasis
Dear lists, DeductiveThinking.com now provides the Python programs for the book of M. Keeling & P. Rohani "Modeling Infectious Diseases in Humans and Animals", Princeton University Press, 2008. The book has on-line material which includes programs for different models in various programming langua

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Andy O'Meara
On Oct 24, 9:52 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> A c-level module, on the other hand, can sidestep/release > >> the GIL at will, and go on it's merry way and process away. > > > ...Unless part of the C module execution involves the need do CPU- > > bound work on another thread

Re: @property decorator doesn't raise exceptions

2008-10-25 Thread Rafe
On Oct 24, 9:58 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Rafe wrote: > > On Oct 24, 2:21 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > >> Rafewrote: > >> > Hi, > > >> > I've encountered a problem which is making debugging less obvious than > >> > it should be. The @property decorator doesn'

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Martin v. Löwis
>> There are a number of problems with that approach. The biggest one is >> that it is theoretical. > > Not theoretical. Used successfully in Perl. Perhaps it is indeed what Perl does, I know nothing about that. However, it *is* theoretical for Python. Please trust me that there are many many

Improving interpreter startup speed

2008-10-25 Thread Pedro Borges
Hi guys, Is there a way to improve the interpreter startup speed? In my machine (cold startup) python takes 0.330 ms and ruby takes 0.047 ms, after cold boot python takes 0.019 ms and ruby 0.005 ms to start. TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlite version for python 2.6

2008-10-25 Thread Martin v. Löwis
> I'd like to know which version of sqlite the python 2.6 sqlite3 module > supports. When you compile Python, you can chose any version of sqlite that you want to. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Perl/Python regular expressions vs. Boost.regex?

2008-10-25 Thread skip
Rob> Quoting from : http://www.boost.org/doc/libs/1_36_0/libs/regex/doc/html/boost_regex/ref/regex_match.html> Rob> Rob> Important Rob> Note that the result is true only if the expression matches the Rob> whole of the input sequence. If you want to search for an Rob> e

collections.chain

2008-10-25 Thread bearophileHUGS
Several languages like Java, C# etc have a List type in the std lib. Python has a built-in list(), it's implemented as array dynamic on the right. Not too much time ago Hettinger has added a collections.deque (its C code is really nice), that compared to list() allows a faster append on the right

sqlite version for python 2.6

2008-10-25 Thread James Thiele
I'd like to know which version of sqlite the python 2.6 sqlite3 module supports. Any help would be appreciated. Thanks, James -- http://mail.python.org/mailman/listinfo/python-list

Re: Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-25 Thread Akira Kitada
Hi Marc-Andre, Thanks for the suggestion. I opened a ticket for this issue: http://bugs.python.org/issue4204 Now I understand the state of the multiprocessing module, but it's too bad to see math, mmap and readline modules, that worked fine before, cannot be built anymore. As for FreeBSD4, yeah

Re: How can I handle the char immediately after its input, without waiting an endline?

2008-10-25 Thread Lie Ryan
On Sat, 25 Oct 2008 09:04:01 +, Steven D'Aprano wrote: > On Sat, 25 Oct 2008 08:36:32 +, Lie Ryan wrote: > > I want to write something that handle every char immediately after > its input. Then tehe user don't need to type [RETURN] each time. How > can I do this? > > T

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Philip Semanchuk
On Oct 25, 2008, at 7:53 AM, Michael Sparks wrote: Glenn Linderman wrote: In the module multiprocessing environment could you not use shared memory, then, for the large shared data items? If the poshmodule had a bit of TLC, it would be extremely useful for this, since it does (surprisingl

Re: PIL: Getting a two color difference between images

2008-10-25 Thread bearophileHUGS
Kevin D. Smith: > What I want is a two color output image: black where the image wasn't > different, and white where it was different.< There are several ways to do that. If speed isn't essential, then you can create a third blank image of the right size, and then use the method that iterates on

Re: Building truth tables

2008-10-25 Thread Paul McGuire
On Oct 24, 5:53 am, andrea <[EMAIL PROTECTED]> wrote: > On 26 Set, 20:01, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> > wrote: > > > > > Good idea.  If you want prefixed operators: 'and( a, b )' instead of > > 'a and b', you'll have to write your own.  ('operator.and_' is bitwise > > only.)  I

Re: from package import * without overwriting similarly named functions?

2008-10-25 Thread Fernando H. Sanches
Also, remember that since the latter functions will always overwrite the first, you can just reverse the order of the imports: from package2 import * from package1 import * This should preserve the functions of package1 over the other ones. -- http://mail.python.org/mailman/listinfo/python-list

Re: project in python

2008-10-25 Thread Stefan Behnel
asit wrote: > I am a newbie and learned python to some extent. > > I want to do some project in python based on network programming or > HTML/XML parsing. > > Can anyone suggest me about this ??? The more you spam people with your repetitive postings, the less likely it becomes that they are wil

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Terry Reedy
Glenn Linderman wrote: On approximately 10/24/2008 8:39 PM, came the following characters from the keyboard of Terry Reedy: Glenn Linderman wrote: For example, Python presently has a rather stupid algorithm for string concatenation. Yes, CPython2.x, x<=5 did. Python the language has syntax

Re: how to pass a dictionary (including chinese characters) through Queue as is?

2008-10-25 Thread Jean-Paul Calderone
On Sat, 25 Oct 2008 08:36:22 -0700 (PDT), ouyang <[EMAIL PROTECTED]> wrote: Hi everyone, As indicated in the following python script, the dictionary b has Chinese characters: "中文". But a.get() returns the dictionary with a little bit different format for the "中文“: '\xd6\xd0\xce\xc4' . How ca

project in python

2008-10-25 Thread asit
I am a newbie and learned python to some extent. I want to do some project in python based on network programming or HTML/XML parsing. Can anyone suggest me about this ??? -- http://mail.python.org/mailman/listinfo/python-list

project in python

2008-10-25 Thread asit
I want to do a project in python. It should be something based on socket programming, HTML/XML parsing, etc plz suggest me -- http://mail.python.org/mailman/listinfo/python-list

Re: set/dict comp in Py2.6

2008-10-25 Thread Paul Rubin
[EMAIL PROTECTED] writes: > {x*x for x in xrange(10)} > {x:x*x for x in xrange(10)} I've always just used: set(x*x for x in xrange(10)) dict((x,x*x) for x in xrange(10)) I didn't even realize that you could write sets with {...}. -- http://mail.python.org/mailman/listinfo/python-list

Re: using modules in destructors

2008-10-25 Thread [EMAIL PROTECTED]
It seems to me that deleting local instances before imported modules would solve the problem. Is it not possible for the interpreter to get this right? Or are there cases where this would break stuff. It seems rather unpythonic for the __del__() method to become unpredictable at exit. -- http://ma

how to pass a dictionary (including chinese characters) through Queue as is?

2008-10-25 Thread ouyang
Hi everyone, As indicated in the following python script, the dictionary b has Chinese characters: "中文". But a.get() returns the dictionary with a little bit different format for the "中文“: '\xd6\xd0\xce\xc4' . How can I get the dictionary through the Queue as is? >>> import Queue >>> a = Que

Re: How can I handle the char immediately after its input, without waiting an endline?

2008-10-25 Thread Steven D'Aprano
On Sat, 25 Oct 2008 16:30:55 +0200, Roel Schroeven wrote: > Steven D'Aprano schreef: >> I can't think of any modern apps that use one character commands like >> that. One character plus a modifier (ctrl or alt generally) perhaps, >> but even there, it's mostly used in GUI applications. > > less,

Re: set/dict comp in Py2.6

2008-10-25 Thread Lie Ryan
On Sat, 25 Oct 2008 09:07:35 +, Steven D'Aprano wrote: > On Sat, 25 Oct 2008 01:13:08 -0700, bearophileHUGS wrote: > >> I'd like to know why Python 2.6 doesn't have the syntax to create sets/ >> dicts of Python 3.0, like: >> >> {x*x for x in xrange(10)} >> {x:x*x for x in xrange(10)} > > Ma

Re: arange randomly words in a list

2008-10-25 Thread Tim Chase
I have a list that looks like: name = name1 name2 name3 name4 and I would like to be able to arrange randomly this list, like: name = name 2 name 1 name3 name4 name = name4 name2 name1 name3 I have tried with random.shuffle, but still no good result May I get an example? I'm not sure

project in python

2008-10-25 Thread asit
I want to do a project in python. It should be something based on socket programming, HTML/XML parsing, etc please suggest me -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I handle the char immediately after its input, without waiting an endline?

2008-10-25 Thread Roel Schroeven
Steven D'Aprano schreef: I can't think of any modern apps that use one character commands like that. One character plus a modifier (ctrl or alt generally) perhaps, but even there, it's mostly used in GUI applications. less, vi, info, top, cfdisk, lynx, links, ... come to mind. I suppose there

Re: ANN: Enthought Python Distribution - New Release

2008-10-25 Thread Laura Creighton
Thank you Travis. Very pleased to get this from you. Congratulatoins on the new release, Laura -- http://mail.python.org/mailman/listinfo/python-list

arange randomly words in a list

2008-10-25 Thread william paul
Hi: I have a list that looks like: name = name1 name2 name3 name4 and I would like to be able to arrange randomly this list, like: name = name 2 name 1 name3 name4 name = name4 name2 name1 name3 I have tried with random.shuffle, but still no good result May I get an example? Thank you,

Re: Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-25 Thread M.-A. Lemburg
On 2008-10-25 08:39, Akira Kitada wrote: > Hi list, > > I was trying to build Python 2.6 on FreeBSD 4.11 and found it failed > to build some of the modules. > > """ > Failed to find the necessary bits to build these modules: > _bsddb _sqlite3 _tkinter > gdbm li

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread M.-A. Lemburg
These discussion pop up every year or so and I think that most of them are not really all that necessary, since the GIL isn't all that bad. Some pointers into the past: * http://effbot.org/pyfaq/can-t-we-get-rid-of-the-global-interpreter-lock.htm Fredrik on the GIL * http://mail.python.org/

why asynchat's initiate_send() get called twice after reconnect ?

2008-10-25 Thread davy zhang
Python3.0rc1 windowsxp in the lib\asynchat.py def handle_write (self): self.initiate_send() def push (self, data): sabs = self.ac_out_buffer_size if len(data) > sabs: for i in range(0, len(data), sabs): self.producer_fifo.append(data[i:i+sabs

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Michael Sparks
Jesse Noller wrote: > http://www.kamaelia.org/Home Thanks for the mention :) I don't think it's a good fit for the original poster's question, but a solution to the original poster's question would be generally useful IMO, _especially_ on python implementations without a GIL (where threads are t

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Michael Sparks
Andy O'Meara wrote: > basically, it seems that we're talking about the > "embarrassingly parallel" scenario raised in that paper We build applications in Kamaelia and then discover afterwards that they're embarrassingly parallel and just work. (we have an introspector that can look inside running

Re: Global dictionary or class variables

2008-10-25 Thread Fuzzyman
On Oct 24, 9:44 pm, Mr.SpOOn <[EMAIL PROTECTED]> wrote: > Hi, > in an application I have to use some variables with fixed valuse. > > For example, I'm working with musical notes, so I have a global > dictionary like this: > > natural_notes = {'C': 0, 'D': 2, 'E': 4 } > > This actually works fin

Re: How to examine the inheritance of a class?

2008-10-25 Thread Fuzzyman
On Oct 24, 7:27 pm, Derek Martin <[EMAIL PROTECTED]> wrote: > On Fri, Oct 24, 2008 at 11:59:46AM +1000, James Mills wrote: > > On Fri, Oct 24, 2008 at 11:36 AM, John Ladasky <[EMAIL PROTECTED]> wrote: > > > etc.  The list of subclasses is not fully defined.  It is supposed to > > > be extensible by

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Michael Sparks
Glenn Linderman wrote: > In the module multiprocessing environment could you not use shared > memory, then, for the large shared data items? If the poshmodule had a bit of TLC, it would be extremely useful for this, since it does (surprisingly) still work with python 2.5, but does need a bit of T

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Michael Sparks
Andy O'Meara wrote: > Yeah, that's the idea--let the highest levels run and coordinate the > show. Yes, this works really well in python and it's lots of fun. We've found so far you need at minimum the following parts to a co-ordination little language: Pipeline Graphline Carousel

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Michael Sparks
Hi Andy, Andy wrote: > However, we require true thread/interpreter > independence so python 2 has been frustrating at time, to say the > least.  Please don't start with "but really, python supports multiple > interpreters" because I've been there many many times with people. > And, yes, I'm awar

Re: lxml removing tag, keeping text order

2008-10-25 Thread Stefan Behnel
Tim Arnold schrieb: > Hi, > Using lxml to clean up auto-generated xml to validate against a dtd; I need > to remove an element tag but keep the text in order. For example > s0 = ''' > >first text > ladida > emphasized text > middle text > > last text > > ''' > > I wan

Re: Ordering python sets

2008-10-25 Thread Steven D'Aprano
On Sat, 25 Oct 2008 08:58:18 +, Lie Ryan wrote: > > Since python is dynamic language, I think it should be possible to do > something like this: > > a = list([1, 2, 3, 4, 5], implementation = 'linkedlist') > b = dict({'a': 'A'}, implementation = 'binarytree') > c = dict({'a': 'A'}, implemen

Re: set/dict comp in Py2.6

2008-10-25 Thread Steven D'Aprano
On Sat, 25 Oct 2008 01:13:08 -0700, bearophileHUGS wrote: > I'd like to know why Python 2.6 doesn't have the syntax to create sets/ > dicts of Python 3.0, like: > > {x*x for x in xrange(10)} > {x:x*x for x in xrange(10)} Maybe nobody asked for it? Personally, I don't see the advantage of set an

Re: How can I handle the char immediately after its input, without waiting an endline?

2008-10-25 Thread Steven D'Aprano
On Sat, 25 Oct 2008 08:36:32 +, Lie Ryan wrote: I want to write something that handle every char immediately after its input. Then tehe user don't need to type [RETURN] each time. How can I do this? Thanks in advance. > > Don't you think that getting a one-character f

Re: Ordering python sets

2008-10-25 Thread Lie Ryan
On Wed, 22 Oct 2008 10:43:35 -0700, bearophileHUGS wrote: > Mr.SpOOn: >> Is there another convenient structure or shall I use lists and define >> the operations I need? > > > As Python becomes accepted for more and more "serious" projects some > more data structures can eventually be added to th

Re: How can I handle the char immediately after its input, without waiting an endline?

2008-10-25 Thread Lie Ryan
>>> I want to write something that handle every char immediately after its >>> input. Then tehe user don't need to type [RETURN] each time. How can I >>> do this? >>> >>> Thanks in advance. Don't you think that getting a one-character from console is something that many people do very often? Do y

set/dict comp in Py2.6

2008-10-25 Thread bearophileHUGS
I'd like to know why Python 2.6 doesn't have the syntax to create sets/ dicts of Python 3.0, like: {x*x for x in xrange(10)} {x:x*x for x in xrange(10)} Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: from package import * without overwriting similarly named functions?

2008-10-25 Thread Lie Ryan
On Fri, 24 Oct 2008 11:06:54 -0700, Reckoner wrote: > I have multiple packages that have many of the same function names. Is > it possible to do > > from package1 import * > from package2 import * > > without overwriting similarly named objects from package1 with material > in package2? How abou

Re: dictionary

2008-10-25 Thread Hendrik van Rooyen
Steven D'Aprano wrote: >On Fri, 24 Oct 2008 14:53:19 +, Peter Pearson wrote: > >> On 24 Oct 2008 13:17:45 GMT, Steven D'Aprano wrote: >>> >>> What are programmers coming to these days? When I was their age, we >>> were expected to *read* the error messages our compilers gave us, not >>> turn

Re: Urllib vs. FireFox

2008-10-25 Thread Lie Ryan
On Fri, 24 Oct 2008 20:38:37 +0200, Gilles Ganault wrote: > Hello > > After scratching my head as to why I failed finding data from a web > using the "re" module, I discovered that a web page as downloaded by > urllib doesn't match what is displayed when viewing the source page in > FireFox. >

Re: PIL: Getting a two color difference between images

2008-10-25 Thread Lie Ryan
On Fri, 24 Oct 2008 14:51:07 -0500, Kevin D. Smith wrote: > I'm trying to get the difference of two images using PIL. The > ImageChops.difference function does almost what I want, but it takes the > absolute value of the pixel difference. What I want is a two color > output image: black where th

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Martin v. Löwis
> If Py_None corresponds to None in Python syntax (sorry I'm not familiar > with Python internals yet; glad you are commenting, since you are), then > it is a fixed constant and could be left global, probably. If None remains global, then type(None) also remains global, and type(None),__bases__[0]