Re: why cannot assign to function call

2009-01-06 Thread Steve Holden
enough to bring the conversation to this conclusion (except that I am pretty sure this *won't* be a conclusion ;-) regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python callback functions and static methods

2009-01-05 Thread Steve Holden
you feel the class organization is buying you. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: threading a 10 lines out of a file

2009-01-05 Thread Steve Holden
it yet again. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: why cannot assign to function call

2009-01-05 Thread Steve Holden
that you met with a somewhat hostile reaction (whether or not such a reaction was useful or necessary) because you were, in a small way, poking people in the side with a sharp stick? If you couldn't I might find that a *little* bizarre. regards Steve -- Steve Holden+1 571 484 6266 +1

Re: why cannot assign to function call

2009-01-05 Thread Steve Holden
) people will argue about anything, with the major intention of proving themselves right rather than reaching a common understanding. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo

Re: threading a 10 lines out of a file

2009-01-05 Thread Steve Holden
of the tunnel, however, since even if threads don't work it's possible that the multiprocessing module will (assuming you have multi-processor hardware at your disposal). regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http

Re: Using PythonPath under Windows Vista.

2009-01-04 Thread Steve Holden
of a module you will probably find that python -m brian will do what you expect. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: deleting a method

2009-01-04 Thread Steve Holden
functions any more or less deletable than functions or methods created using the def statement? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Using PythonPath under Windows Vista.

2009-01-04 Thread Steve Holden
= 28 Second line = 'LocalService:*:19:544:U-NT AUTHORITY\\LocalService,S-1-5-19::\n' Read 8 more lines File length = 1001 Truncated length = 500 regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org

Re: why cannot assign to function call

2009-01-04 Thread Steve Holden
, as I switched to Icon when Griswold produced that and found it a far superior language. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: why cannot assign to function call

2009-01-04 Thread Steve Holden
to feel that everyone else should share your idea of what's intuitive and what's BIZARRE. Before extending this thread too long please ruminate on the recent parameter-passing thread, of which you are clearly aware. Let's try and create light rather than heat. regards Steve -- Steve Holden+1

Re: If your were going to program a game...

2009-01-02 Thread Steve Holden
. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing Excel spreadsheets

2009-01-02 Thread Steve Holden
like an intelligent approach. I hope this helps! I'm sure it will. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: why cannot assign to function call

2009-01-02 Thread Steve Holden
possibly happen, and often enough actually seem offended (or at least offensive) when it inevitably does happen... Generally speaking we try not to be offensive first on this list. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http

Re: Is there a better algorithm?

2009-01-02 Thread Steve Holden
: k, u, v = i print k, u, v regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Reverse order of bit in repeating seqence of byte string

2009-01-02 Thread Steve Holden
apologies to the group for sloppy typing. May not be any quicker, but it works: blues = buffer[0::3] greens = buffer[1::3] reds = buffer[2::3] result = .join(.join(x) for x in zip(reds, blues, greens)) regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC

Re: why cannot assign to function call

2009-01-02 Thread Steve Holden
Derek Martin wrote: On Fri, Jan 02, 2009 at 11:43:30AM -0500, Steve Holden wrote: Derek Martin wrote: [...] It's small wonder that neophytes try to cram Python behaviors into terms and computing concepts they already understand from learning other languages, and that they fail to do so

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Steve Holden
Ben Finney wrote: vk vmi...@gmail.com writes: If there were, I would expect it to conform with PEP 8 (get those ugly camelCase names outta there :-) haha, please forgive me. I'll try and think of some more creative names. They don't need to be creative; they merely need to conform with

Re: list iteration if statement

2009-01-02 Thread Steve Holden
is not int(0)', do you actually mean that a is not in integer with the value 0? Assuming you do then what you need is v = [[j for j in i if not j] for i in self.value] or, more pedantically v = [[j for j in i if j==0] for i in self.value] regards Steve -- Steve Holden+1 571 484 6266 +1 800

