Re: multiple pattern regular expression

2008-04-25 Thread Arnaud Delobelle
Chris Henry <[EMAIL PROTECTED]> writes: > On Apr 25, 8:37 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> micron_make <[EMAIL PROTECTED]> writes: >> > I am trying to parse a file whose contents are : >> >> > parameter=current >> > max=5A >> > min=2A > [snip] >> If every line of the file is of t

new user

2008-04-25 Thread [EMAIL PROTECTED]
Hi ! This is my first message . I new here . I like python , blender 3d and opengl and is a hobby for me. I have a site www.catalinfest.xhost.ro where i write about me and python , blender ... I hope learning more on this group . Have a nice day ! -- http://mail.python.org/mailman/listinfo/pyth

So you think PythonCard is old? Here's new wine in an old bottle.

2008-04-25 Thread John Henry
For serveral years, I have been looking for a way to migrate away from desktop GUI/client-server programming onto the browser based network computing model of programming. Unfortunately, up until recently, browser based programs are very limited - due to the limitation of HTML itself. Eventhough

Re: multiple pattern regular expression

2008-04-25 Thread Chris Henry
On Apr 25, 8:37 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > micron_make <[EMAIL PROTECTED]> writes: > > I am trying to parse a file whose contents are : > > > parameter=current > > max=5A > > min=2A [snip] > If every line of the file is of the form name=value, then regexps are > indeed not ne

Re: MESSAGE RESPONSE

2008-04-25 Thread Daniel Fetchinson
> >> And as such, I find it hard to believe you could lose your job > >> over it. > > > > Me too. That is, until I tried to Google Belcan and Blubaugh > > together. May I suggest a new thread to clear that ugly > > results? :D > > I know it's not nice to laugh at things like that, but I can't > hel

Re: Setting an attribute without calling __setattr__()

2008-04-25 Thread Arnaud Delobelle
Joshua Kugler <[EMAIL PROTECTED]> writes: [...] > self.me = [] > for v in obj: > self.me.append(ObjectProxy(v)) Note that is could be spelt: self.me = map(ObjectProxy, v) -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Hard & Soft Parts Available Here X

2008-04-25 Thread Manisa999
SEXY SEGMENT *** http://bigsexmovies.notlong.com/ http://indiansexx.notlong.com/ *** -- http://mail.python.org/mailman/listinfo/python-list

Latest PC Parts In Small Price U Nid Contact Mi!!

2008-04-25 Thread Manisa999
SEXY SEGMENT *** http://bigsexmovies.notlong.com/ http://indiansexx.notlong.com/ *** -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is None <= 0

2008-04-25 Thread John Nagle
Gregor Horvath wrote: D'Arcy J.M. Cain schrieb: On Fri, 25 Apr 2008 20:27:15 +0200 Gregor Horvath <[EMAIL PROTECTED]> wrote: >>> None <= 0 True Why? Why not? Because, from http://www.python.org/dev/peps/pep-0020/ : Errors should never pass silently. In the face of ambiguity, refuse the t

Re: multiple pattern regular expression

2008-04-25 Thread Nick Stinemates
On Fri, Apr 25, 2008 at 08:40:55PM -0400, Carsten Haese wrote: > Nick Stinemates wrote: >> On Fri, Apr 25, 2008 at 09:50:56AM -0400, [EMAIL PROTECTED] wrote: >>> How about this? >>> >>> for line in file: >>> # ignore lines without = assignment >>> if '=' in line: >>> property, value

Re: Why is None <= 0

2008-04-25 Thread Ben Finney
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2008-04-25, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > > On Fri, 25 Apr 2008 20:27:15 +0200 > > Gregor Horvath <[EMAIL PROTECTED]> wrote: > >> >>> None <= 0 > >> True > > Everything in Python can compare to everything else. > > Not true. Even mo

Re: Is 2006 too old for a book on Python?

2008-04-25 Thread Dan Bishop
On Apr 25, 8:16 am, jmDesktop <[EMAIL PROTECTED]> wrote: > Hi, I wanted to buy a book on Python, but am concerned that some of > them are too old. One I had come to after much research was Core > Python by Wesley Chun. I looked at many others, but actually saw this > one in the store and liked it

Re: Is 2006 too old for a book on Python?

2008-04-25 Thread Scott David Daniels
jmDesktop wrote: Hi, I wanted to buy a book on Python, but am concerned that some of them are too old. One I had come to after much research was Core Python by Wesley Chun. I looked at many others, but actually saw this one in the store and liked it. However, it is from 2006. I know there is

