PDB scope problem

2007-10-22 Thread Dale Strickland-Clark
ver, the Python interpreter is happy with it if entered directly: >>> lstValues [[Decimal("1"), Decimal("47.0")]] >>> agg = [0,1] >>> print list([sum(v[i] for i in range(len(agg))) for v in lstValues]) [Decimal("48.0")] >>&

Re: MIMEText breaking the rules?

2007-08-05 Thread Dale Strickland-Clark
Tim Roberts wrote: > Dale Strickland-Clark <[EMAIL PROTECTED]> wrote: >> >>The email module's mimetext handling isn't what you might expect from >>something that appears to behave like a dictionary. >>... >>Having apparently REPLACED my rec

MIMEText breaking the rules?

2007-08-01 Thread Dale Strickland-Clark
gt; print msg.as_string() Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] A message >>> Having apparently REPLACED my recipient, what I've ended up with is both of them. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: list of range of floats

2007-02-14 Thread Dale Strickland-Clark
Steve wrote: > I'm trying to create a list range of floats and running into problems. > I've been trying something like: > > a = 0.0 > b = 10.0 > > flts = range(a, b) > > fltlst.append(flts) > > When I run it I get the following DeprecationWarning: integer argument > expected, got float. How c

Re: What's going on here?

2006-11-23 Thread Dale Strickland-Clark
Thanks for the answers. I am informed but I don't feel enlightened. It does strike me as odd that an apparently empty subclass should add extra function to the base class. Not at all obvious. -- Dale Strickland-Clark We are recruiting Python programmers. Please see the web site. Rive

What's going on here?

2006-11-22 Thread Dale Strickland-Clark
e "", line 1, in ? AttributeError: 'object' object has no attribute 'spam' >>> class b(object): ...pass ... >>> a = b() >>> a <__main__.b object at 0xb7b4dcac> >>> a.spam = 1 >>> What is subclassing adding to th

Re: Providing full interaction with the run time

2006-11-01 Thread Dale Strickland-Clark
Thanks for the info. I didn't know about that module. I'll take a look. Fredrik Lundh wrote: > Dale Strickland-Clark wrote: > >> We have a system we're developing which runs as a server. It has an >> xml-rpc interface which I've extended to provide some deb

Re: Hooking file open

2006-11-01 Thread Dale Strickland-Clark
this? I > realize that some dependencies will still fall through my checks, > especially file opens from C extensions, which is fine. I just want to > be able to detect the most common use cases. Any other suggestions are > appreciated. > > -Farshid -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Providing full interaction with the run time

2006-10-29 Thread Dale Strickland-Clark
t this throws away expression results so that's no help. At the moment, I'm making a crude attempt to distinguish between statements and expressions but it's easily fooled. So the question is: how does my debug interface (which operates over RPC) decide which type of COMPILE it wants? Or am I going about this all wrong? (I don't need warnings about the obvious security implications of this interface.) Thanks -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's CRT licensing on Windows

2006-10-25 Thread Dale Strickland-Clark
To paraphrase an applicant for a job vacancy we're currently filling when asked to give an example of their problem solving skills: A client had a problem with Windows XP on his laptop. I reformatted his hard disk and installed Red Hat. Problem solved. -- Dale Strickland-Clark Riverhall Sy

We're recruiting Python programmers

2006-10-17 Thread Dale Strickland-Clark
I'll keep this brief. Please see the web site for details Thanks. -- Dale Strickland-Clark We are recruiting Python programmers. Please see the web site. Riverhall Systems www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread Dale Strickland-Clark
Tim N. van der Leeuw wrote: > > Hi, > > select lastval(); > Thanks, that was useful. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread Dale Strickland-Clark
Hi Harald Thanks for that, somewhat comprehensive, answer. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

PostgreSQL, psycopg2 and OID-less tables

2006-09-15 Thread Dale Strickland-Clark
is out? Thanks. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Delete items in nested dictionary based on value.

2006-09-13 Thread Dale Strickland-Clark
ackets didn't match and I'm not sure where the extra close should be. Also, I suspect you're wanting to delete empty dictionaries but I don't see that mentioned in the text. If that is so, include the two commented statements. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Inter process signalling

2006-09-13 Thread Dale Strickland-Clark
Duncan Booth wrote: > Dale Strickland-Clark <[EMAIL PROTECTED]> wrote: > >> In Linux this is easy with 'signal' and 'kill' but how can I get one >> Python process to signal another (possibly running as a service)? >> >> All I need is a sim

Re: Inter process signalling

2006-09-13 Thread Dale Strickland-Clark
etEvent() > WaitForSingleObject() or WaitForMultipleObjects() Thanks. We'll look into those. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Inter process signalling

2006-09-12 Thread Dale Strickland-Clark
Dale Strickland-Clark wrote: > In Linux this is easy with 'signal' and 'kill' but how can I get one > Python process to signal another (possibly running as a service)? > > All I need is a simple prod with no other data being sent and none being > returned - e

Inter process signalling

2006-09-12 Thread Dale Strickland-Clark
l should generate an interrupt. I'm not looking for a solution the involves polling. Thanks -- Dale Strickland-Clark Riverhall Systems www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Design Patterns in Python

2006-08-04 Thread Dale Strickland-Clark
t; Something like this? http://tinyurl.com/q7uyt (www.amazon.co.uk) -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: write()

2006-07-27 Thread Dale Strickland-Clark
manuhack wrote: > Then is there any way to create a directory under XP using Python? import os os.mkdir("C:\\myosisbroken") -- Dale Strickland-Clark Riverhall Systems www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: XML/HTML Encoding problem

