Re: an enumerate question

2007-03-21 Thread Terry Hancock
line, e.g.: for n,curr in enumerate(open("file")): if n>1: print n,curr print m,prev m,prev = n,curr Of course, if the file isn't so big, then you could use readlines as you mention. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spacewo

Re: Project organization and import

2007-03-06 Thread Terry Hancock
of tests using objects which are dumbed-down versions of objects which are really supposed to be provided from another module -- but I wanted to test the two separately (which is essentially creating my own mock objects from scratch). HTH, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: imagemagick

2007-03-01 Thread Terry Hancock
u might want to consider writing your own wrapper (perhaps using ctypes, now that it is included in the standard library). I have used 'popen' to run it as a separate process in the past. The 'subprocess' module would be the smart way to do that today, and that might be your

Re: Thoughts on using isinstance

2007-01-26 Thread Terry Hancock
for functionality (e.g. presence of necessary methods) rather than specific inheritence. Using "isinstance" is one of those practices that can really help in quick testbed code or in a prototype, but you usually want to take it out later. Cheers, Terry -- Terry Hancock ([EMAIL PROTECT

Re: Clarify Regex in Python.

2006-09-12 Thread Terry Hancock
y Problem is, I want to know how can I force match functions to > match the pattern any location in the subject. i.e I want to turn off > before said behaviour. re.match = re.search perhaps? Stupid thing to do, but it meets the spec. Cheers, Terry -- Terry Hancoc

Re: Can I make unicode in a repr() print readably?

2006-09-11 Thread Terry Hancock
Martin v. Löwis wrote: > Terry Hancock schrieb: > > Or, put another way, what exactly does 'print' do when it gets a > > class instance to print? It seems to do the right thing if given a > > unicode or string object, but I cant' figure out how to make

Can I make unicode in a repr() print readably?

2006-09-09 Thread Terry Hancock
ried returning the same thing from __repr__, but the latter causes this unpleasant result: >>> print jp.concepts['adjectives']['BLUE'][0] Traceback (most recent call last): File "", line 1, in ? UnicodeEncodeError: 'ascii' c

Re: Unable to make python work properly

2006-09-09 Thread Terry Hancock
package managers have probably done the work for you). I only say 'probably' because I'm guessing this from knowing Debian, which Ubuntu is based on, and guessing that no one would go out of their way to *remove* readline support. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anan

Re: audio with graphics

2006-08-30 Thread Terry Hancock
imedia library (like PyGame, for example). The platform you are running on may matter too (Windows, Mac, Linux, etc). Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a good idea or a waste of time?

2006-08-28 Thread Terry Hancock
g an addition or by looking for th __add__ method. But then, if you need addition support, then your code probably already has an addition, so why not just let it fail there?). So be more minimal and throw in checks for specific problems -- especially the ones that would cause a wrong result rather t

Re: don't need dictionary's keys - hash table?

2006-07-12 Thread Terry Hancock
s only efficient if collisions are rare. I am a little surprised that hash(hash(s)) == hash(s), is that actually true? Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: style question

