Re: How to write replace string for object which will be substituted? [regexp]

2009-08-04 Thread ryniek
On 5 Sie, 00:55, MRAB wrote: > ryniek90 wrote: > > Hi. > > I started learning regexp, and some things goes well, but most of them > > still not. > > > I've got problem with some regexp. Better post code here: > > > " > >  >>> import re > >  >>> mail = '\nn...@mail.com\nname1 [at] mail [dot] com\nn

Turtle Graphics are incompatible with gmpy

2009-08-04 Thread Mensanator
I hadn't noticed this before, but the overhaul of Turtle Graphics dating back to 2.6 has been broken as far as gmpy is concerned. I hadn't noticed because I usually have tracing turned off (tracing off takes 3-4 seconds, tracing on takes 6-7 minutes). In 3.1, tracing is now a screen attribute, no

Re: Announcing PythonTurtle

2009-08-04 Thread alex23
John Posner wrote: > OK, then why the statements "from turtle import *" in the modules > turtleprocess.py and turtlewidget.py? Looking in the source I'd say it's because there's a local turtle.py. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a bug in multiprocessing or in my script?

2009-08-04 Thread sturlamolden
On Aug 5, 4:37 am, erikcw wrote: > It's not always the same traceback, but they are always short like > this. I'm running Python 2.6.2 on Ubuntu 9.04. > > Any idea how I can debug this? In my experience, multiprocessing is fragile. Scripts tend fo fail for no obvious reason, case processes to b

The Perils of PyContract (and Generators)

2009-08-04 Thread Nick Daly
So, just in case any body else runs into this strange, strange happening, I thought I might as well document it somewhere Google can find it. Contracts for Python[0] and generators don't necessarily play well together. This mail comes in three parts, first, the example code that didn't work at al

Re: M2Crypto: How to generate subjectKeyIdentifier / authorityKeyIdentifier

2009-08-04 Thread Heikki Toivonen
Matthias Güntert wrote: > I am trying to add the extensions "subjectKeyIdentifier" and > "authorityKeyIdentifier" to a x509v3 certificate. M2Crypto has a couple of bugs open related that, with potential workarounds that I haven't yet deemed polished enough to checkin, but which might help you out

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

2009-08-04 Thread Ido Levy
Hi Tycho, Thank you for your advice. My problem was in the query itself, I replaced every space character with '%20' and it works. You are right, the Python code below does do the work. Ido From: Tycho Andersen To: python-list@python.org Date: 04/08/2009 04:42 PM Subject: Re: How to fetch a

Re: Is python buffer overflow proof?

2009-08-04 Thread sturlamolden
On Aug 4, 2:27 pm, Tim Chase wrote: > You *can* shoot yourself in the foot with Python, you just have > to aim much more carefully than you do with C/C++. You can e.g. define a class with a __del__ method and make some circular references. That should give you a nice memory leak. -- http://mai

Re: no-clobber dicts?

2009-08-04 Thread Steven D'Aprano
On Wed, 5 Aug 2009 06:01 am kj wrote: > 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 test

Re: My first wxPython App with Twisted - barebones version

2009-08-04 Thread koranthala
On Aug 5, 6:41 am, koranthala wrote: > Hi, >    I am creating the first GUI app (wxPython based) using Twisted. >    I am facing an issue which I cannot seem to solve/understand due > to lack of trace or anything. >    I had a big app written on twisted and now I am creating a login > screen to th

Re: os.walk()

2009-08-04 Thread Chris Rebert
On Tue, Aug 4, 2009 at 7:06 PM, Michael Savarese wrote: > Greetings > Python newbie here, and thanks to all who have helped me previously. > Is there a way of grabbing file attributes while traversing with os.walk()? > It would be advantageous to have date modified and file size along with the > fi

Is this a bug in multiprocessing or in my script?

2009-08-04 Thread erikcw
Hi, I'm trying to get multiprocessing to working consistently with my script. I keep getting random tracebacks with no helpful information. Sometimes it works, sometimes it doesn't. Traceback (most recent call last): File "scraper.py", line 144, in print pool.map(scrape, range(10)) Fil

os.walk()

2009-08-04 Thread Michael Savarese
Greetings Python newbie here, and thanks to all who have helped me previously. Is there a way of grabbing file attributes while traversing with os.walk()? It would be advantageous to have date modified and file size along with the file name. If anyone can point me in the right direction, I'd apprec

My first wxPython App with Twisted - barebones version

2009-08-04 Thread koranthala
Hi, I am creating the first GUI app (wxPython based) using Twisted. I am facing an issue which I cannot seem to solve/understand due to lack of trace or anything. I had a big app written on twisted and now I am creating a login screen to the app. The app used to work without any issues.

Re: My first wxPython App with Twisted

2009-08-04 Thread koranthala
On Aug 5, 6:29 am, koranthala wrote: > Hi, >    I am creating the first GUI app (wxPython based) using Twisted. >    I am facing an issue which I cannot seem to solve/understand due > to lack of trace or anything. > >    I had a big app written on twisted and now I am creating a login > screen to

