Re: Can a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Steve Holden
;", line 3, in __eq__ File "", line 3, in __eq__ ... File "", line 3, in __eq__ File "", line 3, in __eq__ RuntimeError: maximum recursion depth exceeded >>> Was that what you meant? Or something more like: >>> class thing: ..

Re: 10060, 'Operation timed out'

2006-01-18 Thread Steve Holden
Sumit Acharya wrote: > Hi Steve, > > It didnt help, i am getting same error. > After 20 seconds or 60? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pyco

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Steve Holden
Claudio Grondi wrote: > Steve Holden wrote: > >>Claudio Grondi wrote: >> >> >>>In the process of learning about some deeper details of Python I am >>>curious if it is possible to write a 'prefix' code assigning to a and >>>b somet

Re: Is there a maximum length of a regular expression in python?

2006-01-18 Thread Steve Holden
ich can possibly match. So matching the syntax and then validating the data identified seems like a much more sensible option (to me, at least). regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006

Re: 10060, 'Operation timed out'

2006-01-18 Thread Steve Holden
nt ftp.sendcmd('pass x') ftp.close() Try running the script without both try/excepts and then post the full traceback, please. You can forget about the timings for now. It may well be an FTP server loading issue, but a traceback will give more information. regards Steve -- Ste

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Steve Holden
any) will be found and used/referenced? > No more than there is in C or, presumably, Java. If you want to test for identity, use "is". If you want to test for equality, use "==". Of you want to test for something else, kindly explain what you want to test for. regards

Re: Retaining Unix EOL when reading/writing in windows

2006-01-18 Thread Steve Holden
in the UNIX EOL characters? > Yup. Try outfile = open("test_out.lwc", 'wb' ) to write the file in binary mode. That way the file handling code won;t ferkle with what you write. 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 a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Steve Holden
Claudio Grondi wrote: > Steve Holden wrote: [...] > The problem here is, that I mean, that in Python it makes no sense to > talk about a value of an object, because it leads to weird things when > trying to give a definition what a value of an object is. > I don;t understand w

Re: MSSQL LIKE and IN statements in ADO problem

2006-01-18 Thread Steve Holden
's why there are three > percent signs in a row. The last one is the one associated with the > string substitution for the name variable. Make sense? > Now Google for "sql injection vulnerability" and tell us why this is a bad idea. regards Steve -- Steve Holden

Re: Threads sleeping all instead of just one.

2006-01-18 Thread Steve Holden
C++'s ? > Thank you very much. V. Sounds to me like you need to learn how to release the GIL (global interpreter lock). regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.pyt

Re: The Python cross? Was New Python.org website

2006-01-18 Thread Steve Holden
snakes we've seen in the past. > That was pretty much what I thought. The intention was definitely to be snake-like and resemble "Py" at the same time. No reply yet on why Obaid wanted to know about the cross motif (though one has one's suspicions). regards Steve

Re: MSSQL LIKE and IN statements in ADO problem

2006-01-18 Thread Steve Holden
g value as a parameter to the query. I will shortly have to solve the same sort of problem, but in my case using the DBAPI. Let me know if this works. The problem, of course, is that a query parametere can only replace a SQL token, not a part of one. regards Steve -- Steve Holde

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-18 Thread Steve Holden
+0100 > > Newsgroups: > comp.lang.python > > > Steve Holden wrote: > >> Claudio Grondi wrote: >> >>> Steve Holden wrote: >> >> >> >> [...] >> >>> The problem here is, that I mean, that in Python it m

Re: list(...) and list comprehensions (WAS: Arithmetic sequences in Python)

2006-01-18 Thread Steve Holden
Traceback (most recent call last): File "", line 1, in ? TypeError: list() takes at most 1 argument (3 given) >>> So you're talking about the way list() *should* work in Python 3, right? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holde

Re: OT: excellent book on information theory

2006-01-18 Thread Steve Holden
Terry Hancock wrote: > On Wed, 18 Jan 2006 07:58:10 + > Steve Holden <[EMAIL PROTECTED]> wrote: > >>Terry Hancock wrote: >> >>>On Tue, 17 Jan 2006 13:28:15 + >>>Steve Holden <[EMAIL PROTECTED]> wrote: >>> >>>>They kn

Re: OT: excellent book on information theory

