Re: Scanning a file

2005-10-29 Thread Steve Holden
'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'] > > > Ouch. Seems like I spotted the subtle cornercase error and missed the big > one. > No, you just realised subconsciously that we&#x

Re: Scanning a file

2005-10-29 Thread Steve Holden
le at once (as you only need one byte at a time). > Indeed, but reading one byte at a time is about the slowest way to process a file, in Python or any other language, because it fails to amortize the overhead cost of function calls over many characters. Buffering wasn't invented because

Re: learning emacs lisp

2005-10-30 Thread Steve Holden
>>you decide to write something. There are a lot of features available >>and, although daunting, I think the reference is the best resource >>for discovering them. >> >>This group has also been indispensable to me. > > -- 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: Pickling and unpickling inherited attributes

2005-10-30 Thread Steve Holden
being unreadable by another. Secondly, it's usual to have the subclass explicitly call the superclass to initialize that portion of the instance. So it would be more typically Pythonic to write class Child(Parent): def __init__(self, c): Parent.__init__(self, a, b) self.C = c This allows you to pass the a and b values into the creator call in the following way: obj = Child(2, 3, 1) rather than explicitly setting attributes of the Child instance in line. If your inheritance patterns are complex you may find it useful to investigate the super() function. 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: Scanning a file

2005-10-31 Thread Steve Holden
ram? Would this be a security problem? It would indeed be a security problem, and there are enough of those already without adding more. 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: Arguments for button command via Tkinter?

2005-10-31 Thread Steve Holden
you'd do in wxPython like: wx.EVT_BUTTON(parent, but1, but2.onClick) but similar considerations apply to Tkinter, and you appear to have the wit to be able to extend the argument to that toolkit. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC

Re: Arguments for button command via Tkinter?

2005-10-31 Thread Steve Holden
inter and in turn calls your > callback with the proper arguments. > I don't see why this is preferable to having the callback as a bound method of the button instances. What's the advantage here? It looks opaque and clunky to me ... regards Steve -- Steve Holden +

Re: Asyncore Loop Question

2005-10-31 Thread Steve Holden
sking for a write > Asking for a write > Asking for a write > > ... > ... > > Normally if a socket channel asks for a write and you have no data you should respond by removing it from the list of write-enabled channels for the asyncore loop until you *do* have some da

Re: Scanning a file

2005-10-31 Thread Steve Holden
Paul Watson wrote: > Steve Holden wrote: > >>>Since everyone needs this, how about building it in such that files >>>which are closed by the runtime, and not user code, are reported or >>>queryable? Perhaps a command line switch to either invoke or su

Re: Asyncore Loop Question

2005-10-31 Thread Steve Holden
John W wrote: > On 10/31/05, Steve Holden <[EMAIL PROTECTED]> wrote: > >>John W wrote: >> >>>Hello, >>> >>>I have a gui application where I am trying to use the asyncore module to >>>gather data from other computers. I am able to con

Re: looking for a good python module for MS SQL server

2005-10-31 Thread Steve Holden
Though it does have problems with stored procedures. 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: Does Asyncore Send require newline?

2005-10-31 Thread Steve Holden
ftware. You'd probably have to post a bit more code before we could say why you are seeing what you are seeing. 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: looking for a good python module for MS SQL server

2005-11-01 Thread Steve Holden
Jarek Zgoda wrote: > Steve Holden napisał(a): > > >>>>Does anyone know a good python mudule that works with MS SQL server? >>> >>>Google will yield something, but I prefer adodbapi over specialized >>>modules. Works good with SQLServer using SSPI a

Re: looking for a good python module for MS SQL server

2005-11-01 Thread Steve Holden
Jarek Zgoda wrote: > Steve Holden napisał(a): > > >>>>>>Does anyone know a good python mudule that works with MS SQL server? >>>>> >>>>>Google will yield something, but I prefer adodbapi over specialized >>>>>modules. Works

Re: Pickling and unpickling inherited attributes