Re: list iteration if statement

2009-01-02 Thread Steve Holden
the None values because the append method returns None. regards Steve You guys rock, thanks for helping me learn python. On Sat, Jan 3, 2009 at 2:09 AM, Steve Holden st...@holdenweb.com mailto:st...@holdenweb.com wrote: alex goretoy wrote: Hello All, I'm doing

Re: list iteration if statement

2009-01-02 Thread Steve Holden
of lists of None. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: string in files

2008-12-30 Thread Steve Holden
are trying to achieve. Where a programmer is trying to create names dynamically there are usually better ways to proceed. Could you tell us a little more about what you are trying to do? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http

Re: Triple quoted string in exec function ?

2008-12-30 Thread Steve Holden
-- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: select.select and socket.setblocking

2008-12-30 Thread Steve Holden
code how self.stop_requested is supposed to change the result of its is_set() method. Maybe that's where the select() comes in? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo

Re: Python list's mail server in DNSBL ?

2008-12-30 Thread Steve Holden
; in bogusmx.rfc-ignorant.org /snip Is python.org really blacklisted? Any admin please, try to remove it. Thanks Laszlo -- http://mail.python.org/mailman/listinfo/python-list -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com

Re: Parsing Excel spreadsheets

2008-12-30 Thread Steve Holden
for storage into a relational database. It's also cross-platform, which means you don't need to run under Windows. I don't know anything at all about xlwt. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http

Re: Triple quoted string in exec function ?

2008-12-30 Thread Steve Holden
Stef Mientki wrote: ibpe...@gmail.com wrote: On Dec 30, 2:48 pm, Steve Holden st...@holdenweb.com wrote: Stef Mientki wrote: hello, I'm running scripts, with the execute function (Python 2.5), and it seems that triple quoted strings are not allowed. Is there a workaround

Re: embedding python in wxpython

2008-12-30 Thread Steve Holden
output to sys.stderr, if I remember rightly. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: math module for Decimals

2008-12-29 Thread Steve Holden
it up on SourceForge. I'm not sure why nobody has mentioned gmpy, except possibly because it advertises its alpha status and doesn't have many active developers. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http

Re: strange behavior of math.sqrt() in new 3.0 version

2008-12-28 Thread Steve Holden
and mathematics today. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: return in def

2008-12-28 Thread Steve Holden
I may use a nested method. Well, I suppose at least you aren't writing return None ... Normally a blank line or two suffices for me. Take a look at PEP 8 for some discussion for Python coding style. http://www.python.org/dev/peps/pep-0008/ regards Steve -- Steve Holden+1 571 484

Re: ftp design question

2008-12-28 Thread Steve Holden
connection built. Some suggestions? How about for file in download_files: try: self.ftp.retrbinary('RETR %s' % file, fileHandler) except KeyboardInterrupt: print file, transfer abandoned Then you can cancel a single file transfer with Ctrl/C. regards Steve -- Steve

Re: [SQL] Right way to set a variable to NULL?

2008-12-26 Thread Steve Holden
= '''INSERT INTO mytable (name,address,web,mail) VALUES (%s, %s, %s, %s)''' cursor.execute(sql, (name,address,web,mail)) Don't forget to call the connection's .commit() method to ensure the database changes are made permanent. regards Steve -- Steve Holden+1 571 484

Re: Multi-dimension list

2008-12-24 Thread Steve Holden
... return r ... m = k() m[1:2:3, 4:5:6] [slice(1, 2, 3), slice(4, 5, 6)] m[help!] ['h', 'e', 'l', 'p', '!'] As you can see, no exceptions are raised here, and the x:y:z notation introduces a slice object, which the code doesn't handle in any way shape or form. regards Steve -- Steve

Re: String Format Error.

2008-12-23 Thread Steve Holden
.html For a replacement that will work in 2.5, see the % sign as an operator (sometimes called string interpolation). regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

On Whose Desktop