2006-01-19 Thread Steve Holden
you were > to confess, you would be placed in a comfy one ? And furthermore, > what if you were told that while in this chair thing, you would be seeing > the sketch about the penguin on the telly ? Lets see, "sketch" means > a rough line drawing, and the only "telly&q

Re: New Python.org website ?

2006-01-19 Thread Steve Holden
> The big pictures are too flashy. The colors and fonts etc. give make it > somewhat cool. Cool is a good thing. But not without content. > > >>Could you come up with some alternative for the intro copy about python? > > Sure. In fact I think the front page intro should be ve

Re: New Python.org website?

2006-01-19 Thread Steve Holden
Obaid R. wrote: > Steve Holden: > > >>The history of this choice is lost in the mists of time. Many other >>proposals were made and discussed at around the same time, to the extent >>that it became clear no one choice could win universal approval. >> >>You

Re: getopt.gnu_getopt: incorrect documentation

2006-01-19 Thread Steve Holden
he address shown in the documentation ([EMAIL PROTECTED]), or by using the Python bug tracker? 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: 10060, 'Operation timed out'

2006-01-19 Thread Steve Holden
; raise socket.error, msg > socket.error: (10060, 'Operation timed out') > So the FTP server is refusing your connection, I suspect. There's no way the client can control the time it takes to do that. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 H

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-19 Thread Steve Holden
.). >>> >>> a = [1] >>> a.append(a) >>> a [1, [...]] >>> >>> b = [1] >>> b.append(b) >>> a == b Traceback (most recent call last): File "", line 1, in ? RuntimeError: maximum recursi

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-19 Thread Steve Holden
r use a special extension library written in C for doing that. > Well, if this isn't a case of premature optimization I've never seen one. You apparently haven't yet written a single line of your appliction, yet you are already concerned about its efficiency. 1. First, make it

Re: New Python.org website ?

2006-01-19 Thread Steve Holden
some of his undoubted energy to examine the current systems design and produce a through-the-web interface for us. Once the new documentation site is up and running, that is :-) Seriously, I'm not aware of anything about the current design that would prohibit through-the-web editing. Neither am I awa

Re: Decimal vs float

2006-01-19 Thread Steve Holden
terals > currently interpreted as floats could not be interpreted as Decimal > objects in future? > That would be a very large change in the behaviour of the interpreter, and unfortunately it doesn't take account of the need in decimal to specify the context in which a calculation takes

Re: Decimal vs float

2006-01-19 Thread Steve Holden
Kay Schluehr wrote: > Steve Holden wrote: > >>>If Mr. interpreter is as slick as he is why doesn't he convert the >>>float by himself? This is at most a warning caused by possible rounding >>>errors of float. >>> >> >>Indeed, as the docu

Re: New Python.org website ?

2006-01-19 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote > > >>As you indicated, there are other priorities just at the moment. > > > you're complaining about the lack of manpower, and still think that lowering > the threshold for contributions is not a priority ? at this

Re: MSSQL LIKE and IN statements in ADO problem

2006-01-19 Thread Steve Holden
PI modules will indeed allow you to use a list or set parameter for this purpose, but not all. 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

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-19 Thread Steve Holden
Claudio Grondi wrote: > Steve Holden wrote: > >>Claudio Grondi wrote: >> >> >>>Steven D'Aprano wrote: >>> >>> >>>>Claudio Grondi wrote: >>>> >>>> >>>> >>>>>Exactly this is wha

Re: why is my hash being weird??

2006-01-19 Thread Steve Holden
as interested how, for this i came up with this exercise . OK. Now examine a similar program: myhash = {} def summa(n): global myhash for i in range(n): myhash[i] = i summan(100) and see how this compares with your program having a million

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-19 Thread Steve Holden
out reference to its meaning in Python. I hope this hasn't seriously inconvenienced you. However, it does seem like you are "looking for trouble" here -- i.e. looking to prove that Python is broken, when what's actually broken appears to be *your understanding* of 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: Python code written in 1998, how to improve/change it?

2006-01-19 Thread Steve Holden
n places great store on backwards-compatibility. Consequently I'd suggest you try the code out, and report any problems you find back on this list. I'd give you odds it will work. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden We

Re: why is my hash being weird??

2006-01-20 Thread Steve Holden
know what other languages you have tested with 20-40MB source files, and what conclusions you have arrived at about them. Particularly since your initial conclusion about Python was "dictionaries are weird and each entry uses approximately 1kB" :-) regards Steve -- Steve Hold

