Re: Seeding the rand() Generator

2009-08-04 Thread Xavier Ho
On Tue, Aug 4, 2009 at 5:48 PM, Fred Atkinson wrote: > I tried using the same command I used when I did this in PHP. > That command was: mt_srand(date("w")) > >It was a PHP command that seeds the MySQL random function, > according to the folks on the PHP newsgroup. Well, some people have

Re: Seeding the rand() Generator

2009-08-04 Thread Jarkko Torppa
On 2009-08-04, Fred Atkinson wrote: > On Mon, 3 Aug 2009 20:00:08 -0700 (PDT), Carl Banks > wrote: >> >>If you don't "get" why this is a MySQL question and not a Python >>question, then you need to learn more about what you are doing. > > I wouldn't agree. > > I tried using the same

Re: merge two png pic

2009-08-04 Thread News123
Hi, cocobear wrote: >> > >> Map = Image.new("RGB", (x,y)) >> > >> Map.paste(im, box) >> > >> Map.paste(im1,box) > >> > >> Map = Map.convert("L", optimize=True, palette=Image.ADAPTIVE) > >> > >> But if thetwopngpicis too big , or if I have tomergemorepic >> > >> together, I will get MemoryError: >

Re: merge two png pic

2009-08-04 Thread Xavier Ho
Strange, I did reply but you didn't see it? > > >> >>> Image.new("RGB",(44544,38656)) > >> > >> What do you want to do with such a big image? You will run into the same > >> limitation when you are trying to display it. > >> > > > > I want to download a map from google map with high precision

Strange python script behaviour

2009-08-04 Thread Łukasz
Hi, I have a problem with one of my python scripts. When I run this script from command line it works correctly, but if I set up cron to run this script on specified hour it works for a while and then "[Errno 32] Broken pipe" error occures (always). The strangest thing is that if I change command

modify a exe's RT_ACCELERATOR table using pefile module

2009-08-04 Thread est
Hi list, I need to modify a exe's RT_ACCELERATOR table, rename F1 to Ctrl+F1, and assign hotkey F1 to another function Is there a way to do it with pefile/python? A sample code is appreciated. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Announcing PythonTurtle

2009-08-04 Thread cool-RR
On Aug 4, 7:12 am, John Posner wrote: > > ... I would also venture to say a key-map > > of sorts that is available thru the help menu where one could push an > > "Up" button, or a "rotate" button, and have the proper command > > inserted in the prompt, and then have the command execute, may also >

Hello to the community

2009-08-04 Thread aurelien
Hello to the Python community ! I'm a totaly newbbie in this langage. I hope i will learn a lot with you. Thanks. aurelien -- http://mail.python.org/mailman/listinfo/python-list

Re: fast video encoding

2009-08-04 Thread greg
Rhodri James wrote: Unfortunately, water pixels change a lot from frame to frame, even when the camera is static, so it doesn't gain you as much as you might hope in cases like you mention. In the case mentioned, the water is of no interest, so it could be removed altogether by a suitable cust

Re: Extracting text from html

2009-08-04 Thread Justin Ezequiel
http://tinyurl.com/kpoweq -- http://mail.python.org/mailman/listinfo/python-list

Re: Is python buffer overflow proof?

2009-08-04 Thread Paul Rubin
Steven D'Aprano writes: > The point is that code you write yourself can rely on "pure Python" to be > free of buffer-overflows (for some definition of "rely") rather than > having to worry about managing memory yourself. Right. Basically the Python interpreter protects you reasonably well from

Re: Compiling regex inside function?

2009-08-04 Thread Anthra Norell
alex23 wrote: Anthra Norell wrote: def entries (l): r = re.compile ('([0-9]+) entr(y|ies)') match = r.search (l) if match: return match.group (1) So the question is: does "r" get regex-compiled once at py-compile time or repeatedly at entries() run time? The do

Re: Strange python script behaviour

2009-08-04 Thread Loïc Domaigné
Hi, > I have a problem with one of my python scripts. When I run this script > from command line it works correctly, but if I set up cron to run this > script on specified hour it works for a while and then "[Errno 32] > Broken pipe" error occures (always). > > The strangest thing is that if I cha

Re: Confessions of a Python fanboy

2009-08-04 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Fri, 31 Jul 2009 13:38:56 +0200, Bruno Desthuilliers wrote: On the other hand, we don't have to prefix names with @ and @@, Nope, we have to prefix them with 'self' or 'cls' (or even 'self.__class__'). Incorrect. Correct for all relevant cases, except this one:

Re: Strange python script behaviour

