Re: remote read eval print loop

2012-08-16 Thread Alister
On Fri, 17 Aug 2012 02:27:42 +, Steven D'Aprano wrote: > On Fri, 17 Aug 2012 08:43:50 +1000, Chris Angelico wrote: > >> On Fri, Aug 17, 2012 at 6:54 AM, Eric Frederich >> wrote: >>> Hello, >>> >>> I have a bunch of Python bindings for a 3rd party software running on >>> the server side. >>>

Re: How do I display unicode value stored in a string variable using ord()

2012-08-16 Thread Alister
On Thu, 16 Aug 2012 15:09:47 -0700, Charles Jensen wrote: > Everyone knows that the python command > > ord(u'…') > > will output the number 8230 which is the unicode character for the > horizontal ellipsis. > > How would I use ord() to find the unicode value of a string stored in a > varia

Re: set and dict iteration

2012-08-16 Thread Paul Rubin
Steven D'Aprano writes: > Luckily, Python is open source. If anyone thinks that sets and dicts > should include more code protecting against mutation-during-iteration, > they are more than welcome to come up with a patch. Don't forget unit and > regression tests, and also a set of timing result

Re: remote read eval print loop

2012-08-16 Thread Steven D'Aprano
On Fri, 17 Aug 2012 08:43:50 +1000, Chris Angelico wrote: > On Fri, Aug 17, 2012 at 6:54 AM, Eric Frederich > wrote: >> Hello, >> >> I have a bunch of Python bindings for a 3rd party software running on >> the server side. >> I can add client side extensions that communicate over some http / xml

Re: set and dict iteration

2012-08-16 Thread Steven D'Aprano
On Thu, 16 Aug 2012 19:11:19 -0400, Dave Angel wrote: > On 08/16/2012 05:26 PM, Paul Rubin wrote: >> Dave Angel writes: >>> Everything else is implementation defined. Why should an >>> implementation be forced to have ANY extra data structure to detect a >>> static bug in the caller's code? >> F

Re: python+libxml2+scrapy AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER'

2012-08-16 Thread personificator
I believe ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz was what your looking for. Submit a ticket for the docs to get updated if your feeling generous. On Wednesday, August 15, 2012 7:49:04 AM UTC-5, Dmitry Arsentiev wrote: > Hello. > > > > Has anybody already meet the problem like this? - >

Re: set and dict iteration

2012-08-16 Thread Paul Rubin
Ian Kelly writes: > With regard to key insertion and deletion while iterating over a dict > or set, though, there is just no good reason to be doing that > (especially as the result is very implementation-specific), and I > wouldn't mind a more complete low-level check against it as long as > it's

Re: How do I display unicode value stored in a string variable using ord()

2012-08-16 Thread Terry Reedy
a = '…' print(ord(a)) >>> 8230 Most things with unicode are easier in 3.x, and some are even better in 3.3. The current beta is good enough for most informal work. 3.3.0 will be out in a month. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: set and dict iteration

2012-08-16 Thread Ian Kelly
On Thu, Aug 16, 2012 at 5:11 PM, Dave Angel wrote: > There's an enormous difference between type errors, which affect the low > level dispatch, and checking for whether a dict has changed and may have > invalidated the iterator. If we were really going to keep track of what > iterators are tracki

Re: set and dict iteration

2012-08-16 Thread Dave Angel
On 08/16/2012 05:26 PM, Paul Rubin wrote: > Dave Angel writes: >> Everything else is implementation defined. Why should an implementation >> be forced to have ANY extra data structure to detect a static bug in the >> caller's code? > For the same reason the interpreter checks for type errors at r

Re: set and dict iteration

2012-08-16 Thread Ian Kelly
On Thu, Aug 16, 2012 at 4:55 PM, Ian Kelly wrote: > On Thu, Aug 16, 2012 at 12:00 PM, Aaron Brady wrote: >> The inconsistency is, if we remove an element from a set and add another >> during iteration, the new element might appear later in the iteration, and >> might not, depending on the hash

Re: set and dict iteration

