Re: Python's Performance

2005-10-10 Thread Steve Holden
7;'' > > I've seen at least the first two debated endlessly here. > > -Peter And we definitely need "agile" in there. Bugger, I'll go out and come in again ... regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python name lookups

2005-10-10 Thread Steve Holden
u have determined what you are really asking. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, COM Servers, and Multi-Threading

2005-10-10 Thread Steve Holden
terpreter. You also need to be aware that if you trigger this stuff with IIS then the web server itself performs thread pooling and (I believe) allocates only one process per "application", so this may defeat your desire to use all four processors concurrently. rega

Re: strange import error with Python-2.4.1

2005-10-11 Thread Steve Holden
xlrd's attempted psyco use > shouldn't be an issue. Thanks for 2.4.2, but is this one of the fixed bugs or > has it just got harder to induce? Robin: Can I ask if you are specifying a source encoding in your file with a pragma (?) like # -*- coding: iso-8859-15 -*- I've notic

Re: strange import error with Python-2.4.1

2005-10-11 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote: > > >>Can I ask if you are specifying a source encoding in your file with a >>pragma (?) like >> >># -*- coding: iso-8859-15 -*- >> >>I've noticed what appear to be spurious syntax errors from time to

Re: Can module access global from __main__?

2005-10-11 Thread Steve Holden
ule that you have run) then you should be able to access it as __main__.X, but you'd be *very naughty* to do so :-) -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Can module access global from __main__?

2005-10-11 Thread Steve Holden
t import. Even then (on the first import) I am not sure how you could introspect to find the answer you want. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionnaries and lookup tables

2005-10-11 Thread Steve Holden
> > dictcomp(1000) > #end of listing > > I get 1000 True's on the output, which suggests that key-wise ordering > is implemented in some guise. The question is: how do I access that? > You don't. There is no ordering of the keys, so there is no way that you can

Re: A problem while using urllib

2005-10-12 Thread Steve Holden
x27;m using 2.4.1 on cygwin of WinXP. > If you want to reproduce the problem, I can send the source to you. > > This morning I found that this is caused by urllib2. When I use urllib > instead of urllib2, it won't crash any more. But the matters is that I > want to catch the

Re: can we save print msg into a file when script running ?

2005-10-12 Thread Steve Holden
.txt which will show you the last part of the file and further additions as long as you let the tail command run. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/

Re: Adding a __filename__ predefined attribute to 2.5?

2005-10-12 Thread Steve Holden
system. Here's a clue as to how you might do without __file__ altogether: [EMAIL PROTECTED] ~/Projects/Python $ cat test78.py import sys print sys.argv [EMAIL PROTECTED] ~/Projects/Python $ python test78.py can we say live with it? ['test78.py', 'can', 'we', 's

Re: A problem while using urllib

2005-10-12 Thread Steve Holden
Johnny Lee wrote: > Steve Holden wrote: > >>Johnny Lee wrote: >> >>>Alex Martelli wrote: >>> >>> >>>>Johnny Lee <[EMAIL PROTECTED]> wrote: >>>> ... >>>> >>>> >>>>> try: >

Re: A problem while using urllib

2005-10-12 Thread Steve Holden
Steve Holden wrote: > Johnny Lee wrote: > [...] > >>I've sent the source, thanks for your help. >> > > [...] > Preliminary result, in case this rings bells with people who use urllib2 > quite a lot. I modified the error case to report the actual message

Re: A problem while using urllib

2005-10-12 Thread Steve Holden
Johnny Lee wrote: > Steve Holden wrote: > >>Steve Holden wrote: >> >>>Johnny Lee wrote: [...] >> >>So my conclusion is that there's something in the Cygwin socket module >>that causes problems not seen under other platforms. >> >>

Re: A Tree class, my $0.02 contribution to the python community.

2005-10-12 Thread Steve Holden
t;cdict" might be a better name ... regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: can we save print msg into a file when script running ?

2005-10-12 Thread Steve Holden
Probably a syntax error on Windows ... regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Threads and socket.setdefaulttimeout