2006-05-23 Thread Dale Strickland-Clark
pes, I think you should be alright > (unless I've missed something): > You lose the encoding at the top of the output, but since the output is > entirely ascii I don't think that matters. -- Dale Strickland-Clark Riverhall Systems www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Win32: Detecting when system is locked or sleeping

2006-05-22 Thread Dale Strickland-Clark
e lock. As in ctrl-alt-del -> [Lock Computer] Not the blue-screen, hung, rogered type of lock which is not voluntary and rather more frequent. -- Dale Strickland-Clark Riverhall Systems www.riverhall.co.uk We're recruiting. See the web site for details. -- http://mail.python.org/mailman/listinfo/python-list

XML/HTML Encoding problem

2006-05-22 Thread Dale Strickland-Clark
ity references?  Or is there a convenient post processing function that will do the conversion? -- Dale Strickland-Clark Riverhall Systems www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Python editor recommendation.

2006-05-09 Thread Dale Strickland-Clark
Vim. Everything else is Notepad. DeepBlue wrote: > Hi all, > > Can any one please recommend me an editor for coding Python. Thank u. > I have Komodo (www.activestate.com) in my mind. Is the editor any good? > > regards. -- Dale Strickland-Clark Riverhall Systems www.riv

Re: Why 3.0/5.0 = 0.59999...

2006-05-09 Thread Dale Strickland-Clark
.0/5.0, the result is 0.5... > > Is there some precision loss? And how to overcome it? > > Any suggestions will be appreciated! > Best regards, > Davy -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Enumerating Regular Expressions

2006-05-09 Thread Dale Strickland-Clark
anybody know of a module that allows you to enumerate all the > strings a particular regular expression describes? > > Cheers, > -Blair -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Import data from Excel

2006-05-09 Thread Dale Strickland-Clark
rom sheet 1 of the spreadsheet return GetObject(strFilePath).Sheets(1).UsedRange.Value N/A wrote: > Hi, > Is it possible to import data from Excel for doing numerical analysis in > Python? If so how? Thank u! -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk --

Re: scanning for numerals / letters

2006-04-18 Thread Dale Strickland-Clark
numbers". I am not sure how to alter my current if > statement to do that check so any assistance would be appreciated. > > > On the flip side, I also have a field called 'purchases' where the user > must enter non-numerals, thus i would also like to know how

Re: extracting a substring

2006-04-18 Thread Dale Strickland-Clark
ould use regular expressions, but I'm not familar with > python, so any quick help would help, such as which commands or idioms > to use. Thanks a lot! -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: sending ctrl C to a program

2006-03-29 Thread Dale Strickland-Clark
Ctrl-C to this > program to terminate it in python? > thanks Isn't SIGINT the same as ctrl-c? So something like import os os.kill(1234, 2) would send ctrl-c to process 1234. If you just want the process to quit, you could probably just send it a SIGTERM, which is signal 15. -- Dale

Re: Python Evangelism

2006-03-09 Thread Dale Strickland-Clark
Steve Holden wrote: > Any suggestions for improvement? > > regards > Steve Get rid of the scarey face? :-) -- Dale Strickland-Clark Riverhall Systems www.riverhall.co.uk We're recruiting. See the web site for details. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Evangelism

2006-03-09 Thread Dale Strickland-Clark
rtilley wrote: > Psychology is important. Just as important as good design. I think this > fact doesn't sink in to the Python community. You speak of fluff and ribbons and glitter. I think most people here are less concerned with psychology and more interested in pychology. -- Dale

Re: beta.python.org content

2006-01-27 Thread Dale Strickland-Clark
he well known Anguine Kama Sutra. The new site, however is very nice. Top marks for that. -- Dale Strickland-Clark Riverhall Systems www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Are there anybody using python as the script engine for ASP?

2006-01-08 Thread Dale Strickland-Clark
they either worked around or that went away after an upgrade. I'm not sure. But we're running live web sites with it right now, as far as I know. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the extension of a filename from the path

2005-12-08 Thread Dale Strickland-Clark
ike that to work on Linux also > Thank you for help > L. Like this, you mean? >>> import os.path >>> os.path.splitext("c:\\pictures\\mydocs\\test.txt") ('c:\\pictures\\mydocs\\test', '.txt') -- Dale Strickland-Clark Riverhall Systems www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem printing in Win98

2005-11-21 Thread Dale Strickland-Clark
ript file that should be sent to a postscript printer without further modification? In this case, I think you should use copy instead of print. Something like this: win32api.ShellExecute(0, "copy", "file.ps prn", None, ".", 0) It has been a long time since I

Re: creating/altering the OpenOffice spredsheet docs

2005-10-27 Thread Dale Strickland-Clark
Andy Leszczynski wrote: > Any idea how to do that the way ActiveX would be used on M$? > > A. http://udk.openoffice.org/python/python-bridge.html -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Config parser module

2005-09-23 Thread Dale Strickland-Clark
e config parser module insome way for this. I also > have few perl parser (for some part for some particular tasks) and now > changing them to python. (I feel perl regex combination is very easy to > learn and very powerfull) > > Any information will be appreciated. > > -jiro

Re: Validating XML parsers

2005-09-20 Thread Dale Strickland-Clark
Robert Kern wrote: > Dale Strickland-Clark wrote: >> A few days ago there was a discussion about which XML parser to use with >> Python. >> However, the discussion didn't cover validating parsers, at least, not >> w3.org XML Schemas. >> >> I loo

Validating XML parsers

2005-09-19 Thread Dale Strickland-Clark
are a few DTD validating parsers but that's all. I'm not concerned about speed so much as a reasonably sound implementation. What's out there? Have I missed something? Thanks. -- Dale Strickland-Clark Riverhall Systems - www.riverhall.co.uk -- http://mail.python.org/mailman/listinfo/python-list