2005-11-01 Thread Steve Holden
Alex wrote: > Thanks to both Alex Martelli and Steve Holden.. We need __slots__ for > other reasons, too long to explain, but basically to prevent assignment > of extra attributes. > > I ended up changing child classes this way: > > def __getstate__(self): &g

Re: Xah's edu corner: the Journey of Foreign Characters thru Internet

2005-11-01 Thread Steve Holden
as Larry Wall > in the computing industry, mostly likely things will not go well. > > [Disclaimer: all mention of real persons are opinion only.] > [... etc., etc.] -- 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: Embedding Python in an embedded system

2005-11-01 Thread Steve Holden
ython to the Linksys Network Storage device, which as far as I know uses the same chip and a similar Linux environment - or possibly even the WRT45G itself. Google isn't being very cooperative, though, sorry. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden

Re: python.org offline

2005-11-01 Thread Steve Holden
ten lately? > Possibly real maintenance occasioned by a recent move to a new server, in preparation for the new-look web site. 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: Python's website does a great disservice to the language

2005-11-01 Thread Steve Holden
bel :-) [Thinks: wonder if it's time to release a sneak preview]. 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: Flat file, Python accessible database?

2005-11-02 Thread Steve Holden
(I ask because I often recommend > SQLite, but would like to temper that advice if in some cases these > setup problems would cause someone trouble.) > > -Peter My experience on Cygwin was that I had to install sqlite before pySqlite worked. Maybe that's what was meant. re

Re: python CGI,sybase and environ variables

2005-11-02 Thread Steve Holden
ies? what's could be wrong? > thanks for any help rendered. > You should try adding "/path/to/sybase" to sys.path as well as/rather than putting it in an environment variable. sys.path is what the interpreter uses to find importable modules. regards Steve --

Re: About the Python Expert

2005-11-02 Thread Steve Holden
ecommend that you direct the members to the tutor list rather than trying to shore up an ineffective initiative. Good luck either way. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www

Re: Python and MySQL

2005-11-02 Thread Steve Holden
> You'll definitely need something to call the database API functions, I suspect. You could do a *private* install of the module though, surely, on your web host? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com

Re: Spambayes modifications with web services

2005-11-02 Thread Steve Holden
much about how the spammers operate and how the web really works. Generally speaking any attempt to "fight back" by generating more traffic and more search engine entries will only make things worse. They certainly *won't* go away if you don't ignore them, and they *probably* wo

Re: Python and MySQL

2005-11-02 Thread Steve Holden
re you can you can get lot's of > suggestions for a suitable replacement. > I have a _mysql.c as a part of my distrbution of MySQLdb. Don't you? 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 and MySQL

2005-11-02 Thread Steve Holden
Thomas Bartkus wrote: > "Steve Holden" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Thomas Bartkus wrote: >> >>>Well, I'm looking at the source for the ever popular MySQLdb library. It >>>appears to be nothing but st

Re: PEP submission broken?

2005-11-02 Thread Steve Holden
ths is a long time to wait, so maybe you should have asked about this rather sooner. Volunteers don't always behave as perfect bureaucrats :-) 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

[OT] Gmane/Tunderbird users: is g.c.p.general too big?

2005-11-02 Thread Steve Holden
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: Python's website does a great disservice to the language

2005-11-03 Thread Steve Holden
junior member. Such a > > > I like the general idea but not your formula. If the most junior team > member was 1 month out of school, would it really be OK for the > supervisor to be somebody who graduated 3 months ago?-) > It worked for Microsoft ... regards Steve -- S

Re: Class Variable Access and Assignment

2005-11-03 Thread Steve Holden
es you. > > > No matter wat the OO model is, I don't think the following code > exhibits sane behaviour: > > class A: > a = 1 > > b = A() > b.a += 2 > print b.a > print A.a > > Which results in > > 3 > 1 > I don't suppose you&

Re: Class Variable Access and Assignment

2005-11-03 Thread Steve Holden
Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > >>>class A: >>> a = 1 >>>b = A() >>>b.a += 2 >>>print b.a >>>print A.a >>>Which results in >>>3 >>>1 >>> >> >>I don&#