2005-10-12 Thread Steve Holden
ht: (10061, 'Connection refused') > #Exception caught: timed out > Here (unless I'm missing something obvious) it seems that your worker thread terminates immediately after setting the default timeout, and both of the proxy calls are made from the main thread, so I'm not particularly surprised at the results, given the global nature of the default socket timeout. Maybe someone else can think of something that will help. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a __filename__ predefined attribute to 2.5?

2005-10-13 Thread Steve Holden
Rune Strand wrote: > Ok, Alex. I know a good explanation when I see one. Thanks! > Make that "...when someone beats me over the head with it" ;-) Glad you have the explanation you needed, anyway. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 311

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Steve Holden
age" program, this will involve trade-offs which can only be fully appreciated in the light of practical experience. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: installer for amd64 build of python?

2005-10-13 Thread Steve Holden
http://www.vrplumber.com/programming/mstoolkit/ to install the MS Toolkit, but I haven't tried compiling 64-bit code myself, not having any 64-bit hardware. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.co

Re: A problem while using urllib

2005-10-13 Thread Steve Holden
John J. Lee wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > [...] > >> File "/usr/lib/python2.4/urllib2.py", line 996, in do_open >> raise URLError(err) >>urllib2.URLError: >> >>Looking at that part of the course of urrlli

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Steve Holden
nvolved in endless. Sorry for the ad hominem remarks, which I normally try and avoid, but this (ab)uses newsgroup bandwidth unnecessarily. Unwillingness to admit any mistake can be rather unattractive. Can't you, just once, say "I was wrong"? Or are you perchance related to President Bush? B

Re: FORM data in cgi

2005-10-13 Thread Steve Holden
Mike Meyer wrote: > "jponiato" <[EMAIL PROTECTED]> writes: > > >>Greetings. >>An HTML form submits it's data to a python cgi script on my server. This >>script accepts this POST data, and uses urllib.urlopen() to call a different >>cgi script (on an external server), passing this same data. I'm

Re: wxPython & Cygwin

2005-10-13 Thread Steve Holden
an extension module. > But maybe you _can_ compile it yourself - I didn't try, though. > > Diez Probably a daunting task. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006

Re: Hidden string formatting bug

2005-10-13 Thread Steve Holden
> errors (for example, your original mistake would have been impossible > to make this way). Use parens instead of backslashes. Don't use "+" > to catenate string literals: the Python compiler automatically > catenates adjacent string literals for you, and at compile-time (

Re: UI toolkits for Python

2005-10-14 Thread Steve Holden
er is a modestly-priced commercial product that represents very good value for money). While wxDesigner doesn't do everything you might want it seems to be better than anything else I've come across for building resizable dialogues and panels, which are readily used as components in ot

Re: Help with creating a dict from list and range

2005-10-14 Thread Steve Holden
iption = ["first", "second", "third"] >>> for x in enumerate(description): ... print x ... (0, 'first') (1, 'second') (2, 'third') >>> dct = dict((x[1], x[0]) for x in enumerate(description)) >&

Re: UI toolkits for Python

2005-10-16 Thread Steve Holden
ch graphical interface, it can be quite difficult to manage state maintenance between the two components (web server, web client) in the system. A "proper" GUI runs all functionality inside a single process, and allows much easier control over complex interactions, creation of dynamic

Re: Good news and bad news!!

2005-10-16 Thread Steve Holden
.org./Jobs.html. Read the HOWTO link there for more details. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with creating a dict from list and range

2005-10-16 Thread Steve Holden
George Sakkis wrote: > "James Stroud" <[EMAIL PROTECTED]> wrote: >>Could be even simpler since enumerate creates tuples anyway: >> >>dct = dict(x for x in enumerate(description)) >> >>James >> >>On Friday 14 October 2005 08:37, St

Re: wxPython & Cygwin

2005-10-16 Thread Steve Holden
using MinGW, and cygwin. So I think it should be doable. > I'm sure the Cygwin world would be grateful if you or someone else were to establish the correct build procedure. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: UI toolkits for Python