2009-08-04 Thread Lars Behrens
Łukasz wrote: > The strangest thing is that if I change command in CRON > > from > python /home/xxx/script.py > to > python /home/xxx/script.py > /tmp/script.log 2>&1 > > the script always works correctly!!! > > The question is WHY? Any ideas? Seems to me that this is more of a shell thing...

Re: Strange python script behaviour

2009-08-04 Thread Łukasz
On 4 Sie, 10:02, Loïc Domaigné wrote: > Hi, > > > I have a problem with one of my python scripts. When I run this script > > from command line it works correctly, but if I set up cron to run this > > script on specified hour it works for a while and then "[Errno 32] > > Broken pipe" error occures

Re: Strange python script behaviour

2009-08-04 Thread Łukasz
On 4 Sie, 10:08, Lars Behrens wrote: > Łukasz wrote: > > The strangest thing is that if I change command in CRON > > > from > > python /home/xxx/script.py > > to > > python /home/xxx/script.py  > /tmp/script.log 2>&1 > > > the script always works correctly!!! > > > The question is WHY? Any ideas?

Re: Is python buffer overflow proof?

2009-08-04 Thread Gabriel Genellina
En Tue, 04 Aug 2009 02:06:06 -0300, John Nagle escribió: Gabriel Genellina wrote: En Mon, 03 Aug 2009 18:04:53 -0300, sturlamolden escribió: On 2 Aug, 15:50, Jizzai wrote: Is a _pure_ python program buffer overflow proof? For example in C++ you can declare a char[9] to hold user input.

Re: easy_install: unresolved external symbol

2009-08-04 Thread Bart Smeets
I could ofcourse use cxfreeze's binary package. But bbfreeze is not available as a binary. I would love to get easy_install to work. But I have no idea what's going wrong here. 2009/8/4 Gabriel Genellina > En Mon, 03 Aug 2009 17:39:44 -0300, Bart Smeets > escribió: > > I keep getting errors whe

Re: Strange python script behaviour

2009-08-04 Thread Loïc Domaigné
> > > I have a problem with one of my python scripts. When I run this script > > > from command line it works correctly, but if I set up cron to run this > > > script on specified hour it works for a while and then "[Errno 32] > > > Broken pipe" error occures (always). > > > > The strangest thing

Re: easy_install: unresolved external symbol

2009-08-04 Thread David Lyon
On Tue, 4 Aug 2009 10:52:20 +0200, Bart Smeets wrote: > I could ofcourse use cxfreeze's binary package. But bbfreeze is not > available as a binary. I would love to get easy_install to work. But I have > no idea what's going wrong here. What is going on is that setuptools does some very 'advanced

Re: Confessions of a Python fanboy

2009-08-04 Thread Steven D'Aprano
On Tue, 04 Aug 2009 10:03:53 +0200, Bruno Desthuilliers wrote: >> Disadvantages: your code is filled with line noise. It's an arbitrary >> choice between @@ meaning instance attribute and @@ meaning class >> attribute -- there's no logical reason for choosing one over the other, >> so you have to

ANN: Python's turtle module: collection of examples + demoViewer

2009-08-04 Thread Gregor Lingl
Hi all, A few days ago I've created a repository of turtle graphics demos/applications, that use Python's new turtle module. You can find it at at google code: http://python-turtle-demo.googlecode.com There are two versions of the collection: one for use with Python 3.1 and one for use with P

Re: Confessions of a Python fanboy

2009-08-04 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : > On Tue, 04 Aug 2009 10:03:53 +0200, Bruno Desthuilliers wrote: > >>> Disadvantages: your code is filled with line noise. It's an arbitrary >>> choice between @@ meaning instance attribute and @@ meaning class >>> attribute -- there's no logical reason for choosing one o

Re: Help understanding the decisions *behind* python?

2009-08-04 Thread Masklinn
On 3 Aug 2009, at 18:57 , John Nagle wrote: Dave Angel wrote: sturlamolden wrote: On 20 Jul, 18:27, Phillip B Oldham wrote: Tuples are used for passing arguments to and from a function. Common use of tuples include multiple return values and optional arguments (*args). That's from Mesa, th

Re: Confessions of a Python fanboy

2009-08-04 Thread Masklinn
On 4 Aug 2009, at 11:28 , Steven D'Aprano wrote: So I'd ask, does Smalltalk's message passing model match the way human beings think? Yes. -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining Python version