Re: problem with mmap

2008-04-25 Thread hdante
On Apr 25, 4:43 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Apr 25, 9:37 am, Neal Becker <[EMAIL PROTECTED]> wrote: > > > On linux, I don't understand why: > > > f = open ('/dev/eos', 'rw') > > m = mmap.mmap(f.fileno(), 100, prot=mmap.PROT_READ|mmap.PROT_WRITE, > > flags=mmap.MAP_SHARED) > >

Logging ancestors ignored if config changes?

2008-04-25 Thread andrew cooke
Hi, I am seeing some odd behaviour with logging which would be explained if loggers that are not defined explicitly (but which are controlled via their ancestors) must be created after the logging system is configured via fileConfig(). That's a bit abstract, so here's the problem itself: I defi

Re: problem with unicode

2008-04-25 Thread hdante
On Apr 25, 8:15 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > I don't know what to do. I just want to concatenate two string where > apparently one is a binary string, the other one is a unicode string > and I always seem to get this error. Please explain better what you want to do with

Desktop notifications on Windows

2008-04-25 Thread windypower
I'm looking for a way to implement desktop notifications (much like an instant messaging program or a mail notifier) within my Python application, on Windows only (no Gtk/Galago, please). I need no more than a simple text-based notification, which should be clickable and have a timeout, nothing els

Re: Setting an attribute without calling __setattr__()

2008-04-25 Thread George Sakkis
On Apr 25, 5:01 pm, Joshua Kugler <[EMAIL PROTECTED]> wrote: > My init lookslike this: > > def __init__(self, obj=None): > if type(obj).__name__ in 'list|tuple|set|frozenset': > self.me = [] > for v in obj: > self.me.append(ObjectProxy(v)) >

Re: newbie question

2008-04-25 Thread John
Thanks for the tip! -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question about import

2008-04-25 Thread Gabriel Genellina
En Fri, 25 Apr 2008 15:03:18 -0300, Luca <[EMAIL PROTECTED]> escribió: Hi all. I'm trying to do something with python import but isn't working for me. Using python 2,5 I've a program structured like this: * a main module called (for example) "mommy" with an __init__.py and a file called "mom

Re: newbie question

2008-04-25 Thread Gabriel Genellina
En Fri, 25 Apr 2008 19:35:58 -0300, John <[EMAIL PROTECTED]> escribió: I'm working with the HTMLParser module and have implemented HTMLParser.handle_starttag() and I see there is a separate handle_data method (which can be implemented), but I am not clear how to tie this together with a given st

Re: ioctl, pass buffer address, howto?

2008-04-25 Thread Gabriel Genellina
En Fri, 25 Apr 2008 09:30:56 -0300, Neal Becker <[EMAIL PROTECTED]> escribió: I need an ioctl call equivalent to this C code: my_struct s; s.p = p; << a pointer to an array of char s.image_size = image_size; return (ioctl(fd, xxx, &s)); I'm thinking to use python array for th

Re: Setting an attribute without calling __setattr__()

2008-04-25 Thread Joshua Kugler
John Machin wrote: >> Is there a way to define self.me without it firing __setattr__? > Consider reading the *second* paragraph about __setattr__ in section > 3.4.2 of the Python Reference Manual. Like I said in my original post, it was probably staring me right in the face. I had read through a

Re: Pyserial - send and receive characters through linux serial port

2008-04-25 Thread Gabriel Genellina
En Fri, 25 Apr 2008 20:22:37 -0300, terry <[EMAIL PROTECTED]> escribió: I am trying to send a character to '/dev/ttyS0' and expect the same character and upon receipt I want to send another character. I tired with Pyserial but in vain. I assume you have a device attached to /dev/ttyS0 that ech

Re: MESSAGE RESPONSE

2008-04-25 Thread Grant Edwards
On 2008-04-25, ajaksu <[EMAIL PROTECTED]> wrote: >> And as such, I find it hard to believe you could lose your job >> over it. > > Me too. That is, until I tried to Google Belcan and Blubaugh > together. May I suggest a new thread to clear that ugly > results? :D I know it's not nice to laugh at

Re: multiple pattern regular expression

2008-04-25 Thread Carsten Haese
Nick Stinemates wrote: On Fri, Apr 25, 2008 at 09:50:56AM -0400, [EMAIL PROTECTED] wrote: How about this? for line in file: # ignore lines without = assignment if '=' in line: property, value = line.strip().split( '=', 1 ) property = property.strip().lower() valu