Re: how to find not the next sibling but the 2nd sibling or findsibling "a" OR sinbling "b"

2006-01-20 Thread Steve Holden
... You can also construct your own classes so their instances evaluate to True or False according to your needs. 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: Python Developer positions (2) in Campbell, CA

2006-01-20 Thread Steve Holden
and mySQL > > · Familiar with Linux operating system > > · Strong interpersonal skills > > · Desire to engage in extremely challenging assignments. > > · Excellent verbal and written communication skills, and strong > collaborative skills. &

Re: How to generate graphics dynamically on the web using Python CGI script?

2006-01-20 Thread Steve Holden
rmation on how to use it on the web, and many regular readers of this group are skilled with it! 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 generate graphics dynamically on the web using Python CGI script?

2006-01-20 Thread Steve Holden
ry that he already uses CGI to generate the HTML. 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 generate graphics dynamically on the web using Python CGI script?

2006-01-20 Thread Steve Holden
David Wahler wrote: > Xavier Morel wrote: > >>Steve Holden wrote: >> >>>Luiz Geron wrote: >>> >>>>I don't have experience on this, but I think that you can make the >>>>script return the image "contents" directly to the i

Re: Is there a maximum length of a regular expression in python?

2006-01-20 Thread Steve Holden
gt;>being the wrong tool for the job. > > > Does no one care about an internal error in the regular expression > engine? > > Not one that requires parsing a 100 kilobyte re that should be replaced by something more sensible, no. 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 optparse wont import?

2006-01-20 Thread Steve Holden
You are by no means the first ... 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 there a maximum length of a regular expression in python?

2006-01-20 Thread Steve Holden
Tim Peters wrote: > [Bryan Olson] > >>>Does no one care about an internal error in the regular expression >>>engine? > > > [Steve Holden] > >>Not one that requires parsing a 100 kilobyte re that should be replaced >>by something more sens

Re: OT: excellent book on information theory

2006-01-20 Thread Steve Holden
be a name, end > of story. Yes, it sucks that you can't write Python code in mathematics, > just like it sucks that you can't write English in French or Lisp in C. > Get over it." > > ... and if that fails, try repeated application of the clue stick until enlighte

Re: Read from Serial Port

2006-01-20 Thread Steve Holden
for "python serial port" I would recommend you remember that in future ... that's why there's no URL in this message : Googling yourself will help the lesson sink in. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC

Re: Decimal vs float

2006-01-20 Thread Steve Holden
ral, for any "random" rational value N/M, > the odds are that it cannot be represented precisely as a float. And > that's what people mean when they say floats are imprecise. > > > And you thought Bengt didn't know that? 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: excellent book on information theory

2006-01-20 Thread Steve Holden
ing to be American > translations of Jane Austin where a girl says to her sister > "dude, he is such a hottie!" and she replies "oh my god, for > sure!" > Like, gag me with a spoon, dude. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494

Re: Variables and none?

2006-01-20 Thread Steve Holden
argument, such as def f(x, something=2): ... That way if the caller just says f(33) that's equivalent to f(33, something=2) but it's also possible to say f(33, something=101) or f(33, 101) both of which are equivalent. Does this help at all? regar

Re: Arithmetic sequences in Python

2006-01-22 Thread Steve Holden
not the same > > list((1,2)) = [1,2] > xlist((1,2)) = [(1,2)] > > etc. I presume that here "=" means "evaluates to"? 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: Error in Python documentation

2006-01-22 Thread Steve Holden
is immediately preceded by """General comments and questions regarding this document should be sent by email to [EMAIL PROTECTED] """. I should have thought that inability to register a bug on Sourceforge would have justified an email to [EMAIL PROTECTED] Did you send

Re: New Python.org website?

2006-01-22 Thread Steve Holden
of history. It's simply that c.l.py is a very high-bandwidth list, and every off-topic thread reduces its usefulness for people seeking information about and assistance with Python. Experience shows that this kind of exchange can expand and run on for days, so I'd be very grateful

Re: Is there a limit to os.popen()?

2006-07-12 Thread Steve Holden
where the error is, I *can* tell you that the message is caused when some proces that's writing to a pipe sees the pipeline's reader close the pipe while the writer is still sending data. If you are seeing alot of error messages you shoudl really redirect the standard error to a fil