2009-08-04 Thread Yinon Ehrlich
On Aug 4, 1:19 am, John Nagle wrote: > This works, but it seems too cute: > >  >>> pyver = map(int,sys.version.split()[0].split('.')) >  >>> print(pyver) > [2, 6, 1] > > Is it guaranteed that the Python version string will be in a form > suitable for that?  In other words, does "sys.version" begin

Re: Which GUI framework to use?

2009-08-04 Thread koranthala
On Aug 4, 11:48 am, "Diez B. Roggisch" wrote: > koranthala schrieb: > > > Hi, > >    I am creating a very minimal application (a networking app). > >    I have written the application using Twisted. > >    Now, I need to put a GUI wrapper on the application. > >    The application needs a login sc

Re: Is python buffer overflow proof?

2009-08-04 Thread Christian Heimes
John Nagle wrote: A more useful question is whether the standard libraries are being run through any of the commercial static checkers for possible buffer overflows. The CPython interpreter is constantly checked with http://www.coverity.com/. Although Python is used for critical stuff at

Re: Announcing PythonTurtle

2009-08-04 Thread Gregor Lingl
cool-RR schrieb: Hello, I wanted to announce that I have just released my little side project, PythonTurtle. Here is its website: http://pythonturtle.com Its goal is to be the lowest-threshold way to learn (or teach) Python. You can read more about it and download it on the website. Ram. Hi

Re: Is python buffer overflow proof?

2009-08-04 Thread Thorsten Kampe
* Jizzai (Sun, 02 Aug 2009 13:50:14 GMT) > Is a _pure_ python program buffer overflow proof? You cannot create "your own" buffer overflow in Python as you can in C and C++ but your code could still be vulnerable if the underlying Python construct is written in C. See [1] for instance. Thorsten

How to fetch an XML file using an HTTPS query

2009-08-04 Thread Ido Levy
Hello All I am quite new to Python and I would appreciate your advice on the following issue. I am trying to fetch an XML file from a remote server using an HTTPS query. When testing the HTTPS query from the browser after I entered the URL I got a pop-up box asking me if I want to "save a fi

how to create a Com object of Picalo Module

2009-08-04 Thread Mehndi, Sibtey
Hi I want to use the picalo module in to VB.NET so I have tried to create the COM object of picalo module but I am unable to create. Anyone can help me out to create the picalo com object. Thanks, Sibtey This e-mail (and any attachments), is confidential and may be privileged. I

Re: Obtaining Python version

2009-08-04 Thread Xavier Ho
On Tue, Aug 4, 2009 at 8:30 PM, Yinon Ehrlich wrote: > Hi, > Easy way to test for Python version: > if sys.hexversion >= 0x2060100: > pass > Great suggestion. I just tested it on my newly installed Python 3.1 (as of 3.1r31) >>> import sys >>> "%X" % sys.hexversion '30100F0' That's genius - '3

Re: Obtaining Python version

2009-08-04 Thread Xavier Ho
On Tue, Aug 4, 2009 at 9:34 PM, Xavier Ho wrote: > ... and '00F0' is r31! > Actually, 00F0 is 576 in decimal. Maybe it's the subversion? Anyhow, it's still good! -- http://mail.python.org/mailman/listinfo/python-list

Re: Announcing PythonTurtle

2009-08-04 Thread Gregor Lingl
cool-RR schrieb: On Aug 4, 7:12 am, John Posner wrote: ... I would also venture to say a key-map ... If you're asking WHY I put it in a wxPython application, the answer is pretty much what "r" said: To make it like any other "over the counter" Windows application, making people feel more co

Re: Seeding the rand() Generator

2009-08-04 Thread Fred Atkinson
On Tue, 04 Aug 2009 07:12:30 GMT, Jarkko Torppa wrote: >On 2009-08-04, Fred Atkinson wrote: >> On Mon, 3 Aug 2009 20:00:08 -0700 (PDT), Carl Banks >> wrote: >>> >>>If you don't "get" why this is a MySQL question and not a Python >>>question, then you need to learn more about what you are doing.

Re: merge two png pic

2009-08-04 Thread cocobear
On Aug 4, 3:24 pm, News123 wrote: > Hi, > > > > > > cocobear wrote: > >> > >> Map = Image.new("RGB", (x,y)) > >> > >> Map.paste(im, box) > >> > >> Map.paste(im1,box) > > >> > >> Map = Map.convert("L", optimize=True, palette=Image.ADAPTIVE) > > >> > >> But if thetwopngpicis too big , or if I have t

Re: Which GUI framework to use?

2009-08-04 Thread Hendrik van Rooyen
On Tuesday 04 August 2009 06:09:05 koranthala wrote: > Hi, >I am creating a very minimal application (a networking app). >I have written the application using Twisted. >Now, I need to put a GUI wrapper on the application. >The application needs a login screen and also it needs to be