Re: Why is None <= 0

2008-04-25 Thread Grant Edwards
On 2008-04-25, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > On Fri, 25 Apr 2008 20:27:15 +0200 > Gregor Horvath <[EMAIL PROTECTED]> wrote: >> >>> None <= 0 >> True >> >> Why? > > Why not? > >> Is there a logical reason? > > Everything in Python can compare to everything else. Not true. Pytho

Re: Why is None <= 0

2008-04-25 Thread Jon Ribbens
On 2008-04-25, Martin v. Löwis <[EMAIL PROTECTED]> wrote: > None is smaller than anything. According to Tim Peters, this is not true. See http://bugs.python.org/issue1673405 -- http://mail.python.org/mailman/listinfo/python-list

Re: Receive data from socket stream

2008-04-25 Thread hdante
On Apr 25, 7:39 pm, [EMAIL PROTECTED] wrote: > I wanted to ask for standard ways to receive data from a socket stream > (with socket.socket.recv()). It's simple when you know the amount of > data that you're going to receive, or when you'll receive data until > the remote peer closes the connection

Re: Python Success stories

2008-04-25 Thread Aahz
In article <[EMAIL PROTECTED]>, azrael <[EMAIL PROTECTED]> wrote: > >Which big aplications are written in python. YouTube -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ Why is this newsgroup different from all other newsgroups? -- http://mail.python.org/mailman

Re: Setting expirty data on a cookie

2008-04-25 Thread Jon Ribbens
On 2008-04-25, David <[EMAIL PROTECTED]> wrote: > Another note: 'expires' is apprantly a legacy attribute for early > Netscape browsers. The RFC and python source comments suggest that you > use 'Max-Age' instead. Theoretically, yes. In practice, no. *Nobody* uses the new-style cookies, everyone u

Re: Python Success stories

2008-04-25 Thread Bob Woodham
On 2008-04-24, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Apr 23, 2:08 pm, Bob Woodham <[EMAIL PROTECTED]> wrote: > >> x = x++; >> >> has unspecified behaviour in C. That is, it is not specified >> whether the value of x after execution of the statement is the >> old value of x or one plus the

Re: [Python-Dev] annoying dictionary problem, non-existing keys

2008-04-25 Thread Collin Winter
2008/4/24 bvidinli <[EMAIL PROTECTED]>: > I posted to so many lists because, > > this issue is related to all lists, > this is an idea for python, > this is related to development of python... > > why are you so much defensive ? > > i think ideas all important for development of python, softwa

Pyserial - send and receive characters through linux serial port

2008-04-25 Thread terry
Hi, I am trying to send a character to '/dev/ttyS0' and expect the same character and upon receipt I want to send another character. I tired with Pyserial but in vain. Test Set up: 1. Send '%' to serial port and make sure it reached the serial port. 2. Once confirmed, send another character. I

Re: Python Success stories

2008-04-25 Thread Bob Woodham
On 2008-04-24, AlFire <[EMAIL PROTECTED]> wrote: > Bob Woodham wrote: > >> >> x = x++; >> >> has unspecified behaviour in C. > > what about C++ To the extent that (historically) C++ was a superset of C, it was true of C++ as well. However, I haven't kept pace with the C++ standardization proces

Re: MESSAGE RESPONSE

2008-04-25 Thread Neil Hodgson
ajaksu: Me too. That is, until I tried to Google Belcan and Blubaugh together. Or google for "Blubaugh, David" or similar. Repeating a message you object to actually increases its visibility and includes you in its footprint. Neil -- http://mail.python.org/mailman/listinfo/python-lis

Re: MESSAGE RESPONSE

2008-04-25 Thread Dan Upton
On Fri, Apr 25, 2008 at 7:00 PM, ajaksu <[EMAIL PROTECTED]> wrote: > On Apr 23, 1:27 pm, "Dan Upton" <[EMAIL PROTECTED]> wrote: > > > On Wed, Apr 23, 2008 at 10:24 AM, Diez B. Roggisch <[EMAIL PROTECTED]> > > wrote: > > > > > Blubaugh, David A. schrieb: > > > > > > Is there a way to block thes

Re: MESSAGE RESPONSE

2008-04-25 Thread ajaksu
On Apr 23, 1:27 pm, "Dan Upton" <[EMAIL PROTECTED]> wrote: > On Wed, Apr 23, 2008 at 10:24 AM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > > Blubaugh, David A. schrieb: > > > > Is there a way to block these messages.   I do not want to be caught > > > with filth such as this material.  I could