2012-08-16 Thread Ian Kelly
On Thu, Aug 16, 2012 at 12:00 PM, Aaron Brady wrote: > The inconsistency is, if we remove an element from a set and add another > during iteration, the new element might appear later in the iteration, and > might not, depending on the hash code; therefore comparing the size of the > set between

Re: How do I display unicode value stored in a string variable using ord()

2012-08-16 Thread Dave Angel
On 08/16/2012 06:09 PM, Charles Jensen wrote: > Everyone knows that the python command > > ord(u'…') > > will output the number 8230 which is the unicode character for the horizontal > ellipsis. > > How would I use ord() to find the unicode value of a string stored in a > variable? > > So

Re: remote read eval print loop

2012-08-16 Thread Chris Angelico
On Fri, Aug 17, 2012 at 6:54 AM, Eric Frederich wrote: > Hello, > > I have a bunch of Python bindings for a 3rd party software running on the > server side. > I can add client side extensions that communicate over some http / xml type > requests. > So I can define functions that take a string and

Re: Top-posting &c. (was Re: [ANNC] pybotwar-0.8)

2012-08-16 Thread Madison May
> And FWIW, I add my voice to those who prefer to read replies > > underneath the original text. Even if Mark were the only person vocal > > enough to complain, you can still rest assured that there are many > > more who agree. You've now heard from quite a few regular posters; > > there are p

Top-posting &c. (was Re: [ANNC] pybotwar-0.8)

2012-08-16 Thread Chris Angelico
On Fri, Aug 17, 2012 at 1:40 AM, Ramchandra Apte wrote: > On 16 August 2012 21:00, Mark Lawrence wrote: >> and "bottom" reads better than "top" >> > Look you are the only person complaining about top-posting. > GMail uses top-posting by default. > I can't help it if you feel irritated by it. I p

Re: How do I display unicode value stored in a string variable using ord()

2012-08-16 Thread Chris Angelico
On Fri, Aug 17, 2012 at 8:09 AM, Charles Jensen wrote: > How would I use ord() to find the unicode value of a string stored in a > variable? > > So the following 2 lines of code will give me the ascii value of the variable > a. How do I specify ord to give me the unicode value of a? > > a

How do I display unicode value stored in a string variable using ord()

2012-08-16 Thread Charles Jensen
Everyone knows that the python command ord(u'…') will output the number 8230 which is the unicode character for the horizontal ellipsis. How would I use ord() to find the unicode value of a string stored in a variable? So the following 2 lines of code will give me the ascii value of th

Re: [ANNC] pybotwar-0.8

2012-08-16 Thread Walter Hurry
On Thu, 16 Aug 2012 17:20:29 -0400, Terry Reedy wrote: > On 8/16/2012 11:40 AM, Ramchandra Apte wrote: > >> Look you are the only person complaining about top-posting. > > No he is not. Recheck all the the responses. > >> GMail uses top-posting by default. > > It only works if everyone does it

Re: set and dict iteration

2012-08-16 Thread Paul Rubin
Dave Angel writes: > Everything else is implementation defined. Why should an implementation > be forced to have ANY extra data structure to detect a static bug in the > caller's code? For the same reason the interpreter checks for type errors at runtime and raises TypeError, instead of letting

Re: [ANNC] pybotwar-0.8

2012-08-16 Thread Terry Reedy
On 8/16/2012 11:40 AM, Ramchandra Apte wrote: Look you are the only person complaining about top-posting. No he is not. Recheck all the the responses. GMail uses top-posting by default. It only works if everyone does it. I can't help it if you feel irritated by it. Your out-of-context

Re: [OT] Posting under ones full name

2012-08-16 Thread Alex Strickland
On 2012/08/16 07:01 AM, Dan Sommers wrote: When I've got these antlers on I am dictating and when I take them off I am not dictating. Very good. -- Regards Alex -- http://mail.python.org/mailman/listinfo/python-list

remote read eval print loop

2012-08-16 Thread Eric Frederich
Hello, I have a bunch of Python bindings for a 3rd party software running on the server side. I can add client side extensions that communicate over some http / xml type requests. So I can define functions that take a string and return a string. I would like to get a simple read eval print loop wo

Re: [OT] Posting under ones full name