Re: Announcing PythonTurtle

2009-08-04 Thread cool-RR
> Hi Ram, > > that's indeed a nice starting point for kids to doing turtle graphics, > although currently it seems to implement only a very small subset of > Python's turtle module's capabilities, even less than those of the old > turtle module (that shipped with Python upto 2.5). > I agree - an

Problem in Installing PyGreSQL

2009-08-04 Thread Thangappan.M
Dear all, While installing PyGreSQl module in my machine I got the error as pg_config command not found. I am not a super user. how can I install this pg_config tool. -- Regards, Thangappan.M -- http://mail.python.org/mailman/listinfo/python-list

Re: Is python buffer overflow proof?

2009-08-04 Thread Tim Chase
Marcus Wanner wrote: On 8/3/2009 3:45 AM, Diez B. Roggisch wrote: But you can cast the resulting pointer to an array of larger size, and there you are. Ah, that makes sense. I had forgotten about ctypes.cast(). You *can* shoot yourself in the foot with Python, you just have to aim much more

Re: Problem in installing PyGreSQL

2009-08-04 Thread D'Arcy J.M. Cain
On Tue, 04 Aug 2009 00:42:25 -0400 David Lyon wrote: > > Then I tried to download the module.But I am not able to download it. > > Did none of the links here work? > > http://www.pygresql.org/readme.html#where-to-get The RPM seems to be missing. I am currently trying to find one. I don't run

Re: Announcing PythonTurtle

2009-08-04 Thread Gregor Lingl
cool-RR schrieb: Hi Ram, that's indeed a nice starting point for kids to doing turtle graphics, although currently it seems to implement only a very small subset of Python's turtle module's capabilities, even less than those of the old turtle module (that shipped with Python upto 2.5). ... A t

Re: Problem in installing PyGreSQL

2009-08-04 Thread Benjamin Kaplan
On Tue, Aug 4, 2009 at 8:48 AM, D'Arcy J.M. Cain wrote: > On Tue, 04 Aug 2009 00:42:25 -0400 > David Lyon wrote: >> > Then I tried to download the module.But I am not able to download it. >> >> Did none of the links here work? >> >> http://www.pygresql.org/readme.html#where-to-get > > The RPM seem

Re: Python configuration question when python scripts are executed using Appweb as web server.

2009-08-04 Thread IronyOfLife
On Aug 3, 8:42 pm, "Gabriel Genellina" wrote: > En Mon, 03 Aug 2009 11:04:07 -0300, IronyOfLife   > escribió: > > > I have installed python 2.6.2 in windows xp professional machine. I > > have set the following environment variables -- PYTHONPATH. It points > > to following windows folders: pytho

Re: Newbie Question regarding __init__()

2009-08-04 Thread Dave Angel
Dennis Lee Bieber wrote: On Mon, 03 Aug 2009 23:00:13 -0400, Dave Angel declaimed the following in gmane.comp.python.general: To throw away the result of an expression in Python is even easier. Just don't use it. func1() and func2() is a valid expression whose result is not used.

Re: Problem in Installing PyGreSQL

2009-08-04 Thread Philip Semanchuk
On Aug 4, 2009, at 8:25 AM, Thangappan.M wrote: Dear all, While installing PyGreSQl module in my machine I got the error as pg_config command not found. I am not a super user. how can I install this pg_config tool. Thangappan, pg_config is part of PostgreSQL. It reports various pieces of

Re: Is python buffer overflow proof?

2009-08-04 Thread Neil Hodgson
Thorsten Kampe: > You cannot create "your own" buffer overflow in Python as you can in C > and C++ but your code could still be vulnerable if the underlying Python > construct is written in C. Python's standard library does now include unsafe constructs. import ctypes x = '1234' # Munging b

Re: How to fetch an XML file using an HTTPS query

2009-08-04 Thread Tycho Andersen
Blah, forgot to include the list. When is python-list going to get Reply-To? \t On Tue, Aug 4, 2009 at 8:38 AM, Tycho Andersen wrote: > Hi Ido, > > On Tue, Aug 4, 2009 at 6:25 AM, Ido Levy wrote: >> [snip] >> I got the following result in both cases: >>         >>         >>         Invalid fil

Re: Problem in installing PyGreSQL