2008-12-23 Thread Steve Holden
Thanks to Barry Warsaw the On Your Desktop blog now has a new entry: http://onyourdesktop.blogspot.com/ Who would you like to see profiled next? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http

Re: On Whose Desktop

2008-12-23 Thread Steve Holden
Fuzzyman wrote: On Dec 23, 12:06 pm, Steve Holden st...@holdenweb.com wrote: Thanks to Barry Warsaw the On Your Desktop blog now has a new entry: http://onyourdesktop.blogspot.com/ Who would you like to see profiled next? Guido (of course), Brett Cannon, Martin v Loewis, Jim Hugunin, Ted

Re: pseudo terminal usage from Python?

2008-12-23 Thread Steve Holden
a couple working examples (maybe one example each of reading and writing?) Look at the pexpect module - you can run interactive tasks through that. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http

Re: iterating initalizations

2008-12-23 Thread Steve Holden
to 24 instead. But you *are* correct about the need for a little more information ;-) regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: iterating initalizations

2008-12-23 Thread Steve Holden
D'Arcy J.M. Cain wrote: On Tue, 23 Dec 2008 10:20:59 -0500 Steve Holden st...@holdenweb.com wrote: D'Arcy J.M. Cain wrote: Well, if all you want is a loop: for v in vars: locals()[v] = [] Note that this isn't guaranteed to work. While locals() will return a dict containing

Re: New Python 3.0 string formatting - really necessary?

2008-12-22 Thread Steve Holden
is superior, then you figure out why. That's the way some people operate, but by no means all. Is it the language or the people that are pissing you off. You sound a little discontented for a c.l.py reader. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC

Re: Python's popularity

2008-12-22 Thread Steve Holden
knows how popular the various languages are, there are simply estimates with higher or lower credibility. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's popularity

2008-12-22 Thread Steve Holden
will hear the plonking of a hundred thousand newsreaders every time you post. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's popularity

2008-12-22 Thread Steve Holden
doesn't let his prejudices blind him to reality. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's popularity

2008-12-22 Thread Steve Holden
for the good laugh. Pot, meet kettle. Kettle: pot. -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python 3.0 string formatting - really necessary?

2008-12-21 Thread Steve Holden
by project needs. Rackspace, NASA, Canonical and many others are keen supporters of the language, and they put their money where their mouths are by incorporating it into their products. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http

Re: Read an image from a URL and write it to the browser

2008-12-21 Thread Steve Holden
javascript, and not the JPEG you were expecting. That's because the URL gives a 404 response. This might be a seasonal thing: right now they are showing a Happy Holidays motif on their front page. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http

Re: ANN: New Book: Programming in Python 3

2008-12-20 Thread Steve Holden
forget to point out that it's correct). PS Although Amazon.com still says the publication date is the 27th, they now expect to have it in stock on Monday (the 22nd). Congratulations. I know what a relief it is to see a project of that size come to fruition! regards Steve -- Steve Holden

Re: New Python 3.0 string formatting - really necessary?

2008-12-20 Thread Steve Holden
Stefan Behnel wrote: [...] I think '...'.format() makes sense given that we already have '...'.join(). Sure it does, but that doesn't stop a lot of people disliking str.join() regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http

Re: New Python 3.0 string formatting - really necessary?

2008-12-20 Thread Steve Holden
r wrote: On Dec 19, 10:04 pm, Steve Holden st...@holdenweb.com wrote: r wrote: Thanks Steven, We need a real Pepsi challenge here to show the insignificance of this change. I am not against change. But when we lose something as - compact- as %formating i'm going to want to see a damn good

Re: WAGs on when django will use Python 3.0?

2008-12-20 Thread Steve Holden
walterbyrd wrote: Will Django be primarily using Python 3.0 one year from now? Two years from now? I doubt they will drop 2.X support in the next two years. 3.0 will likely be supported fairly fully in the next year. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119

Re: Python is slow