Re: Accessors in Python (getters and setters)

2006-07-14 Thread Steve Holden
d setters because we have properties if >>the access might become a bit more complex in the future. >> > > > Ha! I bet you haven't read too many Python codes. > > One thing I can more or less guarantee is that if you'd invested the time you've spent

Re: EuroPython 2006 and Py3.0

2006-07-14 Thread Steve Holden
the list and started making inappropriate suggestions, which then have to be (patiently) rejected. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings

Re: How can get button's name when cursor move over the button on a web page?

2006-07-14 Thread Steve Holden
have no idea which groups they belong to. When *I* was a lad questions had to know their place. A question that appeared in the wrong group would be torched with flames that could be guaranteed to burn through asbestos. But you tell these young people and they just don't believe you. A Yorks

Re: rare error with python at execution

2006-07-14 Thread Steve Holden
teError: 'module' object has no attribute 'environ' > > > have you perhaps added a file named "os.py" to your project ? If not, then run your program with python -v progname.py like the error message tels you. If that doesn't give you enough in

Re: compiling 2.3.5 on ubuntu

2006-07-17 Thread Steve Holden
s)he wants to test programs on less recent versions of Python. Ubuntu 5.10 was already up to Python 2.4.2, so I can't imagine there's anything older on Ubuntu 6.06. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holden

Re: EuroPython 2006 and Py3.0

2006-07-17 Thread Steve Holden
y inappropriate to produce a language that no longer seems "Pythonic". In order to retain pythonicity, therefore, it seems to me that those who decide nt he future of the language should have at least *some* practical experience of a) language design and b) Python. regards Steve --

Re: Package organization

2006-07-17 Thread Steve Holden
rganize your > packages and modules? Basically you are over-organizing for your needs here. Is there any reason why the timer.py file defininf the Timer function needs to be in its own sub-package? It's bad enough having to write timer.Timer(), don't compound that folly unn

Re: Coding style

2006-07-17 Thread Steve Holden
enced Python programmers would scratch their heads at your second formulation. I doubt there's much in it from a time point of view (though I know as I write this it will spur someone to use timeit.py to point out I am wrong). regards Steve -- Steve Holden +44 150 684 7255 +1 8

Re: Coding style

2006-07-17 Thread Steve Holden
still write if a>3 == True: don't you ;-) regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list

Re: Recursive function returning a list

2006-07-17 Thread Steve Holden
dren=[]): with def getAllChildren(self, children=None): if children is None: children = [] That way a new empty list is created for each call that receives no "children" argument. Otherwise the same (once-empty) list is used for them all. regards St

Re: pyKML: where to get it?

2006-07-17 Thread Steve Holden
there. If they haven't made a release yet, that'll be the only place the code lives ... regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings h

Re: XMLRPC Solution Code

2006-07-17 Thread Steve Holden
o > execute: ")) > print output > I'm afraid you'll need to Google for "python windows service" or similar: in essence the main thing the service has to do (besides serve) is ensure a continuous flow of messages through the system. It's ugly, but people h

Re: Coding style

2006-07-17 Thread Steve Holden
means of guarding statements that should be executed only when there are elements in the list (or other container, come to that), promoting any other way to perform the test will only lead to confusion: there should be one (and preferably only one) obvious way to do it. regards Steve -- St

Re: wanting

2006-07-18 Thread Steve Holden
o the original poster: sorry about all this humour at your expense. Just go to www.python.org, click on the "downloads" link, and download and run an appropriate installer. Probably the Windoze one). -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Lt

Re: range() is not the best way to check range?

2006-07-18 Thread Steve Holden
t god's intentions are > in pete's best interest, so something could be "for pete's > sake" and "as god intended" without pete being god. > > That said, "for pete's sake" is probably a just an cleaned up > version of "for god

Re: question about what lamda does

2006-07-18 Thread Steve Holden
atement as an argument to a function"? There is nothing wrong with def adder(x): def func(y): return x+y return func for example. Then adder(5) returns a function that returns 5 more than its argument. regards Steve -- Steve Holden +44 150 684 7255 +1 800

Re: Recursive function returning a list

2006-07-19 Thread Steve Holden
link to the FAQ So, why didn't you? > (or take time to re-explain it for the zillionth time), not to propose a > workaround. > Or did I miss something? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype:

