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 for .NET and IronPython

2005-11-02 Thread Steve M
I was under the impression that IronPython is like CPython and Jython, namely an implementation of the Python language. So in that sense it is exactly like normal Python, although I don't know how convenient it is to deploy. I was also under the impression that Python for .NET is like an API wrapp

Re: convert COM obj to integer

2005-11-02 Thread Steve M
I don't know exactly what a COM object is, but those aren't them. The win32com package takes care of converting everything to Python types. The excel call returns a tuple of tuples. That is, the outer tuple is the sequence of rows, and each such row is itself a tuple with one member per column requ

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
you might email Barry to see whether he has taken any action on the pre-PEP, or that a post to python-dev simply inquiring whether anyone has read the pre-PEP might be appropriate. In the absence of evidence to the contrary, treat this situation as accidental rather than deliberate. Two mon

[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
defined name resolution order to locate a value that was bound to the name "a" in class scope. So what? This is a long-documented fact of Python life. It's *supposed* to be that way, dammit. I fail to understand why this is such a problem for you. But then it's clear from lo

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
mjakowlew wrote: > Steve, > > the os commands don't run through zope, it denies access to them to be > run at all through the webserver. So in turn, I had to use a work > around to fix the IE problem. Also qwwee's suggestion to use: > > filepath.split('\

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: So, Which Version is Suitable for Beginners

2005-11-06 Thread Steve M
There is a new gratis VMWare player at http://www.vmware.com/download/player/ You can download an image http://www.vmware.com/vmtn/vm/browserapp.html that they call a Browser Appliance, but if I remember correctly it is Ubuntu. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Which Version of Linux

2005-11-06 Thread Steve M
Max wrote: > (Mark Shuttleworth, ... > really loves Python - he gave me quite a lot of money for using it). Please elaborate. -- http://mail.python.org/mailman/listinfo/python-list

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: PYTHON LOOSING FOR JAVA???????

2005-11-08 Thread Steve Horsley
Jarek Zgoda wrote: > > > Computing is large area. Much larger than aunt Tilly's laptop. > You clearly haven't seen the size of Aunt Tilly's lap! Sorry, couldn't resist it. Steve -- 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: A Tcl/Tk programmer learns Python--any advice?

2005-11-08 Thread Steve M
Even though its for any (not just Tcl) experienced programmer, and even though you've got all the appropriate resources, I'll mention that you should get a lot out of the book Dive Into Python, at http://www.diveintopython.org/ -- 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: derived / base class name conflicts

2005-11-10 Thread Steve Juranich
ter.Canvas before I can safely subclass it (and assign attributes > to an instance of the subclass) or clear attribute names as I outlined > above? > > Chris Marshall > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Steve Juranich Tucson, AZ USA -- http://mail.python.org/mailman/listinfo/python-list

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

2005-11-16 Thread Steve Juranich
On 15 Nov 2005 14:45:27 -0800, Steve <[EMAIL PROTECTED]> wrote: > Does any one know if python has the ability to run a shutdown hook. Look at the "atexit" module. barbet (~)$ pydoc atexit.register Help on function register in atexit: atexit.register = register(fu

Re: newbie - How do I import automatically?

2005-11-16 Thread Steve M
The file C:\Python24\Lib\sitecustomize.py (which I think doesn't exist by default) executes every time Python starts. (This means not just your IDLE session but every time you run any Python script.) One use for this file is to invoke sys.setdefaultencoding because that name gets deleted during in

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: Tkinter's coordinates setting

2005-11-17 Thread Steve Juranich
; among them, do I need transfer the coordinates? Transfer the coordinates of what? When you go from the standard right-handed system to the system used in computer graphics, you use these simple formulas: max_x, max_y = image size screen_x = original_x screen_y = max_y - original_y - 1 HTH -

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: the PHP ternary operator equivalent on Python

2005-11-18 Thread Steve M
Another way to simulate the ternary operator is this: a = (quantity > 90 and "It is very huge") or "The value is correct" You have to be careful of semantics of 'and' and 'or'. But in this case I wonder why you don't just test whether quantity is greater than 90 and assign the corresponding value

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: Tkinter's coordinates setting

2005-11-21 Thread Steve Juranich
he screen. -- Steve Juranich Tucson, AZ USA -- 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

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

Re: Why are there no ordered dictionaries?

2005-11-23 Thread Steve Holden
rs to favour any one of the several reasonable alternatives that might be chosen. 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 gui using boa

2005-11-23 Thread Steve Holden
.wxpython.org/index.cgi/UsingSizers but whether this will help you with Boa I'm not sure. I have tried Glade and Boa as well as Python Card, and all I can really say is that I found it worth spending the money to *buy* wxDesigner. It's not a perfect product, but it fits my brain. Sorry

Re: mxODBC sql MSAccess

2005-11-23 Thread Steve Holden
L or mxODBC? > And how can I get just simple tab-delimited records with a standard > carriage return separating the records? > > Thanks so much for any help. > > bs > Well you know that answer now. You might also consider using the recipe at http://a

Re: Hot to split string literals that will across two or more lines ?

2005-11-23 Thread Steve Holden
en you print it - the SQL interpreter certainly won't care. Many SQL statements are so long that it actually helps readability to have newlines in them. There have been plenty of solutions presented in the earlier posts in this thread if you really do need to represent multi-line strings.

Re: wxPython Licence vs GPL

2005-11-23 Thread Steve Holden
the wxPython Licence is compatible with the GPL -- if not, > do we just cosmetically change any remaining lines, so none remain from > the orignal?) > That won't stop your code from being a derivative work. You'll need to take licensing and copyright issues a little more seriously

Re: asyncore question

2005-11-23 Thread Steve Holden
> > >>>>d.__class__ > > > >>>>d is None > > False > >>>>^Z > > > why > >>>>print d > > prints None ? > > > >Thanks for your answers, > > > At a guess, because it has

<    10   11   12   13   14   15   16   17   18   19   >