2009-08-04 Thread D'Arcy J.M. Cain
On Tue, 4 Aug 2009 09:03:55 -0400 Benjamin Kaplan wrote: > Doesn't matter here. Debians use DEBs (DEBian packages), not RPMs (for > the Red Hat Package Manager). Either way, the OP can't install system > level packages. That's what the comment about not being a super user > meant. Urk! I thought

Re: Problem in installing PyGreSQL

2009-08-04 Thread D'Arcy J.M. Cain
On Tue, 4 Aug 2009 09:03:55 -0400 Benjamin Kaplan wrote: > Doesn't matter here. Debians use DEBs (DEBian packages), not RPMs (for > the Red Hat Package Manager). Either way, the OP can't install system > level packages. That's what the comment about not being a super user > meant. By the way, you

Re: Problem in installing PyGreSQL

2009-08-04 Thread Benjamin Kaplan
On Tue, Aug 4, 2009 at 9:55 AM, D'Arcy J.M. Cain wrote: > On Tue, 4 Aug 2009 09:03:55 -0400 > Benjamin Kaplan wrote: >> Doesn't matter here. Debians use DEBs (DEBian packages), not RPMs (for >> the Red Hat Package Manager). Either way, the OP can't install system >> level packages. That's what the

Re: Problem in installing PyGreSQL

2009-08-04 Thread D'Arcy J.M. Cain
On Tue, 4 Aug 2009 10:02:23 -0400 Benjamin Kaplan wrote: > > By the way, you don't have to be super user to install PyGreSQL.  You > > just need SU if you want to install it system wide.  PyGreSQL doesn't > > require any special privileges to run. > > Right, but the packages install system-wide.

Re: Obtaining Python version

2009-08-04 Thread MRAB
Xavier Ho wrote: On Tue, Aug 4, 2009 at 9:34 PM, Xavier Ho > wrote: ... and '00F0' is r31! Actually, 00F0 is 576 in decimal. Maybe it's the subversion? 0x00F0 is 240. Anyhow, it's still good! -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining Python version

2009-08-04 Thread Xavier Ho
On Wed, Aug 5, 2009 at 12:17 AM, MRAB wrote: > 0x00F0 is 240. ... Right. I wonder where my brain is. *searches pocket* So, what am I doing wrong here? >>> int(str(0x00F0), 16) 576 Cheers, -Xav -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining Python version

2009-08-04 Thread D'Arcy J.M. Cain
On Wed, 5 Aug 2009 00:39:56 +1000 Xavier Ho wrote: > So, what am I doing wrong here? > > >>> int(str(0x00F0), 16) Look at the output of str(0x00F0) for a clue. -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/| and a sheep voting on +1 416 4

Re: Announcing PythonTurtle

2009-08-04 Thread John Posner
Certainly John- although I have not embedded the turtle module at all, I just wrote my own. OK, then why the statements "from turtle import *" in the modules turtleprocess.py and turtlewidget.py? Tx, John -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining Python version

2009-08-04 Thread Xavier Ho
On Wed, Aug 5, 2009 at 12:44 AM, D'Arcy J.M. Cain wrote: > On Wed, 5 Aug 2009 00:39:56 +1000 >> Xavier Ho wrote: >> > So, what am I doing wrong here? >> > >> > >>> int(str(0x00F0), 16) >> >> Look at the output of str(0x00F0) for a clue. >> > > ... Wow. I *am* slow tonight. Thanks. > > >>> int('0

Re: WindowsError: exception: access violation writing 0x00000000

2009-08-04 Thread Sparky
On Aug 3, 3:29 pm, Sparky wrote: > Hello! I am using cTypes on Windows to interface with a dll and I keep > getting an error when I execute this method: > > def eDigitalIn(self, channel, idNum = None, demo = 0, readD=0): >         """ >         Name: U12.eAnalogIn(channel, idNum = None, demo = 0,

Re: WindowsError: exception: access violation writing 0x00000000

2009-08-04 Thread Philip Semanchuk
On Aug 4, 2009, at 11:25 AM, Sparky wrote: On Aug 3, 3:29 pm, Sparky wrote: Hello! I am using cTypes on Windows to interface with a dll and I keep getting an error when I execute this method: def eDigitalIn(self, channel, idNum = None, demo = 0, readD=0): """ Name: U12.eAna

Re: Announcing PythonTurtle

2009-08-04 Thread cool-RR
On Tue, Aug 4, 2009 at 5:45 PM, John Posner wrote: > > Certainly John- although I have not embedded the turtle module at all, >> I just wrote my own. >> > > OK, then why the statements "from turtle import *" in the modules > turtleprocess.py and turtlewidget.py? > > Tx, > John > > It's from a mo

Re: kw param question