Re: [OT] Gmane/Tunderbird users: is g.c.p.general too big?

2005-11-03 Thread Steve Holden
Robert Kern wrote: > Steve Holden wrote: > >>Sorry about this almost off-topic post, but I am guessing there must be >>other readers of this group who use Thunderbird (in my case 1.0.2) to >>access it as gmane.comp.general.python. >> >>I'm currently sho

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Steve Holden
mmunity is much more welcoming than that of most programming languages, which is important if you are looking for support as your familiarity with the language grows. Good luck with your Python advocacy. 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: Filepath string manipulation help

2005-11-03 Thread Steve Holden
to the fully portable import os print os.path.basename(filepath) that Robert Dowell suggested in immediate response to your post? 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: OT - Re: Microsoft Hatred FAQ

2005-11-03 Thread Steve Holden
hread qualify their opinions with "IANAL", but on second thoughts I suppose that's fairly obvious by the fatuaous and inaccurate nature of many of the observations. Man, I'm beginning to really dislike Xah Lee. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494

Re: Class Variable Access and Assignment

2005-11-03 Thread Steve Holden
ng past experience that our perceptions of Python's execution model differ quite radically, and that I seem to find it quite satisfactory overall, whereas you are forever banging on about what "should" be true of Python and what Python "should" do. Which, a

Re: Class Variable Access and Assignment

2005-11-03 Thread Steve Holden
chies) unless the name is first found in the instance's namespace. That's just the way Python was designed. Like it or loathe it, it's too late to change now. . Some languages only use such a technique for resolving the names associated with methods, but this isn't comp.

Re: Class Variable Access and Assignment

2005-11-03 Thread Steve Holden
as unwise coding, doesn't imply > it is sane behaviour of python. Variable shadowing happens. I don't > consider it sane behaviour if the same reference in a line gets > resolved in different name spaces > Well I'm sure Guido will be happy to know you think his design is

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Steve Holden
saying that Java > is more or less like COBOL. (OO COBOL?) > Quite. People have said exactly that, you know ;-) http://www.artima.com/weblogs/viewpost.jsp?thread=42242 [...] 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: installing PygreSQL and psychopg2 modules (a newbie question)

2005-11-03 Thread Steve Holden
te them). Never used PygreSQL, so can;t help there (though you might try a similar trick and Googal for "PygreSQL Windows installer", say). If you look at http://www.holdenweb.com/Python/ you'll find a link to Mike Fletcher's page describing how you can install and use the free Mic

Re: Class Variable Access and Assignment

2005-11-04 Thread Steve Holden
Antoon Pardon wrote: > Op 2005-11-04, Steve Holden schreef <[EMAIL PROTECTED]>: [...] >>I suppose ultimately I'm just more pragmatic than you. > > > It has nothing to do with being more pragmatic. Being pragmatic > is about how you handle things with real life

Re: how to compile c-extensions under WinXP?

2005-11-04 Thread Steve Holden
ght version (or didn't set some variables), > since the error remains. Could you please help me (it will need some > patience with a computer newbie)? > See http://www.vrplumber.com/programming/mstoolkit and say thanks to Mike Farmer. regards Steve -- Steve Holden +44

Re: Class Variable Access and Assignment

2005-11-04 Thread Steve Holden
; variable gets updated instead of an instance variable getting created. > If you don't find the inconsistency to be weird, then ducky for you. Ho, hum. -- 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: Filepath string manipulation help

2005-11-04 Thread Steve Holden
\')[-1] > > works well too. Zope is very finicky about running specific commands, > I'm sure this is due to security issues of running os commands through > a website/webserver. > That's a good enough reason. You are excused. :-) regards Steve -- S

Re: Class Variable Access and Assignment

2005-11-04 Thread Steve Holden
Antoon Pardon wrote: > Op 2005-11-04, Steve Holden schreef <[EMAIL PROTECTED]>: > >>Antoon Pardon wrote: >> >>>Op 2005-11-04, Steve Holden schreef <[EMAIL PROTECTED]>: >> >>[...] >> >>>>I suppose ultimately I'm jus

Re: How can I do this in Python?

2005-11-04 Thread Steve Holden
separate CGI > scripts? > Another alternative might be to serve a script that sent the browser back 2 pages in its history, as long as server state hasn't changed in the meantime. 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: Calling Class' Child Methods

2005-11-04 Thread Steve Holden
ongue and I am still trying to figure out how to > solve this problem), how can I let MainClass knowing about the Custom > methods without rewriting all the Custom functions inside MainClass and then > pass the parameters to Custom? Is there a way to "propagate" the methods to &g