Re: question about what lamda does

2006-07-19 Thread Steve Holden
ry use is obfuscating your code. > I do wish you could hold yourself back and stop muddying the waters. Lambdas and list comprehensions have little or nothing to do with each other. Unless you know something I don't ... regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 H

Re: Accessors in Python (getters and setters)

2006-07-19 Thread Steve Holden
rs are not >>>>>just necessarily getters/setters, they are methods of objects. >>>> >>>>Behaviour is how a given object reacts to a given message. *Nothing* in >>>>this implies the notions of attributes or methods. Attributes and >>>

Re: No need to close file?

2006-07-19 Thread Steve Holden
the interpreter somehow terminates without closing the file. I suspect the real answer is "it isn't strictly necessary in modern environments, but it can never hurt". regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Steve Holden
late the values. Sounds like that should be enough of a hint to you. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list

Re: TextCtrl focus events in wxWidgets

2006-07-19 Thread Steve Holden
Simon Hibbs wrote: > Steve Holden wrote: > > >>It should be quite simple: you need to handle EVT_SET_FOCUS and/or >>EVT_KILL_FOCUS events (documented in the wxPython docs) to know when to >>recaclulate the values. Sounds like that should be enough of a hint to you. &

Re: Project organisation

2006-07-19 Thread Steve Holden
efined in utils.py, and to run those tests after each change no matter for which project. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list

Re: CSV with comments

2006-07-19 Thread Steve Holden
x27;s wrong with line.startswith('#') which expresses the intent rather better as well. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings

Re: using names before they're defined

2006-07-19 Thread Steve Holden
entation might need to become a little more sophisticated. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/steve.holden -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Steve Holden
with, then the >>wisdom behind careful upfront planning begins to make sense. >> > > If it isn't part of the documented API, it is the user's fault. That > applies to all software... I'm this thread represents proof tht you can lead a horse to water but

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Steve Holden
far bigger time waster than any imagined problems of direct attribute access. I suspect that if you are getting complaints if the nature you describe it's just because your software isn't that good. > Thanks to the people who exposed me to Python's properties. > > Bye

Re: Depricated String Functions in Python

2006-07-20 Thread Steve Holden
x27; methods instead, as the string module is likely to be removed at some time in the future. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings h

Re: using names before they're defined

2006-07-20 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Steve Holden wrote: > >>[EMAIL PROTECTED] wrote: >> >>>I have a problem. I'm writing a simulation program with a number of >>>mechanical components represented as objects. When I create instances >>>of objects, I n

Re: Depricated String Functions in Python

2006-07-20 Thread Steve Holden
John Machin wrote: > On 20/07/2006 5:18 PM, Steve Holden wrote: > >>Anoop wrote: >> >>>Hi All >>> >>>Can any one help me out with the various depricated string functions >>>that is followed in Python. >>> >>>For example ho

Re: how to know if socket is still connected

2006-07-20 Thread Steve Holden
t; > > Would that still apply when trying to send an empty string? Yes: sending an empty string demands no action on the server's part, as the receiver has already received it ... adding an empty string to whatever the sender currently has buffered does not require any state

Re: Accessors in Python (getters and setters)

2006-07-20 Thread Steve Holden
Gerhard Fiedler wrote: > On 2006-07-20 04:15:33, Steve Holden wrote: > > >>mystilleef wrote: >>[...] >> >>>I don't know it's your code not mine. >>> >>>class Robust(object): >>> >>> def __init__(self): >

Re: Depricated String Functions in Python

2006-07-20 Thread Steve Holden
f all strings): >>> lst = ['Steve', 'Holden'] >>> map(str.lower, lst) ['steve', 'holden'] >>> regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holde

Re: Help Needed. Removing a Folder Problem(Problem Solved)

2006-07-20 Thread Steve Holden
quot;Please Firstly Browse and Insert A File") > Just be careful with those string constants: you should really be using either 'C:\\copiedFiles' or r'C:\copiedFiles'. No problems at the moment because "\c" isn't a defined escape sequence,

Re: Depricated String Functions in Python