2009-08-04 Thread kj
In Steven D'Aprano writes: >On Mon, 03 Aug 2009 19:59:23 +, kj wrote: >> I want to write a decorator that, among other things, returns a function >> that has one additional keyword parameter, say foo=None. >> >> When I try >> >> def my_decorator(f): >> # blah, blah >> def wrapper

Re: M2Crypto: X509.X509_Extension_Stack() throws AssertionError

2009-08-04 Thread Matthias Güntert
> > cert_extension_2 = X509.new_extension("keyUsage", "10100") > > Maybe your OpenSSL is too old. keyUsage needs to be defined in OpenSSL > obj_dat.h file for this to work. I am using OpenSSL version 0.9.8k-fips which is the latest version. I replaced: cert_extension_2 = X509.new_ext

M2Crypto: How to generate subjectKeyIdentifier / authorityKeyIdentifier

2009-08-04 Thread Matthias Güntert
Hello I am trying to add the extensions "subjectKeyIdentifier" and "authorityKeyIdentifier" to a x509v3 certificate. Regarding rfc5280, section 4.2.1.2 the key identifier is composed of the 160-bit SHA-1 hash of the BIT STRING subjectPublicKey http://tools.ietf.org/html/rfc5280#section-4.2.1.2

Re: easy_install: unresolved external symbol

2009-08-04 Thread Bart Smeets
How do I give the option to link to the ez_setup.py? 2009/8/4 David Lyon > On Tue, 4 Aug 2009 10:52:20 +0200, Bart Smeets > wrote: > > I could ofcourse use cxfreeze's binary package. But bbfreeze is not > > available as a binary. I would love to get easy_install to work. But I > have > > no ide

Re: WindowsError: exception: access violation writing 0x00000000