2008-12-20 Thread Steve Holden
is interested. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: New Book: Programming in Python 3

2008-12-19 Thread Steve Holden
^ and also teaches Python’s functional programming features ^ The book’s approach is wholly practical ^ It always has been valid English. The apostrophe is only omitted from personal pronouns (hers, its, and so on). regards Steve -- Steve Holden+1

Re: New Python 3.0 string formatting - really necessary?

2008-12-19 Thread Steve Holden
is a function reference followed by an empty tuple. It might *look* like that, but it isn't. Otherwise we'd write a function call with one argument as f(a, ) - which readers will have noticed we don't. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http

Re: ANN: New Book: Programming in Python 3

2008-12-19 Thread Steve Holden
Colin J. Williams wrote: Steve Holden wrote: Thomas Heller wrote: [...] Question from a non-native english speaker: is this now valid english? One of Python’s great strengths ^ and also teaches Python’s functional programming features

Re: New Python 3.0 string formatting - really necessary?

2008-12-19 Thread Steve Holden
it. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: New Python 3.0 string formatting - really necessary?

2008-12-19 Thread Steve Holden
the developers to be psychic? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Minor Typo in doc

2008-12-18 Thread Steve Holden
Should I make a bug report in http://bugs.python.org? Yes. The documentation give you a link to follow from the bottom of each page. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org

Re: psycopg2 and large queries

2008-12-18 Thread Steve Holden
in the database itself. Hmm, pypgsql doesn't provide a 2.5 Windows installer. I take it you aren't a Windows user ... ? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: confused about __str__ vs. __repr__

2008-12-18 Thread Steve Holden
throwing away useful information. The only people who would want to see a representation of a data structure such as a list are programmers: if you want to show a list of values to a regular user you format it in some required way. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494

Re: regex problem ..

2008-12-17 Thread Steve Holden
Analog Kid wrote: Hi guys: Thanks for your responses. Points taken. Basically, I am looking for a combination of the following ... [^\w] and %(?!20) ... How do I do this in a single RE? Thanks for all you help. Regards, AK On Mon, Dec 15, 2008 at 10:54 PM, Steve Holden st

Re: getting object instead of string from dir()

2008-12-17 Thread Steve Holden
. Matlab is a very specific environment, and students have told me that there are pieces of its IDE that they really miss in Python, so this work may result in something that attracts more users to Python. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC

Re: tricky nested list unpacking problem

2008-12-16 Thread Steve Holden
,[1, 2, 3, 4, 5 ]]]) flattened [1, 2, 3, 5, 6, 10, 11, 7, 9, 1, 2, 3, 4, 5] '-'.join(str(num) for num in flattened) '1-2-3-5-6-10-11-7-9-1-2-3-4-5' Read the problem description again ... regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http

Re: Python Dictionary Algorithm Question

2008-12-16 Thread Steve Holden
to find information on it? Thanks. Look in http://svn.python.org/view/python/tags/r26/Objects/ for dictnotes.txt and dictobject.c. Good luck with the class! regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http

Re: Looking for the best way to translate an idiom

2008-12-15 Thread Steve Holden
your yours they them their theirs regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: alt.possessive.its.has.no.apostrophe

2008-12-15 Thread Steve Holden
in this way also. Is that about right? Just think of them as nounpros and you won't go wrong. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: alt.possessive.its.has.no.apostrophe

2008-12-15 Thread Steve Holden
Tim Chase wrote: Steve Holden wrote: This led to a schism between the British and the newly-independent Americans, who responded by taking the u out of colour, valour, and aluminium. Darn Americans and their alminim ;-) Next thing you know, they'll be putting an I in TEAM.[1] It's

Re: regex problem ..

2008-12-15 Thread Steve Holden
that each element is a sequence of zero or more character, where character is either letter/digit or escape. So you would use a pattern like ([a-zA-Z0-9]|%[0-9a-f][0-9a-f])+ regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com

Re: %s place holder does not let me insert ' in an sql query with python.