2005-10-17 Thread Steve Holden
Claudio Grondi wrote: > "Steve Holden" <[EMAIL PROTECTED]> schrieb im Newsbeitrag [...] [Claudio] >>>I don't fully understand your attitude here. The Web Browser interface > > has > >>>all I can imagine is required for a GUI, so what is missing

Re: Stripping ASCII codes when parsing

2005-10-17 Thread Steve Holden
function useful: control characters all have ord(c) < 32. You can also use the chr() function to return a character whose ord() is a specific value, and you can use hex escapes to include arbitrary control characters in string literals: myString = "\x00\x01\x02" regards Ste

Re: How to get a raised exception from other thread

2005-10-17 Thread Steve Holden
ork". Asynchronous signalling between threads is an accident waiting to happen in the hands of an inexperienced programmer. > As far as I know, pyrex and ctypes weren't intended to get > at the Python/C api. But they didn't create extra hurdles > for those who could use it that way. > This seems like a complete non sequitur to me. Let's stick to the point. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Stripping ASCII codes when parsing

2005-10-17 Thread Steve Holden
re the nultxfrm[n] == chr(n) - this performs no translation at all. So then s = s.translate(nultxfrm, delchars) will remove all the "illegal" characters from s. Note that I am sort-of cheating here, as this is only going to work for 8-bit characters. Once Unicode enters

Re: Installing Python at Work

2005-10-17 Thread Steve Holden
) I'm sure *you* know what you mean, it's just a matter of finding out how to help *us* understand. What sort of conflicts are you concerned about? Basically Python isn't going to do anything horrible unless you ask it to, or start running programs you don't understand (which is

Re: List of strings to list of floats ?

2005-10-17 Thread Steve Holden
you don't want to tell us what it was? It's more helpful if you actually copied and pasted the exact error traceback you see, as this avoids any potential answerer having to guess what went wrong. A brief description of what you were trying to do is also helpful

Re: gprof results

2005-10-17 Thread Steve Holden
tion about the performance of the python interpreter itself, somewhat unrelated to the Python program it's running. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/

Re: Upgrading 2.4.1 to 2.4.2

2005-10-17 Thread Steve Holden
ldn't hurt to do a backup first in case I'm wrong ;-). regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: bug in os.system?

2005-10-18 Thread Steve Holden
[EMAIL PROTECTED] wrote: > What happens when you try it without the single quotes? > result = os.system("pythonbugtest.exe" "test") > That would be equivalent to result = os.system("pythonbugtest.exetest") which almost certainly won't do anythi

Re: A little help with time calculations

2005-10-18 Thread Steve Holden
;-): def timetosecs(s): hms = s.split(":") # [hh, mm, ss] secs = 0 for t in hms: secs = secs * 60 + int(t) return secs def secstotime(secs): hms = [] while secs: hms.append(str(secs % 60)) secs = secs // 60 return ":".joi

Re: A little help with time calculations

2005-10-19 Thread Steve Holden
CEfastslow = Tsecs - Esecs if CEfastslow == "slow": CEfastslow = Tsecs + Esecs print "New time:", secstotime(CEfastslow) Hope this gets you a bit closer to a solution. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: how to return correct value of update stmt

2005-10-19 Thread Steve Holden
anks > Is the table actually being updated? The definition of the cursor.execute() method in http://www.python.org/peps/pep-0249.html specifically says "Return values are not defined". So if you are seeing the database do the right thing I'd stop worrying about the return value

Re: UI toolkits for Python

2005-10-19 Thread Steve Holden
f diminishing returns which rarely justifies supporting those final additional hold-outs with obsolete platforms. This is as much an economic decision as a marketing one, but a good engineer knows instinctively that there is a desirable cut-off point beyond which adding further functionality is a waste of engineering effort. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: UI toolkits for Python

2005-10-19 Thread Steve Holden
Claudio Grondi wrote: > "Steve Holden" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > news:[EMAIL PROTECTED] > >>Claudio Grondi wrote: [...] >>>>>Do I miss here something? >>>>> >>>> >>>>While you are correct