2006-07-04 Thread Terry Hancock
the input and isn't aligned there. There's this approach, too: from textwrap import dedent message = dedent( """ This is line1. This is line2 This is line3 "

Re: For a fast implementation of Python

2006-07-04 Thread Terry Hancock
;RPython" part in Javascript, then use the PyPy project to fill in the rest? That way, you don't even have to maintain most of it. http://codespeak.net/pypy/dist/pypy/doc/news.html Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com

Re: "Next Generation Artificial Intelligence, Artificial Mind - Part One - Basic Architecture and Cognitive Structure"

2006-07-04 Thread Terry Hancock
the merits and be worth a look, but I think it's actually a 'phish'. Sigh. Too bad. I like reading crackpot AI theories now and then. Cheers, Terry *By which I really just mean an "unreviewed crackpot theory", since, with the state of the art being what it is, pretty m

Re: Out of the box database support

2006-07-04 Thread Terry Hancock
Alex Martelli wrote: > Terry Hancock <[EMAIL PROTECTED]> wrote: ... > > Although, I confess to ignorance on what a "snark" is or whether > > http://www.gutenberg.org/etext/13 "The Hunting of the Snark" by Lewis Caroll Of course! I've heard of it,

Re: list comprehension

2006-07-03 Thread Terry Hancock
obvious in meaning (or about which the reader needn't be concerned with the meaning). One nice thing about them, as one-liners: you can paste a list comp into an interactive python session, and -- if you've set up some test data -- you can just see what it does by trying it. Some people

Re: Out of the box database support

2006-07-03 Thread Terry Hancock
quot;VPSLand", BTW). I don't suppose anyone has better options? I was looking for somebody that would let me run Debian on a VPS. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about OSS projects.

2006-06-28 Thread Terry Hancock
grated tool based on them. Maybe there's somebody who'd be willing to do that, but doesn't know where the material is. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Verify PyProtocols interfaces?

2006-06-27 Thread Terry Hancock
of hard to google for, because all the relevant words are too common. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple question regarding module initialization

2006-06-20 Thread Terry Hancock
s no fundamental reason why it is more secure, though (the usual complaint about exec), because you are in complete control of what exec is being fed. However, I'd still recommend __import__ for clarity. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is fun (useless social thread) ;-)

2006-06-20 Thread Terry Hancock
though I still stay at home, I have a full time writing workload now, and it's become a little difficult to find enough time for programming. Once again, though, Python's ease of readability really helps me to pick up where I left off when I have to do that (which is a lot). Cheers, T

Re: An oddity in list comparison and element assignment

2006-06-02 Thread Terry Hancock
can "get too close and be 'sucked in' by a strong gravity field", or that things are "weightless" in orbit, because they're "too far from the Earth's gravity". Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: An oddity in list comparison and element assignment

2006-06-02 Thread Terry Hancock
le your money, technically ;-)). I don't think there's any way to make it "more logical" -- it's going to break somewhere no matter what assumption you make, so you just have to learn what's really going on in order to avoid confusion. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Python Editor

2006-06-01 Thread Terry Hancock
Fredrik Lundh wrote: > "Manoj Kumar P" wrote: > > Can anyone tell me a good python editor/IDE? > emacs! [...] Fredrik Lundh wrote: > "Manoj Kumar P" wrote: > > Can anyone tell me a good python editor/IDE? > vim! There is much truth in this ma

Re: graphs and charts

2006-05-23 Thread Terry Hancock
Yaron Butterfield wrote: > What's the best way to on-the-fly graphs and charts using Python? Or > is Python not really the best way to do this? I quite enjoyed using Biggles for this: http://biggles.sf.net There are many different choices, though. Cheers, Terry -- Terry Hanc

Re: import woe

2006-05-19 Thread Terry Hancock
ited form of Zope acquisition type behavior: sys.path = ['.', '../', '../../', '../../../'] + sys.path I'm looking forward to the introduction of relative imports in 2.5, though. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spacework

Re: number of different lines in a file

2006-05-19 Thread Terry Hancock
ect that there were as many as a million duplicates for some messages in that file. Would the generator version above have helped me out, I wonder? Unfortunately, I deleted the file, so I can't really try it out. I suppose I could create synthetic data with the logging mod

Re: python vs perl lines of code

2006-05-19 Thread Terry Hancock
unlocked. Cheers, Terry *In the same email, no less. This is of course an extreme example, but there are *loads* of merely irritating behaviors like trolling. -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: python vs perl lines of code

2006-05-18 Thread Terry Hancock
ses?* ;-) ). It would frankly be harder for me to remember the extra mechanics than to just type the extra letters. The claim is ironic -- even counter-intuitive -- considering this conventional lore. But the real point is that no one here can make any reasonably objective assessment of wheth

Re: Using python for a CAD program

2006-05-18 Thread Terry Hancock
actions are bad for CAD -- they may have a different semantic role and the needed granularity may be different, but the need to roll data back to an earlier revision is just as present in drawings as it is for code or financial transactions. Cheers, Terry -- Terry Hancock ([EMAIL PR

Re: Tabs versus Spaces in Source Code

2006-05-17 Thread Terry Hancock
F-8 has fully supplanted it inside of 10 years. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs are EVIL *and* STUPID, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-17 Thread Terry Hancock
w if you're talking about the conversion altering the data's semantics, >that's a separate issue that has nothing to do with unix utilities and >everything to do with the file formatting. In that case, I'll simply refer >you to the rest of this thread for di

Re: basic python programing

2006-05-03 Thread Terry Hancock
irly common practice in an explicit flat-thread environment like PHP BB. I'm not sure it's particularly smart there either, but that is likely where he learned it. Either that or it's yet another email virus. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Find similar images using python

2006-03-31 Thread Terry Hancock
Thomas W wrote: >How can I use python to find images that looks quite similar? Thought >I'd scale the images down to 32x32 and convert it to use a standard >palette of 256 colors then compare the result pixel for pixel etc, but >it seems as if this would take a very long time to do when processing

Re: Python plug-in

2006-03-31 Thread Terry Hancock
toto wrote: >I'm trying to find some howto, tutorial in order to create a python program >that will allow plug-in programming. I've found various tutos on how to >write a plug-in for soft A or soft B but none telling me how to do it in my >own programs. Do you have any bookmarks ? > > There is m

Re: a hobbyist's dilemma

2006-03-30 Thread Terry Hancock
You may find the attached files of interest. I wrote this PyGame script in order to teach my sons (ages 8 & 10) about some programming concepts. I intentionally avoided any function or class definitions, and tried to use minimal Python concepts. I think it's quite impressive that you can do a

Re: Getting a loop to activate a loop above it

2006-03-22 Thread Terry Hancock
exactly what happens, and I think so would a "naive" user. My impression is that you imagine you are writing "rules" instead of a "program". That's such an odd expectation, I am curious what led you to think that way. Do you have prior experience with i

Re: doctest, unittest, or if __name__='__main__'

2006-03-21 Thread Terry Hancock
ified from their text output). When you get into stickier stuff like graphics and web programming, the formal structure of pyunit can be easier to adapt than something which is intrinsically based on string processing. Haven't seen py.test before, but I'm looking now -- thanks for the link. :

Re: Importing an output from another function

2006-03-17 Thread Terry Hancock
urse, it's possible that the function requires the arguments in a different order, e.g.: x, y = random_point(1,80,1,25) set_rowcol(y, x, 'A') or some such thing. By far the coolest thing about tuple-unpacking, though, is that this works like you'd expect it to: x, y = y, x

No module named glade?

2006-03-17 Thread Terry Hancock
at might get tripped up?). AFAIK, I haven't touched this installation, so whatever is going on is the result of the Debian installer (or at least I think that's true). It is the "unstable" branch, though. I hope I've provided enough information -- like I

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-16 Thread Terry Hancock
ts I use it. Maybe we an adopt it as > > standard-tool. > > Epydoc seems to be "dead" and pudge not yet alive: What leads you to this conclusion? Works pretty well for me. Maybe it's just "stable"? -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Cheese Shop: some history for the new-comers

2006-03-16 Thread Terry Hancock
t. It's still ambiguous, but less > so. And I can't think of anything better. ;) Since I just said almost that independently on an earlier thread, I guess that makes me +1 on "Core Development" (or "Core Developers") myself. -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Cheese Shop: some history for the new-comers

2006-03-16 Thread Terry Hancock
e core. People who "develop using Zope" are (still, I think) underrepresented -- there never was a "product developer" or "component developer" mailing list, I don't think. In that context, some people use a term like "Core Developer". It seems a little redundant to me, but perhaps it would be less ambiguous? -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it better to use class variables or pass parameters?

2006-03-16 Thread Terry Hancock
lts. Then, of course, the peptide sequence *IS* a fundamental property of the object. If you have to separate this functionality into a separate object, you should immediately be asking yourself "why"? Is there a compelling reason you need *two* objects that have to communi

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-14 Thread Terry Hancock
re between 2.x and 3.x with bugs that make it fairly unusable. What would be cool is if some of happydoc's unique features were ported to epydoc (such as getting information from comments as well as docstrings). -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Please, I Have A Question before I get started

2006-03-14 Thread Terry Hancock
On Mon, 13 Mar 2006 02:19:39 GMT Skipper <[EMAIL PROTECTED]> wrote: > Basically the program will blank the screen and call up > (for example) 6 pictures. A flashing border with travel > from picture to picture. When the computer senses a mouse > click it will clear the screen and present a second

Re: Very, Very Green Python User

2006-03-13 Thread Terry Hancock
have 'em, or you aren't doin' OOP 3) total hogwash -- I can use compiler directives to defeat C++/Java "private" variables anyday, so it doesn't accomplish anything that isn't easier to do by putting "__" in front of it to tell the client

Re: PEP 8 example of 'Function and method arguments'

2006-03-13 Thread Terry Hancock
; is just as welcome of course), preferably in a short code > example? In short, if you don't know what it is, you don't need it. ;-) So far, the only time I've ever encountered this is with the __new__ method, which, being a classmethod, needs "cls" (which gets loaded

Re: Cross Module Command Useage

2006-03-13 Thread Terry Hancock
e, so I put them in one module (or sub-package), usually named "utility" or "constants" which are imported by all modules, and then there's usually a top or "main" module which drives everything else. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: put multiple condition in if statement

2006-03-11 Thread Terry Hancock
perators are words 2) don't overload standard type names this is actually better style: if s not in (' ', ''): -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Speed of data structures in python

2006-03-10 Thread Terry Hancock
t -- but moving from image to surface is typically slow, no matter how spiffy your image format may be internally. I suspect something similar applies to PyOpenGL. -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: why no block comments in Python?

2006-03-10 Thread Terry Hancock
On Sat, 11 Mar 2006 10:23:56 +1100 "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > On Thu, 09 Mar 2006 18:02:27 -0600, Terry Hancock wrote: > > > On 9 Mar 2006 07:21:00 -0800 > > "msoulier" <[EMAIL PROTECTED]> wrote: > >> > (and

Re: Python Evangelism

2006-03-10 Thread Terry Hancock
is* PyCON going to be in Texas next year? I wasn't sure what would happen, since it was in Washington DC the last (first?) 3 years, according to the website. Would be great for me if true, since I live there. -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpac

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Terry Hancock
not uncommon, of course, to use "None" for this purpose. I have a lot of code that does something like: def myfunc(a, b, c): if a is None: a = [] ... -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to have a for-loop index?

2006-03-10 Thread Terry Hancock
in enumerate(elementList): print "myElement ", myElement, " at index: ",elementIndex -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Evangelism

2006-03-10 Thread Terry Hancock
On Thu, 9 Mar 2006 19:33:38 -0500 "Thomas G. Willis" <[EMAIL PROTECTED]> wrote: > On 3/9/06, Terry Hancock <[EMAIL PROTECTED]> > wrote: > > > > On Thu, 9 Mar 2006 10:33:12 -0500 > > "Thomas G. Willis" <[EMAIL PROTECTED]> wrote: > &g

Re: Python Evangelism

2006-03-09 Thread Terry Hancock
Even now I'm wondering if some filter is going to kill this message. Anyway, "python" could theoretically apply the "bad=good" marketing, although something venomous would probably be more effective. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: why no block comments in Python?

2006-03-09 Thread Terry Hancock
ere the memory use would be an issue anyway. The whole point of block-commenting code out is to temporarily "delete" it without having to use your version control system to get it back. You only do that when you have strong feeling you're going to need to put it b

Re: why no block comments in Python?

2006-03-08 Thread Terry Hancock
a smarter way to do this, but I was putting several of them in a module docstring, and it gets to be a 100+ lines or so of doctest plus explanations. I'm thinking this might be a use-case for the new support for doctests in a separate file. Or maybe I just need to see if I can move the tests int

Re: Interfacing with the command line

2006-03-08 Thread Terry Hancock
pening Firefox for me? You have several options, depending on how you want to communicate with it, and what version of Python you are using. Keywords: os.system popen subprocess Search the Library Reference. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) An

Re: Learning different languages

2006-03-07 Thread Terry Hancock
en making sprites for a future game for a long time now and are getting pretty good at that part). So, I don't think you'll have a real problem with it. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Any advantage in LISPs having simpler grammars than Python?

2006-03-07 Thread Terry Hancock
. ;-) I think experienced Lisp programmers must learn to visually parse the *words* in the Lisp program to determine the structure, but I find that really unhelpful, myself. Remember that you *can* represent your program with nothing but two characters, "0" and "1" --

Re: Python as an extension language

2006-03-07 Thread Terry Hancock
, please > install my little EXE and this 10MB Python MSI for > scripting it". If your C++ file is so small, then maybe you should not embed a Python interpreter in it, but rather allow it to be compiled as a Python module. Just write a Pyrex or Python C/API wrapper for it, and include

Re: setting PYTHONPATH

2006-03-07 Thread Terry Hancock
hen you will have to do explicit imports of sub-modules: spam/ __init__.py ham.py eggs.py requires explicit imports of ham and eggs modules: >>> import spam >>> import spam.ham >>> import spam.eggs Although these things are all interesting, they are not c

Re: Python advocacy in scientific computation

2006-03-04 Thread Terry Hancock
In fact, this expression has so many echoes on the web, it would be difficult to ascertain where it actually came from (the derivation is obvious, of course, but who first coined the expression?). -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy immutability in python?

2006-03-04 Thread Terry Hancock
x27;s the most practical solution for this problem). 3) Is there a "remarkably clever" way that I can tack on, even if it isn't exactly simple? and only in the unlikely event that answers 1-3 are all "no", would I ask: 4) And as a last resort, if it really i

Re: Easy immutability in python?

2006-03-04 Thread Terry Hancock
Whoops I forgot to list the reference. Also, I just finished reading the old thread, so I see some damage-control may be needed. On Sat, 4 Mar 2006 11:52:59 -0600 Terry Hancock <[EMAIL PROTECTED]> wrote: > [1] > http://news.hping.org/comp.lang.python.archive/28916.html And more speci

Easy immutability in python?

2006-03-04 Thread Terry Hancock
r maybe I should make an "Immutable" class, and just inherit from it last so it overloads everything else with the null interfaces? -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python advocacy in scientific computation

2006-03-04 Thread Terry Hancock
one point, I was seriously thinking about trying to write some kind of translator to convert those IDL libs into python libs (quixotic of me?). So why rent when you can own? Scientists certainly do understand all that bit about "seeing further" because you're "standing on the

Re: Importing Files

2006-03-02 Thread Terry Hancock
different directory to the current file?. Typically you will need to modify sys.path to determine what's on the "PYTHONPATH". Of course, you can also modify the PYTHONPATH environment variable to add new stuff to the path. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: do design patterns still apply with Python?

2006-03-02 Thread Terry Hancock
n article crying out to be written, "(Learning) Design Patterns with Python". Has it been written already? Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Suggestions for documentation generation?

2006-03-01 Thread Terry Hancock
arship.python.net/crew/danilo/pythondoc/ > http://effbot.org/zone/pythondoc.htm > > There's also HappyDoc http://happydoc.sourceforge.net/ > and EpyDoc http://epydoc.sourceforge.net/ . Those are great, but I don't think they handle C++ ;-) Which makes me wonder -- will

Re: PEP 354: Enumerations in Python

2006-03-01 Thread Terry Hancock
the main values of using enumerated values is as an aid to documentation, but "WED" is still vague. Could be "Wednesday", could be the "Western Education District" or short for "Wedding". Enumerations are most frequently used in module APIs, so

Re: PEP 354: Enumerations in Python

2006-03-01 Thread Terry Hancock
e) Symbol / Enum (what I used for "closed" case) Word / WordSet Label / LabelSet I'm sure there are others. Word has the disadvantage of also meaning "32-bit integer" to a lot of CS people. Or perhaps a string. Not immediately an indivisible symbol. Symbol

Re: Is it better to use class variables or pass parameters?

2006-03-01 Thread Terry Hancock
ject, then they ought to be expressed as properties of the object. It's funny, I've never actually had any doubts about which to use in practice, it always seems obvious, so it's hard to recall what my actual thought process is on the subject. -- Terry Hancock ([EMAIL PROTECTED]) Anan

Re: Default Section Values in ConfigParser

2006-02-28 Thread Terry Hancock
lt_cfg) config.read(['/etc/varimage.cfg', os.path.expandvars('${INSTANCE_HOME}/varimage.cfg'), os.path.join(pkghome, 'varimage.cfg') ]) -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Use empty string for self

2006-02-28 Thread Terry Hancock
ill generally prefer to see "self", I still consider the above pretty readable, and it goes more than halfway towards your goal. Others have suggested "_" instead of "s". However, IMHO, it's less visible, takes up the same space as "s", and requir

Re: PEP 354: Enumerations in Python

2006-02-28 Thread Terry Hancock
dded, should be "strong enums" without this kind of ambiguous behavior. I also think though that the characterization of the behavior of enumerated value instances is much more important than the behavior of the enumeration collection object, which is basically just a set, anyway. Chee

Re: Python Indentation Problems

2006-02-28 Thread Terry Hancock
e been fixed, or else I'm just lucky to finally have a terminal that agrees with the interpreter on the width of tabs). In any case, it's good practice not to mix tabs and spaces. I actually recommend using just tabs when playing with the interpreter (it's faster) -- but use space

Re: PEP 354: Enumerations in Python

2006-02-28 Thread Terry Hancock
be a smart way to do this in another application, but it looks promising for this one (which is a kind of artificial locale-neutral language representation). I'm not sure that the enum described in the PEP would be as useful to me as this. So I'm -0 on it becoming a built-in, though I

Re: "Temporary" Variable

2006-02-25 Thread Terry Hancock
ote, he consistently used "foo" and "bar" himself. My faith is so shaken. ;-) Cheers, Terry Hancock -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: A C-like if statement

2006-02-23 Thread Terry Hancock
de-effects". Python is pretty good at making functions with side-effects. At least it is if you want them. ;-) -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: make a class instance from a string ?

2006-02-23 Thread Terry Hancock
like ZODB will already do that for you, but it seems basic enough that there ought to be a general approved method of doing that in Python -- you know, "one obvious way". -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: "configuring" a class

2006-02-22 Thread Terry Hancock
eeing the code, I can't guess how. > Can anyone give me a clue about this? If there is a better > way, please let me know. Thanks. Recommend you stick with the first idea, which as you see works fine. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: ConfigParser and unicode: a simple solution?

2006-02-22 Thread Terry Hancock
www.google.com/search?hl=en&q=ConfigParser+unicode&btnG=Google+Search First hit identifies "ConfigObj", and a few links later gets you the home page and Sourceforge project page: http://www.voidspace.org.uk/python/configobj.html http://sourceforge.net/projects/configobj -- Terry Han

Re: deriving from float or int

2006-02-21 Thread Terry Hancock
On Tue, 21 Feb 2006 15:01:22 -0600 Robert Kern <[EMAIL PROTECTED]> wrote: > http://www.python.org/2.2.3/descrintro.html#__new__ Curiously, __new__ does not appear in the index of the Python 2.3 language reference! It is fixed in Python 2.4, though -- I just checked. -- Terry Hancoc

Re: Augmented assignment

2006-02-21 Thread Terry Hancock
, I think they are usually equivalent internally, at least for immutable objects. -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple assignment and the expression on the right side

2006-02-21 Thread Terry Hancock
ght side is evaluated > once for each assignment. [The wordings are mine. I am > not sure if this is what he intended]. > >>> c = d = e = x() AFAIK, this is equivalent to this: e = x() d = e c = d So, in fact, what you say is true, but these, of course will not evaluat

Re: Python vs. Lisp -- please explain

2006-02-19 Thread Terry Hancock
for things that truly need optimization. If you use Pyrex, you can even still pretend you're programming in Python when you write those extensions. I'm sure that's why some 3D libraries have opted to write the fast code in Pyrex instead of C (even though either is possible). --

Re: ANN: FreeImagePy 1.2.2

2006-02-19 Thread Terry Hancock
I haven't checked in awhile. So, IMHO, there's still PLENTY of room for innovation in the application area of image-handling tools for Python. PIL is not a "category-killer". At least not yet. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: PyProtocols, Components, and Inheritance

2006-02-18 Thread Terry Hancock
On Thu, 16 Feb 2006 23:53:51 -0600 Terry Hancock <[EMAIL PROTECTED]> wrote: > I've been discussing PyProtocols with a a friend > collaborating with me on a SF game project, about > the benefits and design concept of "component > architecture", and I'm a

PyProtocols, Components, and Inheritance

2006-02-17 Thread Terry Hancock
. I feel like there's something going on here that I just don't "get". Is there someone out there who can give me a PyProtocols advocate's PoV on this? Can you tell me why PP's approach is "better" than Zope's? (Or perhaps what you think it is mo

Re: Python, Forms, Databases

2006-02-15 Thread Terry Hancock
on't want to do it the old-fashioned way -- after that though, it's just "throught-the-web" scripting). But Zope is kind of a culture onto itself, so you may not necessarily want to buy into it, if you don't do this kind of thing often. Just my two cents, of

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Terry Hancock
gruesome enough a > > name to go with the special lopsided Pythonic creature > > mentioned above. I suggest we name it a hurgledink. > > +1 QOTW Yeah, +1, definitely. -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: how do you pronounce 'tuple'?

2006-02-14 Thread Terry Hancock
On Tue, 14 Feb 2006 10:40:09 -0500 Tim Peters <[EMAIL PROTECTED]> wrote: > the-acid-test-is-whether-you-say-"xor"-with-one-syllable- > or-three-ly y'rs - tim -- Oh dear, I say it with two, am I just not cool, or what? ;-) "ex-or" -- Terry Hancock ([EMA

Re: hard disk activity

2006-02-14 Thread Terry Hancock
cksums until they fail again. Actually, that will work just coming from the beginning, too. If instead, the region continues to be unrecognizeable to the end of the frame, then you need the next frame anyway. Seems like it could get pretty close to optimal (but we probably are re-inventing rsync

Re: how do you pronounce 'tuple'?

2006-02-13 Thread Terry Hancock
On Mon, 13 Feb 2006 18:27:40 -0800 Erik Max Francis <[EMAIL PROTECTED]> wrote: > Terry Hancock wrote: > > The only tuple I pronounce with the "-uh-" is "couple", > > and I usually call that a "two-tuple" when dealing with > > Python.

Re: how do you pronounce 'tuple'?

2006-02-13 Thread Terry Hancock
b, which is "kwintoopliKATE"). So what's a 1-element tuple, anyway? A "mople"? "monople"? It does seem like this lopsided pythonic creature (1,) ought to have a name to reflect its ugly, newbie-unfriendly nature. Are we having fun yet? ;-) Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: installing python on a server?

2006-02-10 Thread Terry Hancock
lighter-weight package than Zope, and there's maybe a dozen different ones to choose from. Easier to learn, but probably more work in the long run if you have to do a lot of script work on your site. -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- ht

Re: Legality of using Fonts

2006-02-10 Thread Terry Hancock
-licensed fonts can be a bit difficult because there are so-many "sort of" free fonts that it clutters the field. Several good fonts are included in the Debian Linux distribution, though, and of course, they had to get debian-legal's stamp of approval to get there, so they are indeed fre

  1   2   3   4   5   >