Re: Incrementing letters

2005-05-31 Thread Dan Sommers
On 27 May 2005 10:52:36 -0400, Dan Sommers [EMAIL PROTECTED] wrote: And use string.ascii_letters[ 1 : ] + string.ascii_letters[ 0 ] for the second parameter to string.maketrans. Oops. Thank you Duncan and Rocco for correcting my mistake. Regards, Dan -- Dan Sommers http

Re: Incrementing letters

2005-05-27 Thread Dan Sommers
for string.maketrans And use string.ascii_letters[ 1 : ] + string.ascii_letters[ 0 ] for the second parameter to string.maketrans. Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ -- http://mail.python.org/mailman/listinfo/python-list

Re: __init__() not called automatically

2005-05-26 Thread Dan Sommers
On 25 May 2005 21:31:57 -0700, Sriek [EMAIL PROTECTED] wrote: Similarly, why do we have to explicitly use the 'self' keyword everytime? Why do they (the C++ programmers) prepend m_ to otherwise perfectly good member names? Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan

Re: Q: ...Learning with Python ...a property that addition and multiplication have...

2005-05-25 Thread Dan Sommers
of multiplcation over addition does not translate to a distributive property of repetition over concatenation: 2 * ( 3 + 4 ) == 14 2 * 3 + 2 * 4 == 14 but 2 * ( ABC + DEFG ) == ABCDEFGABCDEFG 2 * ABC + 2 * DEFG == ABCABCDEFGDEFG Regards, Dan -- Dan Sommers http

Re: Convert from numbers to letters

2005-05-19 Thread Dan Sommers
, 27 ) Now if we really want some bonus points.. a=1, b=2, c=3 ... z=26 aa=27 ab=28 etc.. It's still one line, following the pattern from above, just longer. Now why do you want to do this? Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ -- http://mail.python.org/mailman

Re: speeding up Python script

2005-05-18 Thread Dan Sommers
know for sure.) But a better-than-an-exhaustive-search algorithm sounds like a good idea, too. Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ -- http://mail.python.org/mailman/listinfo/python-list

Re: question about the id()

2005-05-17 Thread Dan Sommers
): pass a = A( ) m = a.method # optimize runtime lookups for a.method for x in range( 10 ): m( ) Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ -- http://mail.python.org/mailman/listinfo/python-list

Re: function with variable arguments

2005-05-13 Thread Dan Sommers
stop = start start = 1 # rest of function goes here HTH, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Polymorphism

2005-05-12 Thread Dan Sommers
the power of polymorphism to modelate the problem. Polymorphism in Python is a solution looking for a problem. Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ -- http://mail.python.org/mailman/listinfo/python-list

Re: [PyQt] browse for a directory

2005-05-10 Thread Dan Sommers
On 10 May 2005 16:49:25 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: But I can't find any Qt widget that enables me to browse for a directory! ... Try QFileDialog.getExistingDirectory. HTH, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ -- http://mail.python.org/mailman/listinfo

Re: How to generalize a function?

2005-04-24 Thread Dan Sommers
to Python. So just use generic names: for line in conf: if regex.search( line ) theLine = line theLineNum = conf.index( theLine ) etc. HTH, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ c = 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: Slight discrepancy with filecmp.cmp

2005-04-18 Thread Dan Sommers
debugging your brain, but since I would like to remain married, I will not make it. :-/ Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ c = 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a very specific type of embedded GUI kit

2005-04-12 Thread Dan Sommers
-- Dan Sommers http://www.tombstonezero.net/dan/ c = 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: Are circular dependencies possible in Python?

2005-04-09 Thread Dan Sommers
A - or is that not possible? Perhaps if you can post a minimal example that shows us what you're running into, someone here will know how to help. HTH, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ c = 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: Version Number Comparison Function

2005-03-25 Thread Dan Sommers
version (e.g. 1.0rc4 becomes 1.0), that you may have to know something more about where you particular version numbers come from. Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ c = 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Dan Sommers
the two cases (accumulating scalars vs. accumulating a list), though. Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ c = 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Dan Sommers
On Sat, 19 Mar 2005 15:17:59 GMT, Raymond Hettinger [EMAIL PROTECTED] wrote: [Dan Sommers] Curious that in this lengthy discussion, a method name of accumulate never came up. I'm not sure how to separate the two cases (accumulating scalars vs. accumulating a list), though. Separating