Re: Threads and socket.setdefaulttimeout

2005-10-19 Thread Steve Holden
onable so I'll drop the question. > Well, I'm about out of ideas, but c.l.py is a very inventive group, so maybe someone else will be able to contribute a bright thought. Anyone? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden

Re: sqlstring -- a library to build a SELECT statement

2005-10-20 Thread Steve Holden
and look for the value, rather than > calling a private method like some other builtins do.) > >>> class inplus(object): ... def __contains__(self, thing): ... print "Do I have a", thing, "?" ... return True ... >>> x = inplus() >>> &q

Re: Some more odd behaviour from the Regexp library

2005-10-20 Thread Steve Holden
evention of Abuse of Regular Expressions? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I call a subclass method from parent class ?

2005-10-20 Thread Steve Holden
s called without it also calling A's method. Calls to super() are used to effectively place a linearised oredering on the superclasses to ansure that the diamond-shaped inheritance pattern is correctly handled to give the correct method resolution order. regards Steve -- Steve H

Re: Minimizing Connection reset by peer exceptions

2005-10-20 Thread Steve Holden
most). So if your service takes a while to run then it's possible that connection requests will be rejected when the queue is full, which might *possibly* result in the error you are seeing. Feel free to ignore this if you only have one client at a time. regards Steve -- Steve Holden +44

Re: Would there be support for a more general cmp/__cmp__

2005-10-20 Thread Steve Holden
ries to perform an invalid comparison (i.e. what are the exact semantics imposed when __cmp__() returns None/raises an exception)? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Would there be support for a more general cmp/__cmp__

2005-10-20 Thread Steve Holden
Antoon Pardon wrote: > Op 2005-10-20, Steve Holden schreef <[EMAIL PROTECTED]>: > >>Antoon Pardon wrote: >> >>>I was wondering how people would feel if the cmp function and >>>the __cmp__ method would be a bit more generalised. >>> >&g

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-20 Thread Steve Holden
egards Steve who quite agrees with the sentiments expressed above (it's an extension of the "consenting adults" philosophy). -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: __getattr__, __setattr__

2005-10-20 Thread Steve Holden
5, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> object.__getattribute__ Ring any bells? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Modules and Namespaces

2005-10-20 Thread Steve Holden
load.RS from rhino import SRF SRF.RSreg(RS) and everything inside SRF can refer to RS as a module global quite happily. Note that this falls over horribly if you ever want to handle several RS objects at the same time. In that case you might be better explicitly passing RS references into each

Re: classmethods, class variables and subclassing

2005-10-20 Thread Steve Holden
ted!)? You are experiencing this problem because you are using hard-wired class names. Try using (for example) self.__class__. That way, even if your method is inheroted by a subclass it will use the class of the object it finds itself a method of. No need to use classmethods. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: reload fails if module not in sys.path

2005-10-20 Thread Steve Holden
;, line 1, in ? ImportError: reload(): module trPyCard not in sys.modules >>> Apart from that, it would seem sensible not to try and use reload if you haven't used a kosher import mechanism - there are many caveats on the reload() documentation, and the mechanisms it uses aren

Re: classmethods, class variables and subclassing

2005-10-21 Thread Steve Holden
gt;>finds itself a method of. No need to use classmethods. > > > The problem is that I actually do want to call these methods on the > class itself, before I've made any instances. > I see. I think. So what you are saying is that when you call sup.printcvars() from inside a sub method you want it to see the namespace of the sub class not the sup? Since you have set all this up carefully you must have a use case, but it seems a little contorted (to me). Basically you appear to want the classes to behave statically the way that instances do dynamically? Not sure I can help you here. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: classmethods, class variables and subclassing

2005-10-21 Thread Steve Holden
Andrew Jaffe wrote: >>Andrew Jaffe wrote: [...] > > The problem is that I actually do want to call these methods on the > class itself, before I've made any instances. > Except you could use staticmethods with an explicit class argument ... regards Steve -- Steve H

Re: Set an environment variable