2012-08-16 Thread Grant Edwards
On 2012-08-16, Dan Sommers wrote: > On 2012-08-15 at 13:59:53 +, > Grant Edwards wrote: > >> On 2012-08-15, Chris Angelico wrote: > >> > Perhaps you said "Please use `m4-style quotes rather than matching >> > ASCII quotes' or `something else' to indicate omission instead". > > When I've got

Re: Strange behavior

2012-08-16 Thread Virgil Stokes
On 16-Aug-2012 19:40, Steven D'Aprano wrote: On Thu, 16 Aug 2012 13:18:59 +0200, Virgil Stokes wrote: On 15-Aug-2012 02:19, Steven D'Aprano wrote: On Tue, 14 Aug 2012 21:40:10 +0200, Virgil Stokes wrote: You might find the following useful: def testFunc(startingList): xOnlyList = [];

Re: Running Python web apps on shared ASO servers?

2012-08-16 Thread Emile van Sebille
On 8/16/2012 7:01 AM Gilles said... On Sun, 12 Aug 2012 02:03:33 +0200, Gilles wrote: Does it mean that ASO only supports writing Python web apps as long-running processes (CGI, FCGI, WSGI, SCGI) instead of embedded Python à la PHP? I need to get the big picture about the different solutions

Re: [ANNC] pybotwar-0.8

2012-08-16 Thread Dave Angel
On 08/16/2012 10:37 AM, Ramchandra Apte wrote: > nah.. "war" sounds better than "contest" Top-posting yet again? -- DaveA -- http://mail.python.org/mailman/listinfo/python-list

Re: Verify the integrity of the tar file with tarfile module?

2012-08-16 Thread Dave Angel
On 08/16/2012 10:51 AM, Ramchandra Apte wrote: > Just opening the file may not create an error. > You have to read some files to check for errors. You have no context in front of your message, and it's not a reply to anything existing. So it must be top-posted. Try again. -- DaveA -- http

Re: set and dict iteration

2012-08-16 Thread Dave Angel
On 08/16/2012 02:00 PM, Aaron Brady wrote: > Hello, > > I observed an inconsistency in the behavior of 'set' and 'dict' iterators. > It is "by design" according to the docs. > > ''' > http://docs.python.org/dev/library/stdtypes.html#dict-views > > iter(dictview). Iterating views while adding or

Re: [ANNC] pybotwar-0.8

2012-08-16 Thread William R. Wing (Bill Wing)
On Aug 16, 2012, at 11:40 AM, Ramchandra Apte wrote: > Look you are the only person complaining about top-posting. > GMail uses top-posting by default. > MANY of us find it irritating... and it only takes a second to move your cursor down and play nice. -Bill -- http://mail.python.org/mailma

set and dict iteration

2012-08-16 Thread Aaron Brady
Hello, I observed an inconsistency in the behavior of 'set' and 'dict' iterators. It is "by design" according to the docs. ''' http://docs.python.org/dev/library/stdtypes.html#dict-views iter(dictview). Iterating views while adding or deleting entries in the dictionary may raise a RuntimeErr

Re: Dynamically determine base classes on instantiation

2012-08-16 Thread Steven D'Aprano
On Thu, 16 Aug 2012 19:18:18 +0200, Thomas Bach wrote: > Imagine you have two data sets: > > d1 = {'foo': None} > d2 = {'foo': 8} > > Where I would assume that d1 has "foo" not set. That's why I want this > whole "merge"-thing in the first place: to be able to extract the type > {'foo': None} fr

Re: Dynamically determine base classes on instantiation

2012-08-16 Thread Steven D'Aprano
On Thu, 16 Aug 2012 14:52:30 +0200, Thomas Bach wrote: > I'm > querying the crunchbase API which returns JSON data and is rather poorly > documented. I want to create a data model for the companies listed on > Crunchbase in order to be able to put the queried data in a data-base. > As I am too laz

Re: Dynamically determine base classes on instantiation

2012-08-16 Thread Steven D'Aprano
On Thu, 16 Aug 2012 10:03:51 -0700, Richard Thomas wrote: > class Foo(object): > def __new__(cls, arg): > if isinstance(arg, list): > cls = FooList > elif isinstance(arg, dict): > cls = FooDict > return object.__new__(cls, arg) > > class FooList