Re: Class Variable Access and Assignment

2005-11-04 Thread Steve Holden
x27;m reacting pretty badly to the construction you're > describing. I haven't gotten around to looking at the asyncore code > but will try to do so. I wouldn't bother. From memory it's just using a class variable as an initialiser. regards Steve -- Steve Holden

Re: how to compile c-extensions under WinXP?

2005-11-05 Thread Steve Holden
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > >>What should I do to be able to compile C-extensions (with python 2.4, >>winXP)? I get an error message, approximately "The .NET Framework SDK >>needs to be installed"; I tried to get something from the Micros

Re: Class Variable Access and Assignment

2005-11-05 Thread Steve Holden
rom users' needs. But of course we pragmatists know that practicality beats purity :-) 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: Using Which Version of Linux

2005-11-05 Thread Steve Holden
package tools suck quite badly. > > Debian and SUSE are both pretty good choices. I used yum on Fedora Core 2, and it downloaded and installed dependencies fine. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com P

Re: mod_python

2005-11-06 Thread Steve Holden
37, > in execute > self.errorhandler(self, exc, value) > > File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line > 33, in defaulterrorhandler > raise errorclass, errorvalue > > OperationalError: (1054, "Unknown column 'artist' in 'field list'") > > Thanks for the help > It's a while since I used mod_python, so this is a guess: The publisher module finds function arguments in the POST input stream. Since your form field is called "z_rating", publisher fails to find a "rating" argument to pass to the function. The second error message seems to imply that the database InventoryList table doesn't have a column called "article". 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: mod_python

2005-11-06 Thread Steve Holden
Steve Holden wrote: [...] > > The second error message seems to imply that the database InventoryList > table doesn't have a column called "article". > > regards > Steve ^article^artist^ -- Steve Holden +44 150 684 725

Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread Steve Holden
. Needing to pull over and > change a few jumpers on the PC board of the radio to get it on the right > channel. > > PyGTK - no experience there > > Pythoncard - a 50cc motorbike with training wheels > Less of the "old", if you don't mind ... regards Steve -

Re: gmpy 1.01 rc near... anybody wanna test>

2005-11-07 Thread Steve Holden
GNU gmp-static library, but then of course in both cases I was missing the gmp library to link it against. So I'm afraid you might need someone with access to VC to test this on Windows for you, sorry. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden We

Re: Class Variable Access and Assignment

2005-11-07 Thread Steve Holden
r it changed, but it is not that I *want* it to > change. I'll happily continue with python if it doesn't change. > That's sort of a pity. At this stage I'd recommend Ruby just to be rid of the incessant twaddle you come up with to defend your throwaway ideas. > Maybe

Re: strange sockets

2005-11-07 Thread Steve Holden
va client i have the same: > > % java Loader server.py server.py server.py > init 29 > server.py reading 631 1 > server.py reading 631 40 > server.py reading 631 41 > > why? > Seems to me that should probably be a question for comp.lang.java. regards Steve -- Steve Holden

Re: gmpy 1.01 rc near... anybody wanna test>

2005-11-07 Thread Steve Holden
Alex Martelli wrote: > Steve Holden <[EMAIL PROTECTED]> wrote: >... > >>I tried compiling it with the MS free toolkit but the C compile >>complains about the absence of "gmp.h". Since I see such a header in my >>Cygwin installation I presume it&