2005-10-21 Thread Steve Holden
:: one.py :: import os os.environ['STEVE'] = "You are the man" os.system("python two.py") print "Ran one" :: two.py :: import os print "STEVE is", os.environ['STEVE'] print "Ran two&quo

Re: do cc list from smtplib

2005-10-21 Thread Steve Holden
il(FROM, [TO]+[CC],body) >>server.quit() Assuming that TO and CC are single addresses it would be saner to use: server.sendmail(FROM, [TO, CC], body) - in other words, use a two-element list rather than creating it by concatenating two one-element lists! Note that as far as the SMT

Re: classmethods, class variables and subclassing

2005-10-21 Thread Steve Holden
Andrew Jaffe wrote: > Steve Holden wrote: > >>Andrew Jaffe wrote: >> >> >>>The problem is that I actually do want to call these methods on the >>>class itself, before I've made any instances. >>> >> >>Except you could use stati

Re: Set an environment variable

2005-10-21 Thread Steve Holden
Christian wrote: > Steve Holden wrote: > > >>:: >>one.py >>:: >>import os >>os.environ['STEVE'] = "You are the man" >>os.system("python two.py") >>print "Ran one" >>

Psycopg2 date problems: "Can't adapt"

2005-10-21 Thread Steve Holden
), tbl) osql = "INSERT INTO %s(%s) VALUES(%s)" % ( tbl, ", ".join(cols), ", ".join("%s" for c in cols)) print isql, '\n', osql icurs.execute(isql) for row in icurs.fetchall(): ocurs.execute(osql, row) Though

Re: classmethods, class variables and subclassing

2005-10-21 Thread Steve Holden
Andrew Jaffe wrote: > Steve Holden wrote: > >>Andrew Jaffe wrote: >> >>>Steve Holden wrote: >>> >>>>Andrew Jaffe wrote: >>>> >>>> >>>>>The problem is that I actually do want to call these methods on the

Re: Compile C program -> .pyc file

2005-10-21 Thread Steve Holden
Ernesto wrote: > Is there a way to compile a C program into a .pyc file that has the > same behavior as the compiled C program? > > Thanks! > Here's a start: http://codespeak.net/pipermail/pypy-dev/2003q1/000198.html regards Steve -- Steve Holden +44 150 684 7

Re: Psycopg2 date problems: "Can't adapt"

2005-10-21 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Steve Holden wrote: > >>I'm trying to copy data from an Access database to PostgreSQL, as the >>latter now appears to work well in the Windows environment. However I'm >>having trouble with date columns. >> >>The Postgre

Re: classmethods, class variables and subclassing

2005-10-21 Thread Steve Holden
Steve Holden wrote: [...] > > I think so. It's not normal adive, but it sounds like a metaclass might > be what you need here. > ^adive^advice^ spell-me-own-name-wrong-next-ly y'rs - evest -- Steve Holden +44 150 684 7255 +1 800 4

Re: Execute C code through Python

2005-10-21 Thread Steve Holden
day, what do I win? > If my experience is anything to go by it just means there won't be a weekly URL this week :-) regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: findwindow by its class name

2005-10-21 Thread Steve Holden
of win32gui. A wxPython application is not a windows handle, and I suspect you will find that the classname you seek isn't visible from inside (wx)Python. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Psycopg2 date problems: "Can't adapt"

2005-10-22 Thread Steve Holden
Gerhard Häring wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Steve Holden wrote: > >>I'm trying to copy data from an Access database to PostgreSQL, as the >>latter now appears to work well in the Windows environment. However I'm >>havin

Re: python problems with dos lineendings in python-scripts

2005-10-22 Thread Steve Holden
cripts. > > regards marco > The only time line endings will make a difference is if there's a carriage return on the shebang line. If you run the script using python script.py you should find that you get no problems at all. regards Steve -- Steve Holden +44 150

Re: IDE recommendation please

2005-10-23 Thread Steve Holden
uot;. Xcode and Eclipse don't >>seem to support Python out of the box. Suggestions for plugins for Eclipse >>would also be nice. > > > I use wingIDE and as Alex said before is the best python IDE ever... > > cheers I too am a happy Wing IDE user. The debugging fe