Re: [ANNC] pybotwar-0.8

2012-08-16 Thread Ethan Furman
MRAB wrote: On 16/08/2012 16:40, Ramchandra Apte wrote: On 16 August 2012 21:00, Mark Lawrence wrote: and "bottom" reads better than "top" [snip] Look you are the only person complaining about top-posting. GMail uses top-posting by default. I can't help it if you feel irritated by it.

Re: Dynamically determine base classes on instantiation

2012-08-16 Thread Steven D'Aprano
On Thu, 16 Aug 2012 10:09:08 -0700, Richard Thomas wrote: >> a is a Foo >> b is a Foo >> therefore a and b are the same type > > What you mean here is "a and b share a common base class". No. I mean what I said: since a and b are both direct instances of Foo, not subclasses, they are both the s

Re: Strange behavior

2012-08-16 Thread Steven D'Aprano
On Thu, 16 Aug 2012 13:18:59 +0200, Virgil Stokes wrote: > On 15-Aug-2012 02:19, Steven D'Aprano wrote: >> On Tue, 14 Aug 2012 21:40:10 +0200, Virgil Stokes wrote: >> >>> You might find the following useful: >>> >>> def testFunc(startingList): >>> xOnlyList = []; j = -1 >>> for xl in s

Re: dbf.py API question concerning Index.index_search()

2012-08-16 Thread Ethan Furman
MRAB wrote: On 16/08/2012 17:13, Ethan Furman wrote: Currently there are: .index(data) --> returns index of data in Index, or raises error .query(string) --> brute force search, returns all matching records .search(match) --> binary search through table, returns all matching

Re: Dynamically determine base classes on instantiation

2012-08-16 Thread Thomas Bach
On Thu, Aug 16, 2012 at 10:03:51AM -0700, Richard Thomas wrote: > class Foo(object): > def __new__(cls, arg): > if isinstance(arg, list): > cls = FooList > elif isinstance(arg, dict): > cls = FooDict > return object.__new__(cls, arg) > > class Fo

Re: Dynamically determine base classes on instantiation

2012-08-16 Thread Thomas Bach
On Thu, Aug 16, 2012 at 12:29:21PM -0400, Dennis Lee Bieber wrote: > On Thu, 16 Aug 2012 14:52:30 +0200, Thomas Bach > declaimed the following in > gmane.comp.python.general: > > Of course, since the parse result (at least from my recent > experiment) is a Python structure, it isn't difficu

Re: Dynamically determine base classes on instantiation

2012-08-16 Thread Richard Thomas
> a is a Foo > b is a Foo > therefore a and b are the same type What you mean here is "a and b share a common base class". -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamically determine base classes on instantiation

2012-08-16 Thread Richard Thomas
class Foo(object): def __new__(cls, arg): if isinstance(arg, list): cls = FooList elif isinstance(arg, dict): cls = FooDict return object.__new__(cls, arg) class FooList(Foo, list): pass class FooDict(Foo, dict): pass You could even hav

Re: Dynamically determine base classes on instantiation

2012-08-16 Thread Thomas Bach
On Thu, Aug 16, 2012 at 05:10:43PM +0200, Hans Mulder wrote: > On 16/08/12 14:52:30, Thomas Bach wrote: > > > > So, my question (as far as I can see it, please correct me if I am > > wrong) is less of the "How do I achieve this?"-kind, but more of the > > "What is a clean design for this?"-kind. M

Re: [ANNC] pybotwar-0.8

2012-08-16 Thread MRAB
On 16/08/2012 16:40, Ramchandra Apte wrote: On 16 August 2012 21:00, Mark Lawrence mailto:breamore...@yahoo.co.uk>> wrote: and "bottom" reads better than "top" [snip] Look you are the only person complaining about top-posting. GMail uses top-posting by default. I can't help it if you fe

Re: dbf.py API question concerning Index.index_search()