My first wxPython App with Twisted

2009-08-04 Thread koranthala
Hi, I am creating the first GUI app (wxPython based) using Twisted. I am facing an issue which I cannot seem to solve/understand due to lack of trace or anything. I had a big app written on twisted and now I am creating a login screen to the app. The app used to work without any issues

[ANNC] pybotwar-0.4

2009-08-04 Thread Lee Harr
pybotwar is a fun and educational game where players create computer programs to control simulated robots to compete in a battle arena. http://pybotwar.googlecode.com/ pybotwar uses pybox2d for the physical simulation, and uses pygame and pygsear for the visualization. pybotwar is released und

Re: New implementation of re module

2009-08-04 Thread Alex Willmer
n Windows if you want to try it out. Firstly Matthew, thank you for all your work on this. It brings some very nice regex features to Python. I've used Christopher Arndt's post as a basis and created a package from you latest upload (issue2636-20090804.zip), which builds for Python 2.5 and

Re: Online payment module

2009-08-04 Thread Sam Tregar
On Tue, Aug 4, 2009 at 4:25 PM, Kushal Kumaran < kushal.kumaran+pyt...@gmail.com > wrote: > > Not really familiar with this area, but have you seen these? > > http://code.google.com/p/pypaypal/ > http://www.geteasyshop.com/front-page > Thanks, but neither of these are remotely what I'm looking fo

Re: How to write replace string for object which will be substituted? [regexp]

2009-08-04 Thread MRAB
ryniek90 wrote: Hi. I started learning regexp, and some things goes well, but most of them still not. I've got problem with some regexp. Better post code here: " >>> import re >>> mail = '\nn...@mail.com\nname1 [at] mail [dot] com\nname2 [$at$] mail [$dot$] com\n' >>> mail '\nn...@mail.c

Re: Overlap in python

2009-08-04 Thread Mensanator
On Aug 4, 2:57 pm, Gregor Lingl wrote: > 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

How to write replace string for object which will be substituted? [regexp]

2009-08-04 Thread ryniek90
Hi. I started learning regexp, and some things goes well, but most of them still not. I've got problem with some regexp. Better post code here: " >>> import re >>> mail = '\nn...@mail.com\nname1 [at] mail [dot] com\nname2 [$at$] mail [$dot$] com\n' >>> mail '\nn...@mail.com\nname1 [at] mail

Re: Overlap in python

2009-08-04 Thread Bearophile
kj: >     # connect the nodes >     for i in range(len(parts) - 1): >         part_i = parts[i] >         for j in range(i + 1, len(parts)): Note that's O(N^2), see the O(sort) standard solution by Mark Dickinson. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Overlap in python

2009-08-04 Thread kj
In <78d86d92-d373-4163-a418-600a3eb36...@o15g2000yqm.googlegroups.com> Mark Dickinson writes: >On Aug 4, 7:15=A0pm, 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- >> ove

Re: Overlap in python

2009-08-04 Thread MRAB
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

Re: Overlap in python

2009-08-04 Thread kj
In Jay Bird writes: >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-

Re: Using Python to automate builds

2009-08-04 Thread Philip Semanchuk
On Aug 4, 2009, at 5:40 PM, Kosta wrote: On Aug 4, 2:34 pm, Dave Angel wrote: + I have released pyKook 0.0.2. +http://pypi.python.org/pypi/Kook/0.0.2 +http://www.kuwata-lab.com/kook/ +http://www.kuwata-lab.com/kook/pykook-users-guide.html Other possibilities: + http://pypi.python.org/pypi/

Re: Problem in installing PyGreSQL

2009-08-04 Thread Дамјан Георгиевски
>> > 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. That's why he could >> compile it himself but not use

Re: Using Python to automate builds

2009-08-04 Thread Kosta
On Aug 4, 2:34 pm, Dave Angel wrote: > Kosta wrote: > > 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, i

Re: Using Python to automate builds

2009-08-04 Thread Dave Angel
Kosta wrote: 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. Thi

Re: Overlap in python

2009-08-04 Thread Mark Dickinson
On Aug 4, 9:03 pm, Mark Dickinson wrote: > for i, (pt, startend, name) in enumerate(transitions): Whoops. That line should just be: for pt, startend, name in transitions: The enumerate was accidentally left-over from a more complicated version. -- Mark -- http://mail.python.org/mailman/lis

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,

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 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 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

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: 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

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: 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 >

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: 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: 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: 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: 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

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: 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

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: 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 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 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: 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 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: 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

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

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

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

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 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

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 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

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 >

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: 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

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: 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

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

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: 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

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: 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: 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: 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: 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: 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 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: 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 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: 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: 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 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 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: 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: 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: 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: 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: 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: 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: 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 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: 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

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: 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

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: 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: 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: 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: 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: 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

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

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

  1   2   >