Re: Would there be support for a more general cmp/__cmp__

2005-10-24 Thread Steve Holden
) <= set([2]) > > False > >>>>set([2]) <= set([1]) > > False > Set orderingd are explicitly documented as being based on proper subsetting. This is an abuse of the operators to make subset tests more convenient rather than a definition of an ordering. > [...] The rest of your post does highlight one or two inconsistencies, but I don't frankly see yor proposed solutions making anything better. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: New User

2005-10-24 Thread Steve Holden
> 1: http://www.python.org/doc/faq/windows.html 2: Depends on your definition of fun, of course :-) How about a program to print the average of a set of numbers you type in? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC

Re: Redirect os.system output

2005-10-24 Thread Steve Holden
y got snagged by the command processor you just ran, which presumably is taking its input from the console just like Python is. > Ideas? > Haven't used subprocess much yet, but I will just mention that this kind of thing always looks easy in principle and turns out to be surprisingly

Re: difference after remove

2005-10-24 Thread Steve Holden
(""" or ''') it has the effect of removing the newline that would otherwise appear in the string. >>> print repr("""This string has a ... newline in it""") 'This string has a\nnewline in it' >>> print r

Re: Tricky Areas in Python

2005-10-24 Thread Steve Holden
or "license" for more information. >>> [a.upper() for a in ['two', 'point', 'two']] ['TWO', 'POINT', 'TWO'] >>> > > 3+4) I never used property - had to look it up. So i learned something > :) > re

Re: Would there be support for a more general cmp/__cmp__

2005-10-24 Thread Steve Holden
James Stroud wrote: > On Monday 24 October 2005 04:33, Steve Holden wrote: > >>Well in that case it's time to declare Principia Mathematica obsolete. >>The real numbers are a two-dimensional field, and you are proposing to >>define an ordering for it. > > >

Re: pickle

2005-10-25 Thread Steve Holden
ot;""dump( obj, file[, protocol[, bin]]) Write a pickled representation of obj to the open file object file.""" Isn't this reasopnably self-explanatory? regards Steve >[...] -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: cell and row

2005-10-25 Thread Steve Holden
.. print a ... x: one111 ['one111', 'one111', 'two', 'three', 'four'] x: two ['one111', 'one111', 'two', 'three', 'four'] x: three ['three', 'one111', 'one111', 'two', 'three', 'four'] x: four ['three', 'one111', 'one111', 'two', 'three', 'four'] >>> regards Steve > On 10/25/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > >>Shi Mu wrote: >> [about list comprehensions, explained by Fredrik] -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: more than 100 capturing groups in a regex

2005-10-25 Thread Steve Holden
am non-portable. Hope this isn't an issue. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Read/Write from/to a process

2005-10-25 Thread Steve Holden
> I can't believe no one else has done this yet..or if they have, it > hasn't been widely discussed. > > Any other suggestions? > Look at how you might do it in other languages. Then you'll realise this isn't (just) a Python problem. rega

Re: PDO and database abstraction

2005-10-25 Thread Steve Holden
I have used: positionals would be a little trickier, now I think of it). Of course you still have to be careful of SQL syntax variations and other backend differences (the usual one being "find the primary key value of the last-inserted row on this connection/cursor"). regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Top-quoting defined [was: namespace dictionaries ok?]

2005-10-25 Thread Steve Holden
> *your* doing so." > You *may* be a complete ass. But you don't *appear* to be :-) now-let's-get-back-to-the-python-ly y'rs - steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006

Re: wxListbook layout problem

2005-10-25 Thread Steve Holden
ndrea. > As a further data point I have WinXP SP2, Python 2.4.1 and wxPython 2.5.3.1 Unicode, and everything appears to work fine. So if it's a bug it's a recent one. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.hold

Re: Would there be support for a more general cmp/__cmp__

2005-10-25 Thread Steve Holden
to "in" as "this > doesn't define a mathematical ordering, the subset relationship does" when > "subset" is just "in" for sets: set S is a subset of set T if for all > elements x in S, x is also in T. Informally, subset S is in set T. > > Can somebody remind me, what is the problem Antoon is trying to solve here? > > Being Belgian, I suspect. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: textwidget.tag_bind("name", "", self.donothing) not working