2006-07-20 Thread Steve Holden
Donn Cave wrote: [...] > > Oh, excellent - the string module is dead, long live > the string module! I can replace string.join with > str.join, and never have to defile my code with that > ' '.join(x) abomination. > >>> lst = ['Steve', &

Re: Semantics of propagated exceptions

2006-07-21 Thread Steve Holden
the more complex the client (calling) code has to be. It will probably also require serious changes to the calling code as implementation details change, which doesn't give very good isolation. > Some gut feeling tells me the first option is preferrable, but I'ld like > to read y

Re: range() is not the best way to check range?

2006-07-21 Thread Steve Holden
(most recent call last): File "", line 1, in TypeError: Error when calling the metaclass bases type 'slice' is not an acceptable base type >>> Indeed. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd htt

Re: Isn't there a better way?

2006-07-21 Thread Steve Holden
ter anyway, as it seems to make the coupling more explicit. What would you do if the index and output values were just stored in plain variables? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://

Re: regular expression - matches

2006-07-21 Thread Steve Holden
That's wrong? That's wrong. In this context match just means you got to the end of the pattern. However, if you don't want to add the "$" to the end of the patterns, you could instead check that m.endpos == len(s) where m is the match object and s is the

Re: An optparse question

2006-07-21 Thread Steve Holden
on number and exit > -o FILE Output file > Do a Google search for "monkey patching". You probably want to monkey-patch the class's usage method. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.hol

Re: Isn't there a better way?

2006-07-23 Thread Steve Holden
ng the same data, then it makes perfect >>>sense to only pass it once. >> >>Actually they are not "passed". > > > I think I'm going to plonk you. And the rest of comp.lang.python has to know about this because ... ? regards Steve -- Steve Holden

Re: Need a compelling argument to use Django instead of Rails

2006-07-24 Thread Steve Holden
help me with my argument? Meanwhile I think I'll give RoR a try > as well. > I wouldn't waste your time. "A man convinced against his will is of the same opinion still", and they already know they aren't interested in Python. There are probably many other matters

Re: Need a compelling argument to use Django instead of Rails

2006-07-24 Thread Steve Holden
Ray wrote: > Steve Holden wrote: > >>I wouldn't waste your time. "A man convinced against his will is of the >>same opinion still", and they already know they aren't interested in >>Python. There are probably many other matters about which

Re: class instance scope

2006-07-24 Thread Steve Holden
ather than in the module's global namespace. > 1) I tried lookng into the docs but couldn't find anything on instance > scope. > 2) How is such situation tackled ? Will I have to instantiate in every > function ? > The best thing to do would be to pass the instance in as

Re: Python to log into web site

2006-07-24 Thread Steve Holden
ation. Does anyone have any suggestions or links > that might point me in the right direction? > > Look for mechanzie and clientform, both by John J Lee, in sourceforge. They can both help a lot. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holde

Re: Python to log into web site

2006-07-24 Thread Steve Holden
Steve Holden wrote: > david brochu jr wrote: > >>Hi, >> >>I have been browsing around the net looking for a way (hopefully an >>easily implemented module) to log into a web site using python. The site >>I wish to log into is an internal site which requir

Re: _mssql on Python 2.5 Beta 2

2006-07-24 Thread Steve Holden
problems on import, so this may be no help at all (in which case, sorry!) regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings http://del.icio.us/st

Re: _mssql on Python 2.5 Beta 2

2006-07-24 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Steve Holden wrote: > >>You aren't using the same library you used with 2.4, by any chance? >>Compiled extensions are specific to a particular major version of >>Python, so (for example) 2.3 extension modules won't run under 2.4. >&g

Re: Connecting to internet under proxy

2006-07-24 Thread Steve Holden
al/lib/python2.5/urllib.py", line 84, in urlopen return opener.open(url, data) File "/usr/local/lib/python2.5/urllib.py", line 192, in open return getattr(self, name)(url, data) File "/usr/local/lib/python2.5/urllib.py", line 327, in open_http h.send

Re: prob with struct and byte order

2006-07-24 Thread Steve Holden
n you print it from Python) looks like "STX\x00\x00\x00,\x00\x00\x00\e17758\x00\x00 ... ETX" then it looks like the bytes you want can be obtained, supposing the string is stored in variable s, as s[12:17]. >>> s = "STX\x00\x00\x00,\x00\x00\x00\e17758\x00\x00 ...

Re: How to force a thread to stop

2006-07-24 Thread Steve Holden
s can help. But if you research the history of this design decision in the language you should discover there are fairly sound rasons for not allowing arbitrary "threadicide". regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd

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