2012-08-16 Thread MRAB
On 16/08/2012 17:13, Ethan Furman wrote: MRAB wrote: On 16/08/2012 02:22, Ethan Furman wrote: Steven D'Aprano wrote: On Wed, 15 Aug 2012 16:26:09 -0700, Ethan Furman wrote: Indexes have a new method (rebirth of an old one, really): .index_search( match, start=None, stop

Re: OT: Monty Python in Syria

2012-08-16 Thread Dotan Cohen
On Thu, Aug 16, 2012 at 3:01 AM, Terry Reedy wrote: > But it has nothing to do with Monty Python either, that I can see. > Nor is there a video to see the context of (OP said "For context, start the > video at 1:00.") Perhaps link is erroneous. > At 1:00 the captor asks the pilot to state his nam

Re: dbf.py API question concerning Index.index_search()

2012-08-16 Thread Ethan Furman
MRAB wrote: On 16/08/2012 02:22, Ethan Furman wrote: Steven D'Aprano wrote: On Wed, 15 Aug 2012 16:26:09 -0700, Ethan Furman wrote: Indexes have a new method (rebirth of an old one, really): .index_search( match, start=None, stop=None, nearest=False, partial=

Re: type(None)()

2012-08-16 Thread Ethan Furman
Hans Mulder wrote: On 8/08/12 04:14:01, Steven D'Aprano wrote: NoneType raises an error if you try to create a second instance. bool just returns one of the two singletons (doubletons?) again. py> type(None)() Traceback (most recent call last): File "", line 1, in TypeError: cannot create 'N

Re: type(None)()

2012-08-16 Thread Ethan Furman
Ramchandra Apte wrote: Are they the same object Yes. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sharing code between different projects?

2012-08-16 Thread andrea crotti
2012/8/16 andrea crotti : > > > Unfortunately I think you guess wrong > http://forums.perforce.com/index.php?/topic/553-perforce-svnexternals-equivalent/ > Anyway with views and similar things is not that hard to implement the > same thing.. I'm very happy to say that I finally made it! It took

Re: type(None)()

2012-08-16 Thread Stefan Behnel
Ramchandra Apte, 16.08.2012 17:39: > On 16 August 2012 21:01, Stefan Behnel wrote: >> Steven D'Aprano, 16.08.2012 15:58: > NoneType raises an error if you try to create a second instance. >>> In my opinion, this is a PITA for None and better behaviour would be to >>> return the pre-existing Non

Re: [ANNC] pybotwar-0.8

2012-08-16 Thread Ramchandra Apte
I think I'll use Google Groups now. On 16 August 2012 21:10, Ramchandra Apte wrote: > > > On 16 August 2012 21:00, Mark Lawrence wrote: > >> and "bottom" reads better than "top" >> >> >> On 16/08/2012 15:37, Ramchandra Apte wrote: >> >>> nah.. "war" sounds better than "contest" >>> >>> On 16 Au

Re: [ANNC] pybotwar-0.8

2012-08-16 Thread Ramchandra Apte
On 16 August 2012 21:00, Mark Lawrence wrote: > and "bottom" reads better than "top" > > > On 16/08/2012 15:37, Ramchandra Apte wrote: > >> nah.. "war" sounds better than "contest" >> >> On 16 August 2012 14:59, Jean-Michel Pichavant > >wrote: >> >> Lee Harr wrote: >>> >>> pybotwar is a fun and

Re: type(None)()

2012-08-16 Thread Ramchandra Apte
Are they the same object On 16 August 2012 21:01, Stefan Behnel wrote: > Steven D'Aprano, 16.08.2012 15:58: > >>> NoneType raises an error if you try to create a second instance. > > In my opinion, this is a PITA for None and better behaviour would be to > > return the pre-existing NoneType inst

Re: type(None)()

2012-08-16 Thread Stefan Behnel
Steven D'Aprano, 16.08.2012 15:58: >>> NoneType raises an error if you try to create a second instance. > In my opinion, this is a PITA for None and better behaviour would be to > return the pre-existing NoneType instance, but I didn't design the > language. The time machine strikes again. Pyth

Re: [ANNC] pybotwar-0.8