2005-10-25 Thread Steve Holden
the tcl bind from inserting the > text...at least so I thought. > > This bind does work on the text widget as a whole, but on a individual > tag, it does not. > > Can anyone help me out with this? > > Thanks in advance, > Shannon > Have you tried capturing the KeyRe

Re: Setting Class Attributes

2005-10-25 Thread Steve Holden
C), as it > makes coding and debugging much faster and easier. > Yup, it's a great languae, and it seems to be increasing in popularity quite rapidly. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: p2exe using wine/cxoffice

2005-10-26 Thread Steve Holden
cently. The major pain with coLinux is that most of the developers are Linux types, so reliable information about integration into the Windows environment can be hard to come by. But I'm getting there ... regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: how do i run another script from my python script

2005-10-27 Thread Steve Holden
o need the script to wait untill the php4 script is done > (which i think is the default ) before continuing to run. > > i know this is possible, but how? > thanks > import os if x = 4: script = "testin.php" else: script = "testout.php" os.system(scrip

Re: syntax question - if 1:print 'a';else:print 'b'

2005-10-27 Thread Steve Holden
gt; > something_ignore_exceptions(1) > something_ignore_exceptions(2) > # etc... Then the obvious extension: for i in range(20): ... but I get the idea that Gregory was thinking of different statements rather than calls to the same function with different arguments. regards Steve -- Steve Holden

Re: How to replace all None values with the string "Null" in a dictionary

2005-10-27 Thread Steve Holden
m2': 'Null'} > for k in a: if a[k] is None: a[k] = 'Null' You aren't doing this to create SQL statements, are you? If so, parameterized queries are the way to go ... regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Hold

Distutils patch for MS toolkit use

2005-10-27 Thread Steve Holden
I've just realised that my 2.4.1 upgrade removed the patch I made to distutils to use the Microsoft free toolchain. unfortunately www.vrplumber.com appears to be down. Does anyone reading this have the details? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holde

Re: Distutils patch for MS toolkit use

2005-10-27 Thread Steve Holden
Steve Holden wrote: > I've just realised that my 2.4.1 upgrade removed the patch I made to > distutils to use the Microsoft free toolchain. > > unfortunately www.vrplumber.com appears to be down. Does anyone reading > this have the details? > Never mind - turns out the

Re: tkinter blues (greens, reds, ...)

2005-10-28 Thread Steve Holden
code has a bug" is enough to help one find out what the problem really is. If you have a soft toy I'd recommend you sit it down somewhere and explain to it in great detail exactly why it can't be a bug in your program. You may find you discover the error with no further assistance

Re: Newbie question: string replace

2005-10-28 Thread Steve Holden
ext) file gives you lines with a line ending. Print adds a line ending as well. Instead use import sys ... ... ... sys.stdout.write(l) You will find you lose the blank lines. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I sort these?

2005-10-28 Thread Steve Holden
27;, 'five', 'seven', 'nine', 'two', 'four', 'six', 'eight'] >>> both = zip(first, second) >>> both.sort() >>> [b[0] for b in both] [1, 2, 3, 4, 5, 6, 7, 8, 9] >>> [b[1] for b in both] [&#

Re: Automatic binding of **kwargs to variables

2005-10-29 Thread Steve Holden
's a lot of work to specify "a very long list", and the list will also need maintaining. I must, however, agree with Mike's advice: it's unwise to try and pollute a function's namespace with arbitrary variables. Some kind of bunch-like object would seem to be the mos

Re: Automatic binding of **kwargs to variables

2005-10-29 Thread Steve Holden
Peter Otten wrote: > Steve Holden wrote: > > >>>Why don't you just change the method signature to foo(self, x, y, z, >>>whatever, **kwargs)? > > >>Probably because values are then required for those arguments. Plus it's >>a lot of work to

<    1   2   3   4   5   6   7   8   9   10   >