Re: [OT] Who Knows of a Good Computational Physics Textbook?

2005-03-16 Thread Dan Sommers
Thank you beliavsky, Sean, and Scott for the pointers. Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ c = 1 -- http://mail.python.org/mailman/listinfo/python-list

[OT] Who Knows of a Good Computational Physics Textbook?

2005-03-13 Thread Dan Sommers
aspects of the course. If you know of some place I can go in order to find the right questions to ask (and possibly the right place to ask them!), then don't be afraid to let me know that, too. Thanks, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ c = 1 -- http://mail.python.org

Re: accessor/mutator functions

2005-03-01 Thread Dan Sommers
to the particular (ab)uses of C++ involved. Really, of course, the only things you need to make explicit are the ones that readers don't understand :-) +1 QOTW We used to have holy wars over the appropriate level of comments in source code. Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan

Re: accessor/mutator functions

2005-03-01 Thread Dan Sommers
interface. I wish I'd said it that well in the first place myself. :-) Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ c = 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: accessor/mutator functions

2005-02-28 Thread Dan Sommers
-- Dan Sommers http://www.tombstonezero.net/dan/ c = 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: accessor/mutator functions

2005-02-28 Thread Dan Sommers
On Tue, 01 Mar 2005 01:39:13 +0100, Thomas Lotze [EMAIL PROTECTED] wrote: Dan Sommers wrote: I think I'd add a change_temperature_to method that accepts the target temperature and some sort of timing information, depending on how the rest of the program and/or thread is structured

Re: accessor/mutator functions

2005-02-28 Thread Dan Sommers
On Tue, 01 Mar 2005 02:27:03 GMT, Andrew Dalke [EMAIL PROTECTED] wrote: Me: What's wrong with the use of attributes in this case and how would you write your interface? Dan Sommers: I think I'd add a change_temperature_to method that accepts the target temperature and some sort of timing

Re: python2.4 generator expression python2.3 list expression

2005-02-22 Thread Dan Sommers
, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ c = 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: python2.4 generator expression python2.3 list expression

2005-02-21 Thread Dan Sommers
glance (and even second and third glance), but nearly idiomatic to those of us who spent lots of time writing embedded assembly code. If you have the space to spare, a lookup table (pre-calculated or created during your program's initialization) is probably the best way to go. Regards, Dan -- Dan

Re: Access to formatting controls from within __repr__ or __str__?

2005-02-18 Thread Dan Sommers
On 18 Feb 2005 01:25:06 -0800, Serge Orlov [EMAIL PROTECTED] wrote: Dan Sommers wrote: So my question is: Is there a way to pass options through a format string to the __str__ and __repr__ functions? For example, can I define my own alternate form for use with the '#' formatting character

Access to formatting controls from within __repr__ or __str__?

2005-02-17 Thread Dan Sommers
, but that solution makes me cringe. Thank you, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ Never play leapfrog with a unicorn. -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI, anydbm.open() and linux file permissions

2005-01-11 Thread Dan Sommers
-- Dan Sommers http://www.tombstonezero.net/dan/ Never play leapfrog with a unicorn. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuples use parentheses ()'s instead of something else like 's?

2004-12-29 Thread Dan Sommers
] well-known Adobe SNAFU. (A quick google search or two failed to find an authoritative reference, but I know that such references are out there somewhere.) Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ Never play leapfrog with a unicorn. -- http://mail.python.org/mailman

Re: DB-API format string conventions

2004-12-28 Thread Dan Sommers
be separate from what have fallen by the wayside. So ... anybody for a DB-API 2.1 with mandatory pyformat support and a tuple dbmodule.paramstyles for supported styles? I'd be all for that, but I'm not holding my breath. ;-) Regards, Dan -- Dan Sommers http://www.tombstonezero.net/dan/ Never play

<    1   2   3   4   5