Re: [OT] Map of email origins to Python list

2005-11-07 Thread Steve Holden
27;t see that you have a chance in hell of extracting useful demographics. Which all leads me back to "what's the point?" - just because you can? 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: Lie Hetland book: Beginning Python..

2005-11-07 Thread Steve Holden
umber of different ways, and they are supposed to indicate the technique they use by setting a module variable "paramstyle" to one of five possible values. Magnus' original code was written to use a different (but valid) paramstyle, so I'm guessing that his sqlite module a

Re: newbiew ?->creating multiuser database project 2 b used via internet

2005-11-07 Thread Steve Holden
basic and i want to learn the right way > > thanks so much, > dave > > Sounds to me like you could usefully take a look at dabo and/or django. Both can be used to produce multi-tier applications, but django is web-based where dabo is GUI-based. Both seem to have the elements you sa

Re: problem generating rows in table

2005-11-07 Thread Steve Holden
x27;' rows = [] for row in toprint: print " " for cell in row: print "%s" % cell print " " print "" Of course you should really be ensuring that the cell contents correctly escape any special characters in the cell conte

Re: R.I.P. Vaults of Parnassus?

2005-11-07 Thread Steve Holden
> Does anyone know if it'll be coming back up, or if it's mirrored anywhere? > > Can anyone recommend any other good warehouses of Python goodies? > It appears to be up now ... regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC

Re: image

2005-11-08 Thread Steve Holden
posting". The reason you can't run Tkinter applications under PythonWin is that PythonWin does not use a separate process to run the modules you ask it to execute. Since PythonWin used MFC-style windowing, there is a conflict between the event-handling loops of the two different wind

Re: [OTAnn] Feedback

2005-11-08 Thread Steve Holden
ou clearly aren't even good at spamming and have very few clues about mailing lists. 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 convert a number to hex number?

2005-11-08 Thread Steve Holden
ter than this, or am I missing some joke? >>> hex(33*33) '0x441' >>> hex(33*33)[2:] '441' >>> 33*33 1089 >>> "%x" % 1089 '441' >>> Of course, you have to watch out for operator precedence: >

Re: How to convert a number to hex number?

2005-11-08 Thread Steve Holden
Paul Rubin wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > >>>Try hex(33**33). >> >>You're usually smarter than this, or am I missing some joke? >> >> >>> hex(33*33) >>'0x441' > > > You used o

Re: which feature of python do you like most?

2005-11-08 Thread Steve Holden
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > >>I have no idea why people are so facinating with python. > > > Hey, I'm fascinating even without python! > And so modest, too :-) regards Steve -- Steve Holden +44 150 684 7255 +

Re: Newb ??

2005-11-08 Thread Steve Holden
1 #Guessing Loop while guess != the_number and tries < 5: if (guess >the_number): print "Lower..." else: print "Higher..." guess = int(raw_input("Take another Guess:")) tries +=1 if guess == the_number: print "You guess correctly!!" print "The number was:", the_number print "You got it correct in", tries, "tries" else: print "Sorry you lose." print "The Correct Number was ", the_number 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: Lie Hetland book: Beginning Python..

2005-11-09 Thread Steve Holden
> Unfortunately this appears to mean that pysqlite2 isn't fully DB API-conformant. >>> import pysqlite2 >>> pysqlite2.paramstyle Traceback (most recent call last): File "", line 1, in ? AttributeError: 'module' object has no attribute 'paramstyle' >>> Of course, given the module's flexibility it's difficult to know what you *would* put in paramstyle. I take it mixing different paramstyles in the same query will fail? 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 modify code while debugging it without having to stop and then restart debugger

2005-11-09 Thread Steve Holden
do this. >>>in fact, the free version of the visual studio 2005, which is free, have >>>this ability. > > > Just out of curiosity, how much is the free version of Visual Studio 2005? > > I'm not positive, but i think they're currently giving i

Re: not able to HTTPS page from python