Re: Receive data from socket stream

2008-04-25 Thread s0suk3
On Apr 25, 5:52 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I wanted to ask for standard ways to receive data from a socket stream > > (with socket.socket.recv()). It's simple when you know the amount of > > data that you're going to receive, or when you'll receiv

Re: Receive data from socket stream

2008-04-25 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: I wanted to ask for standard ways to receive data from a socket stream (with socket.socket.recv()). It's simple when you know the amount of data that you're going to receive, or when you'll receive data until the remote peer closes the connection. But I'm not sure which

Re: multiple pattern regular expression

2008-04-25 Thread Nick Stinemates
On Fri, Apr 25, 2008 at 09:50:56AM -0400, [EMAIL PROTECTED] wrote: > How about this? > > for line in file: > # ignore lines without = assignment > if '=' in line: > property, value = line.strip().split( '=', 1 ) > property = property.strip().lower() > value = value.

Re: Remove old version before upgrade?

2008-04-25 Thread Terry Reedy
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Sal wrote: | > I'm currently running Windows version 2.5.1 and would like to upgrade | > to 2.5.2. My question is, can I just go ahead and install the new | > version over the old or should I remove the old version with

Receive data from socket stream

2008-04-25 Thread s0suk3
I wanted to ask for standard ways to receive data from a socket stream (with socket.socket.recv()). It's simple when you know the amount of data that you're going to receive, or when you'll receive data until the remote peer closes the connection. But I'm not sure which is the best way to receive a

newbie question

2008-04-25 Thread John
I'm working with the HTMLParser module and have implemented HTMLParser.handle_starttag() and I see there is a separate handle_data method (which can be implemented), but I am not clear how to tie this together with a given start tag, so I only get the data I want. For example, I'd like to get a ha

Re: Setting an attribute without calling __setattr__()

2008-04-25 Thread Terry Reedy
"Joshua Kugler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | OK, I'm sure the answer is staring me right in the face--whether that answer | be "you can't do that" or "here's the really easy way--but I am stuck. I'm | writing an object to proxy both lists (subscriptable iterable

Re: Calling Python code from inside php

2008-04-25 Thread Nick Stinemates
On Fri, Apr 25, 2008 at 03:29:49PM +0200, Diez B. Roggisch wrote: > Nick Stinemates schrieb: >>> While I certainly prefer to use Python wherever I can, that does not mean >>> that there aren't cases where legacy systems or other constraints make >>> this impossible. If I have e.g. a type3-based w

nntplib retrieve news://FULL_URL

2008-04-25 Thread [EMAIL PROTECTED]
So I have established a connection to an nntp server and I am retrieving articles to other articles on the server such as news://newsclip.ap.org/[EMAIL PROTECTED] Now I am wondering how I query for that article based off of the url? I assume D8L4MFAG0 is an id of some sort but when I try and retr

Re: MESSAGE RESPONSE

2008-04-25 Thread Nick Stinemates
On Thu, Apr 24, 2008 at 06:50:44PM +0200, Diez B. Roggisch wrote: > Blubaugh, David A. schrieb: >> Dear Sir, >> Belcan has an absolute zero-tolerance policy toward material such as the >> material described. > > That pairs up nicely with them having zero knowledge about the internet. > ZING! --

Re: is there a python equivalent for this tool?

2008-04-25 Thread Stefan Behnel
Jorge Vargas wrote: > Dear python users, do you know of a tool like this that is written in python? > > http://code.google.com/p/css-redundancy-checker/ > > in case you where wondering I just don't want to have the ruby > dependency on my python proyects. This comes to mind: http://code.google.

Re: Subclassing datetime.date does not seem to work

2008-04-25 Thread John Machin
On Apr 26, 7:43 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > Rick King schrieb: > > > > > I would like to subclass datetime.date so that I can write: > > > d = date2('12312008') > > > I tried: > > > from datetime import date > > class date2(date): > > def __init__( self, strng ): > >

newbie question

2008-04-25 Thread JMysak
I'm working with the HTMLParser module and have implemented HTMLParser.handle_starttag() and I see there is a separate handle_data method (which can be implemented), but I am not clear how to tie this together with a given start tag, so I only get the data I want. For example, I'd like to get a ha

ANN: Dao 1.0 preview version is released

2008-04-25 Thread Limin Fu
Hi, I am please to announce a preview release of Dao (1.0). Dao is a simple yet powerful object-oriented programming language featured by, optional typing, BNF-like macro system, regular expression, multidimensional numeric array, asynchronous function call for concurrent programming etc. Since t