2012-08-16 Thread Mark Lawrence
and "bottom" reads better than "top" On 16/08/2012 15:37, Ramchandra Apte wrote: nah.. "war" sounds better than "contest" On 16 August 2012 14:59, Jean-Michel Pichavant wrote: Lee Harr wrote: pybotwar is a fun and educational game where players write computer programs to control simulated r

Re: Dynamically determine base classes on instantiation

2012-08-16 Thread Hans Mulder
On 16/08/12 14:52:30, Thomas Bach wrote: > On Thu, Aug 16, 2012 at 12:16:03AM +, Steven D'Aprano wrote: >> > Some comments: >> > >> > 1) What you show are not "use cases", but "examples". A use-case is a >> > description of an actual real-world problem that needs to be solved. A >> > couple

Re: type(None)()

2012-08-16 Thread MRAB
On 16/08/2012 15:56, Robert Kern wrote: On 8/16/12 2:56 PM, Ian Kelly wrote: On Thu, Aug 16, 2012 at 6:47 AM, Hans Mulder wrote: On 8/08/12 04:14:01, Steven D'Aprano wrote: NoneType raises an error if you try to create a second instance. bool just returns one of the two singletons (doubletons

Re: type(None)()

2012-08-16 Thread Robert Kern
On 8/16/12 2:56 PM, Ian Kelly wrote: On Thu, Aug 16, 2012 at 6:47 AM, Hans Mulder wrote: On 8/08/12 04:14:01, Steven D'Aprano wrote: NoneType raises an error if you try to create a second instance. bool just returns one of the two singletons (doubletons?) again. py> type(None)() Traceback (mo

Re: Verify the integrity of the tar file with tarfile module?

2012-08-16 Thread Ramchandra Apte
Just opening the file may not create an error. You have to read some files to check for errors. On 15 August 2012 20:29, rudson alves wrote: > Hello, > > I took a Slackware package file .tar (uncompressed) and edited with random > characters to generate any error in its structure, as shown in th

Re: Strange behavior

2012-08-16 Thread Virgil Stokes
On 16-Aug-2012 15:02, Peter Otten wrote: Virgil Stokes wrote: def testFunc(startingList): xOnlyList = []; j = -1 for xl in startingList: if (xl[0] == 'x'): That's going to fail in the starting list contains an empty string. Use xl.startswith('x') instead. Yes, but this was by design (tacitly

Re: [ANNC] pybotwar-0.8

2012-08-16 Thread Ramchandra Apte
nah.. "war" sounds better than "contest" On 16 August 2012 14:59, Jean-Michel Pichavant wrote: > Lee Harr wrote: > >> pybotwar is a fun and educational game where players >> write computer programs to control simulated robots. >> >> http://pybotwar.googlecode.**com/

Re: Running Python web apps on shared ASO servers?

2012-08-16 Thread Gilles
On Sun, 12 Aug 2012 02:03:33 +0200, Gilles wrote: >Does it mean that ASO only supports writing Python web apps as >long-running processes (CGI, FCGI, WSGI, SCGI) instead of embedded >Python à la PHP? I need to get the big picture about the different solutions to run a Python web application. >Fr

Re: type(None)()

2012-08-16 Thread Steven D'Aprano
On Thu, 16 Aug 2012 14:47:47 +0200, Hans Mulder wrote: > On 8/08/12 04:14:01, Steven D'Aprano wrote: >> NoneType raises an error if you try to create a second instance. bool >> just returns one of the two singletons (doubletons?) again. >> >> py> type(None)() >> Traceback (most recent call last):

Re: type(None)()

2012-08-16 Thread Ian Kelly
On Thu, Aug 16, 2012 at 6:47 AM, Hans Mulder wrote: > On 8/08/12 04:14:01, Steven D'Aprano wrote: >> NoneType raises an error if you try to create a second instance. bool >> just returns one of the two singletons (doubletons?) again. >> >> py> type(None)() >> Traceback (most recent call last): >>

Re: A difficulty with lists

2012-08-16 Thread Madison May
On Wednesday, August 15, 2012 8:21:22 PM UTC-4, Terry Reedy wrote: > On 8/15/2012 5:58 PM, Rob Day wrote: > > Yeah, my apologies for any confusion I created. Although I suppose my > explanation would be somewhat true for immutable objects since they can't be > modified in-place (any modificatio