2005-11-09 Thread Steve Holden
7;RE GETTING BACK FROM THE SERVER ? > COULD YOU GUYS BE QUIET, PLEASE, I'M TRYING TO WORK 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: Hi, from my login i want to login as a other user ,

2005-11-09 Thread Steve Holden
it more context, like: "My boss tells me we have to be able to run admin commands from inside the order processing suite. Can anyone tell me how to do this?". If you *do* understand what you want to do then I'm afraid you still need to explain yourself more clearly. regards Stev

Re: Python obfuscation

2005-11-09 Thread Steve Holden
he product. Personally I've never bothered with obfuscation, and prefer to rely on copyright when I deliver code to customers. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006

Re: [ x for x in xrange(10) when p(x) ]

2005-11-09 Thread Steve Holden
)) > > [0, 1] Maybe, but the code also implies an esoteric knowledge that the trught value of the predicate is monotonically decreasing (in a Boolean sense). This would not be true if (e.g.) p = lambda x: x % 2 == 0. So while itertools.takewhile can save you unnecessary computations, such

Re: How to set program name in Python? ($0 in Perl)

2005-11-09 Thread Steve Holden
gt; > > Thanks! > Swaroop > www.swaroopch.info > import sys print sys.argv[0] 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 set program name in Python? ($0 in Perl)

2005-11-09 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote: > > >>>Is there a way to set the program name in Python, similar to $0 in >>>Perl? >>> >>>>From `man perlvar`: >>> >>>$0 Contains the name of the program being executed. On some op

Re: ANN: P(x) 0.2 applet builder

2005-11-10 Thread Steve Holden
ocation window. I think it's a bit ill-advised to use parens in a URL, and if you do then they shoud really be represented as %xx escapes. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006

Re: getting results into one variable

2005-11-10 Thread Steve Holden
ween the database server and the client, particularly if the result set is large. >>> curs.execute("SELECT secID, secTitle, secPath FROM SECTION") >>> curs.fetchone() (1, 'Explore Holden Web', 'hd_explore') >>> So of course you can unpack the tuple as well: >>> id, ttl, pth = curs.fetchone() >>> print "Title:", ttl, "path:", pth, "id:", id Title: Student Links path: hd_students id: 2 >>> If the result sets are too large to comfortably hold in memory you can fetch them N at a time with fetchmany(N), repeating until there's nothing left to read. And so on, but I hope this gives you the idea. 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: Script to export MySQL tables to csv

2005-11-10 Thread Steve Holden
net/projects/mysql-python If you have any trouble installing it, get back on this list and someone will help. You're going to have *such* fun! regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006

Re: Newb ??