is there a python equivalent for this tool?

2008-04-25 Thread Jorge Vargas
Dear python users, do you know of a tool like this that is written in python? http://code.google.com/p/css-redundancy-checker/ in case you where wondering I just don't want to have the ruby dependency on my python proyects. -- http://mail.python.org/mailman/listinfo/python-list

Re: Goodbying Spaces

2008-04-25 Thread Luis Zarrabeitia
Whats the result of using id.strip()?: In [1]: " asdfasdf ".strip() Out[1]: 'asdfasdf' It should work, I guess... Btw, you can write your code without using len in a cleaner way: try: if id[0] == ' ': id = id[1:] # Note this slice notation... except: pass try: if id[-1] == ' ':

Re: Why is None <= 0

2008-04-25 Thread Christian Heimes
> In my humble opinion, I think that comparisons involving None should > return None, but I trust that the designers came up with this for very > good reasons. As far as I know I've never been bitten by it. It's fixed in Python 3.x. Python 3.x refuses to compare objects unless one of both objects

Re: Subclassing datetime.date does not seem to work

2008-04-25 Thread Christian Heimes
Rick King schrieb: > I would like to subclass datetime.date so that I can write: > > d = date2('12312008') > > I tried: > > from datetime import date > class date2(date): > def __init__( self, strng ): > mm,dd,yy = int(strng[:2]), int(strng[2:4]), int(strng[4:]) > date.__init

Re: problem with unicode