Re: type(None)()

2012-08-16 Thread Chris Angelico
On Thu, Aug 16, 2012 at 10:47 PM, Hans Mulder wrote: > Why doesn't it just return an existing instance of the type, > like bool, int, str and other built-in non-mutable types do? > >> py> type(False)() is False >> True With int and str, it's only an optimization, and not guaranteed to happen. >>

Re: type(None)()

2012-08-16 Thread Laszlo Nagy
On 2012-08-16 14:47, Hans Mulder wrote: On 8/08/12 04:14:01, Steven D'Aprano wrote: NoneType raises an error if you try to create a second instance. bool just returns one of the two singletons (doubletons?) again. py> type(None)() Traceback (most recent call last): File "", line 1, in TypeE

Re: Strange behavior

2012-08-16 Thread Peter Otten
Virgil Stokes wrote: >>> def testFunc(startingList): >>>xOnlyList = []; j = -1 >>>for xl in startingList: >>>if (xl[0] == 'x'): >> That's going to fail in the starting list contains an empty string. Use >> xl.startswith('x') instead. > Yes, but this was by design (tacitly assumed that startingList

Re: Dynamically determine base classes on instantiation

2012-08-16 Thread Thomas Bach
On Thu, Aug 16, 2012 at 12:16:03AM +, Steven D'Aprano wrote: > Some comments: > > 1) What you show are not "use cases", but "examples". A use-case is a > description of an actual real-world problem that needs to be solved. A > couple of asserts is not a use-case. Thanks for the clarificatio

type(None)()

2012-08-16 Thread Hans Mulder
On 8/08/12 04:14:01, Steven D'Aprano wrote: > NoneType raises an error if you try to create a second instance. bool > just returns one of the two singletons (doubletons?) again. > > py> type(None)() > Traceback (most recent call last): > File "", line 1, in > TypeError: cannot create 'NoneType'

Re: SSLSocket.getpeercert() doesn't return issuer, serial number, etc

2012-08-16 Thread Antoine Pitrou
Hello, Gustavo Baratto gmail.com> writes: > > SSL.Socket.getpeercert() doesn't return essential information present in the > client certificate (issuer, serial number, not before, etc), and it looks it > is > by design: It does, in Python 3.2: http://docs.python.org/py3k/library/ssl.html#clie

Re: Strange behavior

2012-08-16 Thread Virgil Stokes
On 15-Aug-2012 02:19, Steven D'Aprano wrote: On Tue, 14 Aug 2012 21:40:10 +0200, Virgil Stokes wrote: You might find the following useful: def testFunc(startingList): xOnlyList = []; j = -1 for xl in startingList: if (xl[0] == 'x'): That's going to fail in the starting l

Re: how to call perl script from html using python

2012-08-16 Thread Rob Day
On 16 August 2012 08:23, Pervez Mulla wrote: > > > In HTml when user submit POST method, it calling Python code Instead > of this I wanna call perl script for sign up .. > > Can you not just change the action= attribute in your HTML attribute to point to your Perl CGI script? -- Robert

Re: Installing Python 3.2.3 on Win 7

2012-08-16 Thread Ulrich Eckhardt
Am 16.08.2012 09:17, schrieb Johan van Zyl: I installed Python 3.2.3 successfully on my work laptop (XP) but cannot seem to do it on my home PC (Win7) I click the button to install and the window just disappears o the screen. So how do I in fact install Python 3.2.3 on Win 7? I used some MSI fi

Re: how to call perl script from html using python

2012-08-16 Thread andrea crotti
2012/8/16 Pervez Mulla : > > Hey Steven , > > Thank you for your response, > > I will in detail now about my project, > > Actually the project entire backend in PERL language , Am using Django > framework for my front end . > I have written code for signup page in python , which is working perfec

Re: Sharing code between different projects?

2012-08-16 Thread andrea crotti
2012/8/16 Jean-Michel Pichavant : > > SVN allows to define external dependencies, where one repository will > actually checkout another one at a specific version. If SVN does it, I guess > any decent SCM also provide such feature. > > Assuming our project is named 'common', and you have 2 projects