2005-11-10 Thread Steve Holden
guess)/2. > > Comments please. > > Norman > Effectively you want to start with a minposs and maxposs, which are set to 0 and 100 respectively. Your guess should bisect the range (as nearly as it can given that you are dealing with integers, and you have to be careful to get

Re: ANN: P(x) 0.2 applet builder

2005-11-10 Thread Steve Holden
paren and the x were perfectly acceptable. Copying the text and pasting it into Firefox's location widget brought the page up without difficulty. 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: Stopping Execution

2005-11-10 Thread Steve Holden
t; should never get here > Which is Fredrik's way of telling you you need to *call* sys.exit and not just reference it (works in Perl, which assumes you want to call it, but in Python "explicit is better than implicit"). $ more test.py import sys print "should get here"

Re: more newbie help needed

2005-11-14 Thread Steve Holden
e are more pythonic ways to perform this task. You might try: for index in range(len(fruit)): letter = fruit[-index-1] print letter as one example. I'm sure other readers will have their own ways to do this, many of them more elegant. regards Steve -- Steve Holden +44 150 6

Re: more newbie help needed

2005-11-14 Thread Steve Holden
john boy wrote: [top-posting corrected] > > Steve Holden <[EMAIL PROTECTED]> wrote:john boy wrote: > >>using the following program: >> >>fruit = "banana" >>index = 0 >>while index < len (fruit): >>letter = fruit[index-1] >>

Re: HTTP Keep-Alive with urllib2

2005-11-15 Thread Steve Holden
n $ grep -i keep-alive /lib/python2.4/urllib*.py 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: Data Transmission Crash Course Required

2005-11-15 Thread Steve Holden
27;d be interested to see whether the material is any use to someone new to networking. 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: is parameter an iterable?

2005-11-17 Thread Steve Holden
PORTABILITY comments all over the place and too much boilerplate. Now > I go with a startup check on sys.hexversion, and exit with similar > wording. > We could all take an example from Fredrik Lundh, who still regularly releases products that run on everything back to Python 1.5.2.

Re: newbie question: 'import site' failed; use -v for traceback

2005-11-17 Thread Steve Holden
Run the command python -v and if this doesn't explain what the problem is, post the output back on the group. 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

Choose meaningful subjects for posts [was: Re: newb ?]

2005-11-18 Thread Steve Holden
taking the time to make sure the subject line really does describe the subject of your message - that way people with an interest in your problem are much more likely to read it instead of skipping over your posts. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494

Re: mysql connection

2005-11-18 Thread Steve Holden
methods, but basically you just need to close each cursor you open once. 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: Underscores in Python numbers

2005-11-19 Thread Steve Holden
bout base 2, 8, 10, 16. > > May be : > > int("E500.000,23") > > as we are using : > > 0x > > already for hex number > I really wouldn't want it to become possible to write Python code in one locale that had to be edited before the numeric lite

Re: Using win32ui.CreateFileDialog() to get the name of a file.

2005-11-19 Thread Steve Holden
t;>> dir(d) ['GetFileExt', 'GetFileName', 'GetFileTitle', 'GetPathName', 'GetPathNames', 'GetReadOnlyPref', 'SetOFNInitialDir', 'SetOFNTitle'] >>> d.Show() 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: Underscores in Python numbers

2005-11-19 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Steve Holden wrote: [...] >>I really wouldn't want it to become possible to write Python code in one >>locale that had to be edited before the numeric literals were valid in >>another locale. That way madness lies. > > That is the fact

Re: Underscores in Python numbers

2005-11-19 Thread Steve Holden
rs werw regarded as equivalent. 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: Delays getting data on sys.stdin.readline() ?

2005-11-19 Thread Steve Holden
noticed the same thing in Unix-like operating systems when running tail -f on a file being fed by an active process: the output appears in chunks ending in partial lines because the feeding process's output buffer has been filled and the operating system has passed it to the tail process. reg

Re: what happens when the file begin read is too big for all lines to be read with "readlines()"

2005-11-19 Thread Steve Holden
each time is less efficient, am I right? > Not necessarily. Try this: f = file("filename.txt") for line in f: if token in line: # or whatever you need to identify it break else: sys.exit("File does not contain token") lin

Re: Underscores in Python numbers

2005-11-20 Thread Steve Holden
x2*(a6 + x2*(a8 + x2*a10 > > (or least that's what I like to write). Now, if I were going to higher > precision, I'd have more digits of course. > Right, this is clearly such a frequent use case it's worth changing the compiler for. 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: need help about time.sleep, timer

2005-11-21 Thread Steve Holden
ter 5 seconds , other input 5 > after 5 more seconds , 15 is being proccessed > Thanks. It sounds like you will have to learn how to do two things in parallel, which is normally done using threads. Unfortunately it also seems you would like the input thread to be terminated when the timer thread finds its time is up, and that's not particularly easy because there's no way to stop a thread "from the outside" once it's started. 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: Hot to split string literals that will across two or more lines ?

2005-11-22 Thread Steve Holden
string > with an empty string thus > """.replace('\n','') > Of course there's also the alternative of escaping the newlines out in the literal. The replace result above is exactly """\ lots of text hundreds of characters long\ more text on another line but we really don't want any line breaks\ in our final string\ so we replace newlines in this multiline string\ with an empty string thus\ """ 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

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