2008-12-15 Thread Steve Holden
apostrophes. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for the best way to translate an idiom

2008-12-14 Thread Steve Holden
Bruno Desthuilliers wrote: [...] if you only want the first returned value, you can just apply a slice: def f(): return 1,2,3 a = f()[0] + 1 nitThat isn't a slice, it's indexing/nit regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC

Re: __future__ and compile: unrecognised flags

2008-12-13 Thread Steve Holden
between 2.x and 3.x. If it doesn't, it should probably be made to. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: File names, character sets and Unicode

2008-12-12 Thread Steve Holden
to cause pain until all file systems are standardized on a particular encoding of Unicode. Probably only about another fifteen years to go ... regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org

Re: How to write binary data to file and socket

2008-12-12 Thread Steve Holden
.x, use the struct module to convert your data to a string, then write that. In Python 3.x you would use the bytes type. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python

Re: Removing None objects from a sequence

2008-12-12 Thread Steve Holden
five regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: var or inout parm?

2008-12-12 Thread Steve Holden
along ... regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: var or inout parm?

2008-12-12 Thread Steve Holden
or should not do. It makes it sound as though you can wave a magic wand to achieve the desired behavior. The interpreter should not have a GIL. The tuple should check that it is actually being mutated. How? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC

Re: concept of creating structures in python

2008-12-12 Thread Steve Holden
. these are two structures. I want to refer D structure in L one and use it. I want to access the value of D structure like L.D.index = 0. [...] regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org

Re: var or inout parm?

2008-12-12 Thread Steve Holden
sturlamolden wrote: On Dec 12, 3:54 pm, Steve Holden st...@holdenweb.com wrote: [...] The interpreter should not have a GIL. The tuple should check that it is actually being mutated. How? In Python it would be something similar to: def __setitem__(self, index, value): if _buf[index

Re: Removing None objects from a sequence

2008-12-12 Thread Steve Holden
? foo is not None is actually surprising to me, since not None is True. 0 is True is False, but 0 is not None is True. Why is that? is not is an operator, so the parse is foo (is not) None not foo is (not None) regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden

Re: var or inout parm?

2008-12-12 Thread Steve Holden
sturlamolden wrote: On Dec 12, 5:13 pm, Steve Holden st...@holdenweb.com wrote: It should be the tuple's __setitem__ that was invoked here, not __iadd__, or the parser is faulty. OK, so now you are proposing to alter the parser, and possibly the implementation of the INPLACE_ADD opcode

Re: concept of creating structures in python

2008-12-12 Thread Steve Holden
Joe Strout wrote: On Dec 12, 2008, at 9:00 AM, Steve Holden wrote: Change the default value of ds_obj here to None. Otherwise, you will certainly confuse yourself (there would be just one default object shared among all instances). Joe missed a piece out here. If you change the signature

Re: newbie question: if var1 == var2:

2008-12-11 Thread Steve Holden
leading or trailing spaces if those are important to you. ... and it's so hard to write item = item[:-1] regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Rename of .mdb file -- lock

2008-12-11 Thread Steve Holden
, the top one worked. The reason the second one didn't work is because \t is the tab character. Look for raw strings in the documentation. rC:\TEMP\test1.mdb should work. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com

Re: how to convert '\xf0' to 0xf0 ?

2008-12-11 Thread Steve Holden
' hex(240) '0xf0' So just apply the ord() function to the character and you'll get its integer value! regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert '\xf0' to 0xf0 ?

2008-12-11 Thread Steve Holden
...@gmail.com wrote: Hi, ord('\xf0') works and it only works for char. Do you know any way to convet '\xf0\xf0' and '\xf0\xf0\xff\xfe' to integer? Br, Chen Gang On Dec 12, 12:40 pm, Steve Holden st...@holdenweb.com wrote: chengang.beij...@gmail.com wrote: '\xf0' is the value read from

Re: get todays files

2008-12-10 Thread Steve Holden
this, but it is quite important to me, so all help is highly appreciated! IIRC there's an ftpmirror script in the Tools directory (if you're on Windows - Linux/Unix users have to download the source). I adapted it to several different purposes. regards Steve -- Steve Holden+1 571 484 6266 +1 800