Re: Installing Python 3.2.3 on Win 7

2012-08-16 Thread Johan van Zyl
Python 32 bit on Win 7 32 bit. Thx! On 16 August 2012 12:32, Tommi Helander wrote: > Hi Johan, > > -Are you trying to install 32 or 64-bit Python? > -Is your Win7 32 or 64-bits? > -Have you tried running the Python installer from the command line to see if > it generates any helpful output? > > -

Re: dbf.py API question concerning Index.index_search()

2012-08-16 Thread Hans Mulder
On 16/08/12 01:26:09, Ethan Furman wrote: > Indexes have a new method (rebirth of an old one, really): > > .index_search( > match, > start=None, > stop=None, > nearest=False, > partial=False ) > > The defaults are to search the entire index for exact matches and raise >

RE: Installing Python 3.2.3 on Win 7

2012-08-16 Thread Tommi Helander
Hi Johan, -Are you trying to install 32 or 64-bit Python? -Is your Win7 32 or 64-bits? -Have you tried running the Python installer from the command line to see if it generates any helpful output? -Tommi Helander > Date: Thu, 16 Aug 2012 09:17:43 +0200 > Subject: Installing Python 3.2.3 on Win

Installing Python 3.2.3 on Win 7

2012-08-16 Thread Johan van Zyl
Hi I installed Python 3.2.3 successfully on my work laptop (XP) but cannot seem to do it on my home PC (Win7) I click the button to install and the window just disappears o the screen. So how do I in fact install Python 3.2.3 on Win 7? -- Johan van Zyl PMB - Box 21673, Mayors Walk, 3208 Pretoria

Re: [ANNC] pybotwar-0.8

2012-08-16 Thread Jean-Michel Pichavant
Lee Harr wrote: pybotwar is a fun and educational game where players write computer programs to control simulated robots. http://pybotwar.googlecode.com/ The focus of this release is making all functionality available from the PyQt interface and making PyQt the default interface. pybotwar use

Re: OT: Monty Python in Syria

2012-08-16 Thread PythonAB
On 16 aug 2012, at 02:56, Andrew Cooper wrote: > On 16/08/2012 01:52, Andrew Cooper wrote: >> On 16/08/2012 01:01, Terry Reedy wrote: >>> On 8/15/2012 6:07 PM, Mark Lawrence wrote: On 15/08/2012 20:15, Tamer Higazi wrote: > Exactly! > NOT PROGRAMMING related has NOTHING TODO HERE! >>

Re: Sharing code between different projects?

2012-08-16 Thread Jean-Michel Pichavant
andrea crotti wrote: 2012/8/14 Cameron Simpson : Having just skimmed this thread, one thing I haven't quite seen suggested is this: Really do make a third "utilities" project, and treat "the project" and "deploy" as separate notions. So to actually run/deploy project A's code you'd have a sh

Re: Help needed installing easy_install and lxml2

2012-08-16 Thread Ian
On 16/08/2012 08:01, Stefan Behnel wrote: http://lxml.de/FAQ.html#where-are-the-binary-builds Stefan Hi Stefan, Thanks Stefan, everything is working fine now. Regards Ian -- http://mail.python.org/mailman/listinfo/python-list

Re: how to call perl script from html using python

2012-08-16 Thread Pervez Mulla
On Tuesday, August 14, 2012 10:42:48 AM UTC+5:30, Pervez Mulla wrote: > Hi, > > > > I wanna call perl script in HTML form n store that data in DB using Python. > > > > How can i do this...?? > > > > Please help me > > > > Thank you > > Pervez On Tuesday, August 14, 2012 10:42:48

Re: Help needed installing easy_install and lxml2

2012-08-16 Thread Stefan Behnel
Ian, 15.08.2012 21:39: > On a reasonably fresh (3 day old) install of 64 bit windows 7, I have > installed the 64 bit Python 2.7.3 from http://www.python.org/download/ > > Then I installed the 64 bit version of easy_install using > http://pypi.python.org/pypi/setuptools > > And then install lxml