2008-04-25 Thread John Machin
On Apr 26, 6:42 am, Bjoern Schliessmann wrote: > John Machin wrote: > > On Apr 25, 10:01 pm, Bjoern Schliessmann >> >>> media="x???[?" > >> >>> print repr(media.decode("utf-8")) > > >> u'x\u30ef\u30e6\u30ed[\u30e8' > > (dang, KNode doesn't autodetect encodings ...) > > > But that_unicode_string.e

Re: display monochromatic images wxPython

2008-04-25 Thread Mike Driscoll
On Apr 25, 3:42 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Dear All, > I want to write a GUI program with wxPython displaying an image. But > the image I have is monochromatic. When I retrieve the data from the > image I end up with a list of integer. Starting from a list of integer > and

Re: Setting an attribute without calling __setattr__()

2008-04-25 Thread Hrvoje Niksic
Hrvoje Niksic <[EMAIL PROTECTED]> writes: > Joshua Kugler <[EMAIL PROTECTED]> writes: > >> self.me = [] >> self.me = {} > > Use "object.__setattr__(self, 'me') = []" and likewise for {}. Oops, that should of course be "object.__setattr__(self, 'me', [])". -- http://mail.py

Re: Setting an attribute without calling __setattr__()

2008-04-25 Thread John Machin
On Apr 26, 7:01 am, Joshua Kugler <[EMAIL PROTECTED]> wrote: > OK, I'm sure the answer is staring me right in the face--whether that answer > be "you can't do that" or "here's the really easy way--but I am stuck. I'm > writing an object to proxy both lists (subscriptable iterables, really) and > d

Re: Setting an attribute without calling __setattr__()

2008-04-25 Thread Hrvoje Niksic
Joshua Kugler <[EMAIL PROTECTED]> writes: > self.me = [] > self.me = {} Use "object.__setattr__(self, 'me') = []" and likewise for {}. -- http://mail.python.org/mailman/listinfo/python-list

Re: pop langs website ranking

2008-04-25 Thread Jan Claeys
Op Wed, 23 Apr 2008 04:07:31 +, schreef Roedy Green: > The weakness of this approach is it is unusual group of people who will > voluntarily submit to having their usage spied on. These are not a > typical group or a large group. Hello, planet Earth calling? I guess around 90% of internet u

Oilfield Applications: WITS AND WITSML

2008-04-25 Thread xkenneth
All, If anyone has any interest in developing a bit of code for generating WITS and WITSML in python, then drop me a line. I've started a project on google apps, "PyWITS", and I plan to support both WITS and WITSML through a set of standard libraries. I would really appreciate help from other

Setting an attribute without calling __setattr__()

2008-04-25 Thread Joshua Kugler
OK, I'm sure the answer is staring me right in the face--whether that answer be "you can't do that" or "here's the really easy way--but I am stuck. I'm writing an object to proxy both lists (subscriptable iterables, really) and dicts. My init lookslike this: def __init__(self, obj=None):

Goodbying Spaces

2008-04-25 Thread Victor Subervi
Hi; Whenever I call a field from the preceeding form using cgi.FieldStorage() I get a space on either side. I end up writing code like this to get rid of that space: try: if id[0] == ' ': id = id[1:len(id)] except: pass try: if id[len(id) - 1] == ' ': id = id[0:len(id) - 1] exce

display monochromatic images wxPython

2008-04-25 Thread [EMAIL PROTECTED]
Dear All, I want to write a GUI program with wxPython displaying an image. But the image I have is monochromatic. When I retrieve the data from the image I end up with a list of integer. Starting from a list of integer and knowing the width and height of the image, how do I display such an image on

Re: problem with unicode

2008-04-25 Thread Bjoern Schliessmann
John Machin wrote: > On Apr 25, 10:01 pm, Bjoern Schliessmann > >>> media="x???[?" >> >>> print repr(media.decode("utf-8")) >> >> u'x\u30ef\u30e6\u30ed[\u30e8' (dang, KNode doesn't autodetect encodings ...) > But that_unicode_string.encode("utf-8") produces > 'x\xe3\x83\xaf\xe3\x83\xa6\xe3\x83\xa

Re: List of all Python's ____ ?

2008-04-25 Thread Dave Opstad
In article <[EMAIL PROTECTED]>, John Machin <[EMAIL PROTECTED]> wrote: > Hrvoje Niksic wrote: > > [EMAIL PROTECTED] writes: > > > >> Is there an official list of all Python's ? > > > > http://docs.python.org/ref/specialnames.html > > __missing__ is missing :-) > > see note (10) at the bot

Re: Calling Python code from inside php

2008-04-25 Thread Eric Wertman
> > A simple yet dangerous and rather rubbish solution (possibly more of a > > hack than a real implementation) could be achieved by using a > > technique described above: > > > > > echo exec('python foo.py'); > > This will spawn a Python interpreter, and not be particularly > effi

Re: Calling Python code from inside php

2008-04-25 Thread sturlamolden
On Apr 23, 9:08 pm, MC <[EMAIL PROTECTED]> wrote: > If you are under Windows, you can: > - call Python's functions via Active-Scripting > - call a Python COM server (functions or properties) > > For that, use Pywin32. And, in all cases, call functions can use > parameters. This is perhaps the p

Re: problem with mmap

2008-04-25 Thread Carl Banks
On Apr 25, 9:37 am, Neal Becker <[EMAIL PROTECTED]> wrote: > On linux, I don't understand why: > > f = open ('/dev/eos', 'rw') > m = mmap.mmap(f.fileno(), 100, prot=mmap.PROT_READ|mmap.PROT_WRITE, > flags=mmap.MAP_SHARED) > > gives 'permission denied', Try f = open('/dev/eos', 'r+') Carl Ba

Re: Setting expirty data on a cookie

2008-04-25 Thread David
> import Cookie > import time > c = Cookie.SimpleCookie() > c['data'] = "unamepwordwhatever" > c['data']['expires'] = 30 * 24 * 60 * 60 > print c > > Gives an output of: > > "Set-Cookie: data=unamepwordwhatever; expires=Sat, 24-May-2008 > 12:11:36 GMT" > Hi again. I didn't see your replie

Re: Why is None <= 0

2008-04-25 Thread Gary Herron
Gregor Horvath wrote: Hi, >>> None <= 0 True Why? Is there a logical reason? Gregor -- http://mail.python.org/mailman/listinfo/python-list In early Python, the decision was made that the comparison of *any* two objects was legal and would return a consistent result. So objects of differen

Re: Why is None <= 0

2008-04-25 Thread Grant Edwards
On 2008-04-25, Gregor Horvath <[EMAIL PROTECTED]> wrote: > Hi, > > >>> None <= 0 > True > > Why? Comparing objects of differing types produces an undefined result. Next time you do it, it might return False. (Well, it's not really going to, but it's allowed to.) > Is there a logical reason? For

Re: Why is None <= 0

2008-04-25 Thread D'Arcy J.M. Cain
On Fri, 25 Apr 2008 11:54:23 -0700 Paul McNett <[EMAIL PROTECTED]> wrote: > In my humble opinion, I think that comparisons involving None should > return None... Like relational databases. -- D'Arcy J.M. Cain <[EMAIL PROTECTED]> | Democracy is three wolves http://www.druid.net/darcy/

Re: Why is None <= 0

2008-04-25 Thread Gregor Horvath
D'Arcy J.M. Cain schrieb: On Fri, 25 Apr 2008 20:27:15 +0200 Gregor Horvath <[EMAIL PROTECTED]> wrote: >>> None <= 0 True Why? Why not? Because, from http://www.python.org/dev/peps/pep-0020/ : Errors should never pass silently. In the face of ambiguity, refuse the temptation to guess. Gr

Re: Why is None <= 0

2008-04-25 Thread Paul McNett
Gregor Horvath wrote: >>> None <= 0 True More accurately: None < 0 True Why? Is there a logical reason? None is "less than" everything except for itself: >>> None < 'a' True >>> None < False True >>> None == None True In my humble opinion, I think that comparisons involving None shoul

Re: Why is None <= 0

2008-04-25 Thread D'Arcy J.M. Cain
On Fri, 25 Apr 2008 20:27:15 +0200 Gregor Horvath <[EMAIL PROTECTED]> wrote: > >>> None <= 0 > True > > Why? Why not? > Is there a logical reason? Everything in Python can compare to everything else. It is up to the programmer to make sure that they are comparing reasonable things. -- D'Arc

Re: Why is None <= 0

2008-04-25 Thread Martin v. Löwis
None <= 0 > True > > Why? > Is there a logical reason? None is smaller than anything. The choice of making it so is arbitrary, however, Python 2.x tries to impose a total order on all objects (with varying success), therefore, it is necessary to take arbitrary choices. (FWIW, in 2.x, x>=4?

Re: print some text

2008-04-25 Thread Gabriel Ibanez
Hi ! Other idea (old style school): def printing(): f=open("lpt1", "w") f.write("\nSomething to print\f") f.close() Cheers.. - Ibanez - - Original Message - From: <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Wednesday, April 23, 2008 10:27 PM Subject: Re: print

Why is None <= 0

2008-04-25 Thread Gregor Horvath
Hi, >>> None <= 0 True Why? Is there a logical reason? Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question about import

2008-04-25 Thread Kay Schluehr
On 25 Apr., 20:03, Luca <[EMAIL PROTECTED]> wrote: > Hi all. I'm trying to do something with python import but isn't working for > me. > > Using python 2,5 I've a program structured like this: > > * a main module called (for example) "mommy" with an __init__.py and a > file called "mommy.py" > * a

Re: Newbie question about import

2008-04-25 Thread Larry Bates
Luca wrote: Hi all. I'm trying to do something with python import but isn't working for me. Using python 2,5 I've a program structured like this: * a main module called (for example) "mommy" with an __init__.py and a file called "mommy.py" * a __version__ var defined inside the main __init__.py

Re: Problem building python in virtual machine running centos

2008-04-25 Thread Alexandre Gillet
Thanks for your answers. I did solve my problem. I upgraded my glibc libraries and it seems to solve the problem. I was able to build python-2.4.5 using gcc 4.1.2 (glibc-2.5-18.el5_1.1) Alex On Thu, 2008-04-24 at 18:05 -0700, Alexandre Gillet wrote: > Hi, > > I am trying to build python-2.4.5 on

Newbie question about import

2008-04-25 Thread Luca
Hi all. I'm trying to do something with python import but isn't working for me. Using python 2,5 I've a program structured like this: * a main module called (for example) "mommy" with an __init__.py and a file called "mommy.py" * a __version__ var defined inside the main __init__.py >From the mo

Re: convert xhtml back to html

2008-04-25 Thread Tim Arnold
"bryan rasmussen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'll second the recommendation to use xsl-t, set the output to html. > > > The code for an XSL-T to do it would be basically: > http://www.w3.org/1999/XSL/Transform"; > version="1.0"> > > > > > you would probabl

Re: Calling Python code from inside php

2008-04-25 Thread alexelder
On Apr 25, 4:02 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > On Apr 23, 9:13 pm, [EMAIL PROTECTED] wrote: > > > A simple yet dangerous and rather rubbish solution (possibly more of a > > hack than a real implementation) could be achieved by using a > > technique described above: > > > > e

Re: how to mysqldb dict cursors

2008-04-25 Thread Vaibhav.bhawsar
Hmm that explains it! Thank you. v On Fri, Apr 25, 2008 at 7:38 AM, Steve Holden <[EMAIL PROTECTED]> wrote: > Vaibhav.bhawsar wrote: > [top-posting amended: see below] > >> On Fri, Apr 25, 2008 at 12:45 AM, Paul McNett <[EMAIL PROTECTED] > [EMAIL PROTECTED]>> wrote: >> >>Vaibhav.bhawsar wrote

Re: Subclassing list the right way?

2008-04-25 Thread Matimus
On Apr 25, 7:03 am, Kirk Strauser <[EMAIL PROTECTED]> wrote: > I want to subclass list so that each value in it is calculated at call > time. I had initially thought I could do that by defining my own > __getitem__, but 1) apparently that's deprecated (although I can't > find that; got a link?), a

Re: convert xhtml back to html

2008-04-25 Thread Jim Washington
Stefan Behnel wrote: bryan rasmussen top-posted: On Thu, Apr 24, 2008 at 9:55 PM, Stefan Behnel <[EMAIL PROTECTED]> wrote: from lxml import etree tree = etree.parse("thefile.xhtml") tree.write("thefile.html", method="html") http://codespeak.net/lxml wow, that's pr

Re: module error in Vista -- works as administrator

2008-04-25 Thread sawilla
I've discovered the cause of the problem. At some point previously, Windows Vista had created a copy of the site-packages directory in a virtual store for the user account. The easy-install.pth file in the virtual store did not contain the same path information as the easy- install.pth that the adm

Re: Explicit variable declaration

2008-04-25 Thread Filip Gruszczyński
> In Python the standard patten for "declaring" variables is just to assign to > them as they are needed. If you want the effect of a declaration as you > would do in C, you can just define the variable and initialize it to 0 or > None. (Or {} for a new dictionary, or [] for a new list.) Yep

Re: py3k concerns. An example

2008-04-25 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > I still think it's a shame > [...] > > pps: I have to note that it would be nice if the > > ad-hominem (sp?) invective would drop out of > > these threads -- it doesn't add a lot, I think. > > shame > 1 a. a p

Fun with relative imports and py3k

2008-04-25 Thread Kay Schluehr
Since their introduction in Python 2.5 I only reviewed the new "relative import" notation briefly by reading the "What's new in Python 2.5" article. Now I wanted checkout if I get comfortable with them. Opening the tutorial I found following notice ( 6.4.2 ): "Note that both explicit and implicit

Re: module error in Vista -- works as administrator

2008-04-25 Thread sawilla
The access writes to easy-install.pth for regular users is read and execute. The output of sys.path for regular users is: ['', 'C:\\Program Files\\Python25\\lib\\site-packages\ \setuptools-0.6c8-py2.5.eg g', 'C:\\Program Files\\Python25\\python25.zip', 'C:\\Program Files\ \Python25\\D LLs', 'C:\\P

Brand Watches Ebel Classic Brown Leather Strap Date Mens Watch 9120F51.6235134 Discount, Swiss, Fake

2008-04-25 Thread watches0560
Brand Watches Ebel Classic Brown Leather Strap Date Mens Watch 9120F51.6235134 Discount, Swiss, Fake Browse our Ebel Classic Brown Leather Strap Date Mens Watch 9120F51.6235134 Swiss watches, which is sure the watch you are looking for at low price. There are more high quality designer watch Swiss

Brand Watches Seiko Men's Watches Premier SNA745P - AA Discount, Swiss, Fake

2008-04-25 Thread watches0560
Brand Watches Seiko Men's Watches Premier SNA745P - AA Discount, Swiss, Fake Browse our Seiko Men's Watches Premier SNA745P - AA Swiss watches, which is sure the watch you are looking for at low price. There are more high quality designer watch Swiss for selection Seiko Men's Watches Premier SNA7

Subclassing datetime.date does not seem to work

2008-04-25 Thread Rick King
I would like to subclass datetime.date so that I can write: d = date2('12312008') I tried: from datetime import date class date2(date):     def __init__( self, strng ):     mm,dd,yy = int(strng[:2]), int(strng[2:4]), int(strng[4:])     date.__init__(self,yy,mm,dd) But then this stat

Re: why does the following with Queue, q.put('\x02', True) not put it in the queue?

2008-04-25 Thread Jerry Hill
On Fri, Apr 25, 2008 at 11:11 AM, Gabriel Rossetti <[EMAIL PROTECTED]> wrote: > yes, if you do it that way (s = '\x02') it works, but I read the data from > a file, and I that way it doesn't work It does work (using Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]

Having problems with wxPython - HELP!!

2008-04-25 Thread Marlin Rowley
I'm desperately spending too much time trying to understand wxPython and it's leading me nowhere. I'm trying to make a script that will create a window, and then immediately fill this window with a background color. I also want to be able to fill this window with a background color anytime I n

  1   2   >