2009-08-04 Thread Sparky
On Aug 4, 9:47 am, Philip Semanchuk wrote: > On Aug 4, 2009, at 11:25 AM, Sparky wrote: > > > > > > > On Aug 3, 3:29 pm, Sparky wrote: > >> Hello! I am using cTypes on Windows to interface with a dll and I   > >> keep > >> getting an error when I execute this method: > > >> def eDigitalIn(self, c

pylib/py.test 1.0.0 released

2009-08-04 Thread holger krekel
Hello everyone, i am happy to announce pylib/py.test 1.0.0, a MIT-licensed library geared towards advanced testing and elastic distributed programming with Python. It features the mature cross-project py.test automated testing tool with many new features, aiming to: * allow writing zero-boile

Re: Trying to get ABC to work

2009-08-04 Thread Roman
Following code works, although I'm not sure that it's exactly what you want: import abc class MetaExample(abc.ABCMeta): def __new__(mcs, name, bases, ns): ns['cls_meth'] = mcs.cls_meth if not 'cls_abc' in ns: ns['cls_abc'] = mcs.cls_abc

Overlap in python

2009-08-04 Thread Jay Bird
Hi everyone, I've been trying to figure out a simple algorithm on how to combine a list of parts that have 1D locations that overlap into a non- overlapping list. For example, here would be my input: part name location a 5-9 b 7-10 c 3-6 d

Re: Overlap in python

2009-08-04 Thread Marcus Wanner
On Aug 4, 2:15 pm, Jay Bird wrote: > Hi everyone, > > I've been trying to figure out a simple algorithm on how to combine a > list of parts that have 1D locations that overlap into a non- > overlapping list.  For example, here would be my input: > > part name   location > a                  5-9 >

Re: Overlap in python

2009-08-04 Thread Ann
On Aug 4, 11:31 am, Marcus Wanner wrote: > On Aug 4, 2:15 pm, Jay Bird wrote: > > > > > Hi everyone, > > > I've been trying to figure out a simple algorithm on how to combine a > > list of parts that have 1D locations that overlap into a non- > > overlapping list.  For example, here would be my i

Is it possible to have the python color in the terminal ?

2009-08-04 Thread aurelien
Hello, I am under gNewSense, i am a newbbie on Python, i look for how change the color terminal when python run. at the step >>> all is in black and white. Is it possible to have the python color in the terminal ? Thanks for your help. aurelien -- http://mail.python.org/mailman/listinfo/python

Re: Overlap in python

2009-08-04 Thread Marcus Wanner
On 8/4/2009 2:46 PM, Ann wrote: On Aug 4, 11:31 am, Marcus Wanner wrote: On Aug 4, 2:15 pm, Jay Bird wrote: Hi everyone, I've been trying to figure out a simple algorithm on how to combine a list of parts that have 1D locations that overlap into a non- overlapping list. For example, here

Re: Is it possible to have the python color in the terminal ?

2009-08-04 Thread Marcus Wanner
On 8/4/2009 2:53 PM, aurelien wrote: Hello, I am under gNewSense, i am a newbbie on Python, i look for how change the color terminal when python run. at the step >>> all is in black and white. Is it possible to have the python color in the terminal ? Thanks for your help. aurelien You might t

Re: Overlap in python

2009-08-04 Thread Mark Lawrence
Jay Bird wrote: Hi everyone, I've been trying to figure out a simple algorithm on how to combine a list of parts that have 1D locations that overlap into a non- overlapping list. For example, here would be my input: part name location a 5-9 b 7-10 c

Using Python to automate builds

2009-08-04 Thread Kosta
I am a Python newbie, tasked with automating (researching) building Windows drivers using the WDK build environment. I've been looking into Python for this (instead of writing a bunch of batch files). What I would like to do, is to open a cmd window, and start a Python script. This script would

Is it possible to have the python color in the terminal ?

2009-08-04 Thread aurelien
Hello, I am under gNewSense, i am a newbbie on Python, i look for how change the color terminal when python run. at the step >>> all is in black and white. Is it possible to have the python color in the terminal ? Thanks for your help aurelien -- http://mail.python.org/mailman/listinfo/python-l

Re: no-clobber dicts?

2009-08-04 Thread kj
In Steven D'Aprano writes: >On Mon, 03 Aug 2009 21:07:32 +, kj wrote: >> I use the term "no-clobber dict" to refer to a dictionary D with the >> especial property that if K is in D, then >> >> D[K] = V >> >> will raise an exception unless V == D[K]. In other words, D[K] can be >> set

Re: no-clobber dicts?

2009-08-04 Thread kj
In Chris Rebert writes: >On Mon, Aug 3, 2009 at 2:47 PM, r wrote: >> On Aug 3, 4:07=C2=A0pm, kj wrote: >>> I use the term "no-clobber dict" to refer to a dictionary D with >>> the especial property that if K is in D, then >>> >>> =C2=A0 D[K] =3D V >>> >>> will raise an exception unless V =3D=3

Re: Is it possible to have the python color in the terminal ?

2009-08-04 Thread Roman
On 04/08/09 12:20, aurelien wrote: > Hello, > > I am under gNewSense, i am a newbbie on Python, i look for how change > the color terminal when python run. > at the step >>> all is in black and white. > Is it possible to have the python color in the terminal ? > > Thanks for your help > > aureli

Re: no-clobber dicts?

2009-08-04 Thread Chris Rebert
On Tue, Aug 4, 2009 at 12:30 PM, kj wrote: > In Chris Rebert > writes: > >>On Mon, Aug 3, 2009 at 2:47 PM, r wrote: >>> On Aug 3, 4:07=C2=A0pm, kj wrote: I use the term "no-clobber dict" to refer to a dictionary D with the especial property that if K is in D, then =C2=A0 D[K

Re: Overlap in python

2009-08-04 Thread Gregor Lingl
Jay Bird schrieb: Hi everyone, I've been trying to figure out a simple algorithm on how to combine a list of parts that have 1D locations that overlap into a non- overlapping list. For example, here would be my input: part name location a 5-9 b 7-10 c

Re: no-clobber dicts?

2009-08-04 Thread kj
In Steven D'Aprano writes: >class ConstantNamespace(dict): >I also have a series of unit tests for it if you're interested in them. Actually, come to think of it, I think I'll take you up on this. I'd love to see those tests. Unit testing in Python is in area I need to work on. TIA! kynn

Re: Overlap in python

2009-08-04 Thread Mark Dickinson
On Aug 4, 7:15 pm, Jay Bird wrote: > Hi everyone, > > I've been trying to figure out a simple algorithm on how to combine a > list of parts that have 1D locations that overlap into a non- > overlapping list.  For example, here would be my input: > > part name   location > a                  5-9 >

Re: Newbie Question regarding __init__()

2009-08-04 Thread Simon
On Aug 3, 11:00 pm, Dave Angel wrote: > Simon wrote: > > On Aug 2, 5:51 am, Dave Angel wrote: > > >> > >> I don't understand your comparison to Foxpro.  read on. > > >> As your code was last posted, you don't need a return value from > >> init_Exec()  Every function that doesn't have an explicit

boolean OR gotcha

2009-08-04 Thread 1x7y2z9
>>> 0 or None is None True >>> None or 0 is None False >>> None or 0 is 0 True Yes, this is explained in the docs: The expression x or y first evaluates x; if x is true, its value is returned; otherwise, y is evaluated and the resulting value is returned. Another one (also explainable): >>> 0 or

Re: no-clobber dicts?

2009-08-04 Thread Raymond Hettinger
[kj] > The implication here is that .update() does not in turn use > .__setitem__(), which I find a bit surprising. It's never wise to make assumptions about this sort of thing. Every method in a class or type is allowed to directly access or modify its private, internal data. The implementation

Re: Is it possible to have the python color in the terminal ?

2009-08-04 Thread Mensanator
On Aug 4, 1:53 pm, aurelien wrote: > Hello, > > I am under gNewSense, i am a newbbie on Python, i look for how change > the color terminal when python run. > at the step >>> all is in black and white. > Is it possible to have the python color in the terminal ? Depends on whether your terminal sup

Re: boolean OR gotcha

2009-08-04 Thread Stephen Hansen
> > > # Here is something different: > >>> (0 or None) == (None or 0) > False What is the actual problem? You quoted the docs, it seems very clear. (0 or None) would return None. (None or 0) would return 0. None is not equal to 0, of course. --S -- http://mail.python.org/mailman/listinfo/pyt

Re: boolean OR gotcha

2009-08-04 Thread Jan Kaliszewski
04-08-2009 o 22:11:18 1x7y2z9 <1x7y...@gmail.com> wrote: Another one (also explainable): 0 or None == None or 0 True # Above is same as (operator precedence): 0 or (None == None) or 0 True # Here is something different: (0 or None) == (None or 0) False I don't see any problem here. The

Re: Online payment module

2009-08-04 Thread Kushal Kumaran
On Tue, Aug 4, 2009 at 12:41 AM, Sam Tregar wrote: > Hello all.  I'm considering building a module to provide a > cross-payment-gatewat API for making online payments.  In the Perl world we > have a module like this called Business::OnlinePayment > (http://search.cpan.org/~jasonk/Business-OnlinePay

Re: Overlap in python

2009-08-04 Thread DuaneKaufman
On Aug 4, 1:15 pm, Jay Bird wrote: > Hi everyone, > > I've been trying to figure out a simple algorithm on how to combine a > list of parts that have 1D locations that overlap into a non- > overlapping list.  For example, here would be my input: > > part name   location > a                  5-9 >

ANN: eGenix pyOpenSSL Distribution 0.9.0-0.9.8k now also in .egg format

2009-08-04 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com pyOpenSSL Distribution Version 0.9.0-0.9.8k An easy to install and use repackaged distribution of the pyOpenSSL Python interfa

Re: boolean OR gotcha

2009-08-04 Thread 1x7y2z9
Did not intend that there was a problem. Just a gotcha or a fun little titbit ... maybe. :) On Aug 4, 1:25 pm, "Jan Kaliszewski" wrote: > 04-08-2009 o 22:11:18 1x7y2z9 <1x7y...@gmail.com> wrote: > > > Another one (also explainable): > 0 or None == None or 0 > > True > > # Above is same as

SDMX format

2009-08-04 Thread xamdam
Does anyone know of python libs for writing SDMX XML format? http://www.SDMX.org/resources/SDMXML/schemas/v2_0/common thanks, max. -- http://mail.python.org/mailman/listinfo/python-list

Re: Overlap in python

2009-08-04 Thread Bearophile
Jay Bird: > I've been trying to figure out a simple algorithm on how to combine a > list of parts that have 1D locations that overlap into a non- > overlapping list. For example, here would be my input: > > part name location > a 5-9 > b 7-10 > c

Re: Overlap in python

2009-08-04 Thread Gregor Lingl
DuaneKaufman schrieb: On Aug 4, 1:15 pm, Jay Bird wrote: ... For instance the interval module found at: http://members.cox.net/apoco/interval/ can be put to use: Given your data above: part name location a 5-9 b 7-10 c 3-6 from interval

Re: Overlap in python

2009-08-04 Thread Gregor Lingl
Gregor Lingl schrieb: As my proposed solution shows this approach can be done with on board means of Python (namely the set type). This would be quite different though, if you had floating point boundaries of the intervals. ... or if the intgers involved were very big :-( Regards, Gregor

Re: Overlap in python

2009-08-04 Thread Bearophile
Mark Dickinson: > # create sorted list of points where an interval is entered or left > transitions = [] > for name, (start, stop) in input: >     transitions.extend([(start, 'Start', name), (stop, 'Stop', name)]) > transitions.sort() > > # scan list, accumulating blocks along the way. Oh, right,

  1   2   >