Re: SequenceMatcher bug ?

2008-12-10 Thread Steve Holden
not sure how gentoo would have patched their 2.5.2 when the bug, if 2.6 still contains it. I find it strange that try-python gives one person a different result from everyone else. What is this bizarre influence on web sites? regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119

Re: get todays files

2008-12-10 Thread Steve Holden
Andrew D wrote: On Dec 10, 5:55 pm, Steve Holden [EMAIL PROTECTED] wrote: Andrew D wrote: I have a script that will login to my ftp server and download all the backup files, but I want it to only download the files that were created today, e.g. if I ran the script today I want it to only

Re: what's so difficult about namespace?

2008-12-09 Thread Steve Holden
Xah Lee wrote: [...] Steve Holden wrote: And therein lies the danger of imagination. Typically the namespace components are looked up one by one, so for this.that.theother first this will be looked up and (hopefully) yield an object with a namespace, which will then be searched

Re: Python LEGO Mindstorm control...

2008-12-09 Thread Steve Holden
posted to a mailing list, not an individual, right? There's no evidence that Toni Meyer will see your message. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Do more imported objects affect performance

2008-12-02 Thread Steve Holden
is *much* more important that learning to write fast Python, and often the two coincide anyway. It was true when Kernighan and Plauger wrote it forty years ago and it's true now: First, make it work. Then, *if it doesn't work fast enough*, make it work faster. regards Steve -- Steve Holden+1

Re: Tkinter and asyncronous socket

2008-11-26 Thread Steve Holden
be a reliable means of communication. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python surpasses Perl in popularity?

2008-11-26 Thread Steve Holden
temporarily. Python has been around the 6/7 mark for a while now. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get a directory file descriptor?

2008-11-26 Thread Steve Holden
denied: f = os.open(os.path.abspath(Documents), os.O_RDONLY) Traceback (most recent call last): File stdin, line 1, in module OSError: [Errno 13] Permission denied: 'C:\\Users\\sholden\\Documents' regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC

Re: Pyhon (with wxPython) on Windows' cygwin: can it be done fully ?

2008-11-26 Thread Steve Holden
command line? You can, of course, continue to use Cygwin for editing and command-line Python. But you seem to be asking for trouble unnecessarily by running Windows Python under Cygwin. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http

Re: what's so difficult about namespace?

2008-11-26 Thread Steve Holden
it out, yes, I know PHO now (finally) has namespaces. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python surpasses Perl in popularity?

2008-11-26 Thread Steve Holden
of language popularity, however you define that. [... rant omitted ...] I wondered how long you would be able to resist making your vituperative remarks. Please stop this rubbish. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http

Re: initialized list: strange behavior

2008-11-25 Thread Steve Holden
. [...] Python is pass-by-reference, not pass-by-value. It's certainly not pass-by-reference, nor is it pass-by-value IMHO. Since no lists are being passed as arguments in these examples it's not pass-by-anything. Jump off that horse right now! regards Steve -- Steve Holden+1 571 484

Re: My first Python program -- a lexer

2008-11-24 Thread Steve Holden
in a dict and once in a list doesn't duplicate the data, since both structures will (optimally: i.e. if you do it right) refer to the same data objects. Generally speaking, do what's convenient to do as a programmer, and work on it if there are serious inadequacies. regards Steve -- Steve Holden

Re: for loop specifying the amount of vars

2008-11-24 Thread Steve Holden
the list and turn it into separate arguments. Fortunately os.path.join will take as many arguments as you care to pass it: os.path.join(*dirs) 'c:\\temp\\foo\\bar' regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com

<    5   6   7   8   9   10   11   12   13   14   >