Re: I just wanna know about os.path module..

2005-07-19 Thread Terry Hancock
of modules regardless of which way they are actually defined). -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: goto

2005-07-19 Thread Terry Hancock
on these statement blocks. If you're using goto for anything these blocks aren't appropriate for, then you should probably read the advice in the other replies. ;-) -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman

Re: OO design

2005-07-19 Thread Terry Hancock
approach. HTH, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I import a py script by its absolute path name?

2005-07-15 Thread Terry Hancock
-in as suggested above. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Who uses input()? [was Re: question on input]

2005-07-14 Thread Terry Hancock
. Unfortunately, that would break code if anything relied on input, so I guess that would be a Py3K idea, and maybe the whole I/O concept will be rethought then (if the print statement is going to go away, anyway). -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http

Re: extend for loop syntax with if expr like listcompgenexp ?

2005-07-12 Thread Terry Hancock
)) ? But of course that's not equivalent. It's hard to imagine a use case for an enumerated loop when the object being iterated over is anonymous (will be lost as soon as the loop exits). -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http

Re: Legacy data parsing

2005-07-11 Thread Terry Hancock
to use Python to do that as you suggest. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

gettext and disambiguating comments

2005-07-11 Thread Terry Hancock
-generated. I have no pressing immediate need for this functionality (that I know of), but I'd like to understand how to access this capability if it exists. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman

Re: relative import packages/modules workaround

2005-07-11 Thread Terry Hancock
that it's a common enough task that there ought to be *one* way to do it and it ought to be in the library. Otherwise, there's a lot of redundancy. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Terry Hancock
On Wednesday 06 July 2005 09:41 am, Steven Bethard wrote: Terry Hancock wrote: And a syntax just occured to me -- what about this: [expression for argument list] If you haven't already, see: http://wiki.python.org/moin/AlternateLambdaSyntax for other similar proposals. Yeah, it's

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-07 Thread Terry Hancock
On Wednesday 06 July 2005 08:38 am, Tom Anderson wrote: On Wed, 6 Jul 2005, Terry Hancock wrote: With list comprehensions and generators becoming so integral, I'm not sure about unpythonic. I'm going to resist the temptation to argue that list comps are themselves unpythonic :). Ah

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-06 Thread Terry Hancock
intuitive keyword in the language, IMHO. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: f*cking re module

2005-07-06 Thread Terry Hancock
in Python, Perl, and Javascript, but Python is definitely the one I find easiest to cope with. ;-) -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-06 Thread Terry Hancock
do anything more or less than present day lambda, but gets rid of the weird keyword, and integrates nicely with list comps and generators. It's currently a syntax error, and it requires no special delimiter -- it's really just an extension of list comp syntax. -- Terry Hancock ( hancock

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-05 Thread Terry Hancock
we're sort of running out of them. ;-) -- *An unfortunate acronym for Gnu Collaborative International Dictionary of English. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: math.nroot [was Re: A brief question.]

2005-07-05 Thread Terry Hancock
section. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Folding in vim

2005-07-05 Thread Terry Hancock
). -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Folding in vim

2005-07-05 Thread Terry Hancock
better now. :-) -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: What are the other options against Zope?

2005-07-05 Thread Terry Hancock
On Monday 04 July 2005 10:21 am, phil wrote: A data base with properties and methods. Cool. I am so sure I already said this. Well, I guess I typed too much else. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http

Re: precision problems in base conversion of rational numbers

2005-07-05 Thread Terry Hancock
that as an excercise for the reader, because I'm too lazy to go look it up, and I've forgotten the details. ;-) I hope this is helpful, though, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: what is __init__.py used for?

2005-07-05 Thread Terry Hancock
to learn once you've gotten beyond the basic hurdle of writing simple programs). -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How do you program in Python?

2005-07-04 Thread Terry Hancock
you. And the Python interpreter is great, it will give you no trouble and quick answers. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: looping over a big file

2005-07-04 Thread Terry Hancock
to disk and read it back when you've already got it in memory. Quack! ;-) Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-04 Thread Terry Hancock
instead of call, it's hard to imagine this being any closer to exactly what you would say to describe the operation. And for most of us, English comes easier than Computer Science jargon. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http

Re: Folding in vim

2005-07-04 Thread Terry Hancock
On Monday 04 July 2005 07:42 am, Ivan Van Laningham wrote: Terry Hancock wrote: I also got space_hi.vim which highlights tabs and trailing spaces, which made it a lot easier to fix the problem. Is that really the name? I tried searching for it got no hits. Sorry, no underscore, it's

Re: Folding in vim

2005-07-03 Thread Terry Hancock
On Saturday 02 July 2005 10:35 pm, Terry Hancock wrote: I tried to load a couple of different scripts to automatically fold Python code in vim, but none of them seems to do a good job. I've tried: python_fold.vim by Jorrit Wiersma http://www.vim.org/scripts/script.php?script_id=515

Re: Python, mysql, floating point values question

2005-07-02 Thread Terry Hancock
to write the closest thing to what the SQL code would look like, and I didn't know about BETWEEN. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: shelve in a ZipFile?

2005-07-02 Thread Terry Hancock
it with zlib on the data *before* storing them in the shelf. I guess if bulk becomes an issue I'll try that. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: What are the other options against Zope?

2005-07-02 Thread Terry Hancock
to understand. It's just not been well-introduced, because the people explaining it have a tendency to forget that it isn't all obvious, because it seems that way to them, now that they know it. But that's the newbie's problem in all areas of software, ISTM. HTH, Terry -- Terry Hancock ( hancock

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-02 Thread Terry Hancock
the arguments -- allowing you to set any arbitrary collection of values you want (can be a useful way to create a shared namespace), but (3) does (which is probably important if your class actually does specific things with the parameters). -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi

Re: What are the other options against Zope?

2005-07-02 Thread Terry Hancock
to know what Zope was. Yes, it is a funny story, though. ;-) -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, mysql, floating point values question

2005-07-02 Thread Terry Hancock
mostly about number-crunching anymore, so a lot of people never bother with floats. Which seems totally bizarre to me, since I cut my teeth on graphics and moved on to scientific programming, but there you are. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http

Folding in vim

2005-07-02 Thread Terry Hancock
be using it wrong. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting string into dictionary

2005-07-01 Thread Terry Hancock
], translations[1::2])) {'fr': 'la vache brun', 'en': 'the brown cow'} I always find it helps to take a statement apart in the interpreter if a little too much is going on in one line for me to follow. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http

Re: nested lists - utter newbie

2005-07-01 Thread Terry Hancock
of printing a traceback due to excessive recursion which is what it used to do. This is because the representation method was changed to catch such circular references and stick in the [...] instead. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com

Re: How to compare files

2005-07-01 Thread Terry Hancock
easily). -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: LOC in Python and C++ in large projects

2005-07-01 Thread Terry Hancock
grep -v -e ^# {} \; | grep -v -e '^$' | wc 158046 591237 6312725 .../ZopeX3/lib/python find . -name *.py -exec grep -v -e ^# {} \; | grep -v -e '^$' | wc 175818 642486 7023206 I'm sure there are holes in this method, but it ought to give a rough count. -- Terry Hancock ( hancock

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread Terry Hancock
). :-/ -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: shelve in a ZipFile?

2005-07-01 Thread Terry Hancock
On Friday 01 July 2005 12:53 pm, Scott David Daniels wrote: Terry Hancock wrote: I only just recently had a look at the shelve module That would be handy if, for example, I wanted to couple (and compress into the bargain) by putting my two shelf files into a single zip archive. You

Re: Python, mysql, floating point values question

2005-07-01 Thread Terry Hancock
in SQL, but I'd have to look up the syntax for inequality statements. The python equivalent would be to write it out as: if a b-epsilon and a b+epsilon: print a~=b -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http

Re: Programmers Contest: Fit pictures on a page

2005-07-01 Thread Terry Hancock
a strong sense of humor to appreciate it. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite non-python language trick?

2005-06-30 Thread Terry Hancock
as comparables. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: When someone from Britain speaks, Americans hear a British accent...

2005-06-30 Thread Terry Hancock
! -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: map vs. list-comprehension

2005-06-30 Thread Terry Hancock
case, the Python object model is very flexible, and most things you want to do can be done using it. So it seems to me like compartmentalizing changes by keeping them in modules would be really good. I guess I've become a python conservative. ;-) -- Terry Hancock ( hancock at anansispaceworks.com

Re: Favorite non-python language trick?

2005-06-30 Thread Terry Hancock
important exception would have to be the behavior of lambda and locally-defined functions --- I still expect them to know the variables in the defining function's namespace. But I think that lexical scoping fixed this so that they do, IIRC (I don't use them often, so I'm not so sure). -- Terry Hancock

shelve in a ZipFile?

2005-06-30 Thread Terry Hancock
a simpler way? -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Speaking of list-comprehension?

2005-06-30 Thread Terry Hancock
something into doing it, but it's probably a bad idea anyway. I think your loop is stylistically fine as is (if you need to change the list in place). -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo

Re: Modules for inclusion in standard library?

2005-06-29 Thread Terry Hancock
colleague memorably put it, to poke the operating system with a stick. You are always going to be able to use ctypes to provoke spectacular crashes of the kind that you can never get with 'ordinary' Python. Gosh, I didn't know or care about ctypes, but now I'm interested! ;-D -- Terry Hancock

Re: Set/Get attribute syntatic sugar

2005-06-28 Thread Terry Hancock
to dictionary value by string key is one way to encourage the distinction. And, really, when you do need it, __getattr__ / __setattr__ aren't really *that* difficult to use. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http

Re: Which kid's beginners programming - Python or Forth?

2005-06-28 Thread Terry Hancock
it's own implementation of turtle graphics? I think it's in the standard library, isn't it? The Live Wires graphics module is also a good start --- very similar to the kind of graphics interface that I had when I was learning on my TRS-80 Color Computer with BASIC. ;-) -- Terry Hancock ( hancock

Re: Life of Python

2005-06-27 Thread Terry Hancock
. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite non-python language trick?

2005-06-26 Thread Terry Hancock
as an assignment. But I don't think Python reads it that way -- it just has code to recognize multiple assignment as a statement. I think I remember reading that in the Language Reference or something. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http

Re: what is your opinion of zope?

2005-06-26 Thread Terry Hancock
idea). Without more specifics about what you are looking for, it would be hard to reply further than this. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite non-python language trick?

2005-06-26 Thread Terry Hancock
On Sunday 26 June 2005 06:11 am, Robert Kern wrote: Terry Hancock wrote: On Sunday 26 June 2005 05:39 am, Torsten Bronger wrote: However, then you must forbid a=b=1 for assigning to two variables at the same time. You need to differentiate a = b = 1 from a = b == 1 Okay, I see

Re: Photo layout

2005-06-26 Thread Terry Hancock
+ reportlab. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: A tool for Python - request for some advice

2005-06-25 Thread Terry Hancock
to 1.5). -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: a dictionary from a list

2005-06-25 Thread Terry Hancock
lines and will run in Python 1.5, IIRC. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Avoiding deadlocks in concurrent programming

2005-06-23 Thread Terry Hancock
support transactions, and abstracting the data into tables is a non-issue as ZODB stores Python objects more or less directly (you only have to worry about ensuring that objects are of persistent types -- meaning either immutable, or providing persistence support explicitly). -- Terry Hancock

Re: how to use more than 1 __init__ constructor in a class ?

2005-06-23 Thread Terry Hancock
. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system(cmd) isn't working

2005-06-23 Thread Terry Hancock
? ;-) -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: key - key pairs

2005-06-23 Thread Terry Hancock
has duplicate values, this will arbitrarily pick one (in a consistent, but implementation dependent way) to use as the key in the inverse mapping. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo

Re: *Python* Power Tools

2005-06-22 Thread Terry Hancock
[...] Or would people really like to claim a pure Python set of UNIX utilities? Sorry, can't parse that last sentence. In other words, it'd be a purely aesthetic goal. Which is only a waste if art is. But then, I know *I'm* not going to spend time on it. ;-) -- Terry Hancock ( hancock

Re: A World Beyond Capitalism 2005, An Annual International Multiracial Alliance Building Peace Conference Is Accepting Proposals...

2005-06-22 Thread Terry Hancock
peace on Usenet, anyway. ;-) -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Package organization

2005-06-22 Thread Terry Hancock
, some folks recommend avoiding this. But then, so what? PDE_File = PDF.File and the problem goes away. This always seems cleaner to me than: PDF.PDFFile etc, which drives me crazy to read. Useless repetition just gets annoying. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks

Re: references/addrresses in imperative languages

2005-06-21 Thread Terry Hancock
. ;-) Seriously though, thanks for the correction. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Extensions on Linux: import without underscore?

2005-06-19 Thread Terry Hancock
name: import _bright bright = _bright right? You can attach a new name to any Python object trivially (this is akin to a pointer assignment in C, it does not copy any significant amount of data). -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com

Re: references/addrresses in imperative languages

2005-06-19 Thread Terry Hancock
, 3], [4, 5, 6]] parti([1,2,3,4,5,6],2) [[1, 2], [3, 4], [5, 6]] PS is there any difference between t=t+[li] t.append(li) No, but t=t+[li] is quite different from t.append([li]) -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com

Re: Regex for repeated character?

2005-06-18 Thread Terry Hancock
(r'((.)\2*)', 'abbccccccbba')] ['a', 'bb', 'ccc', '', 'ccc', 'bb', 'a'] I think it's fantastic, but I'd be bound to say that given that it's the same as what I posted almost two days ago :-) Guess there's only one obvious way to do it, then. ;-) -- Terry Hancock ( hancock

Re: 1980's Home Computer-style Package.

2005-06-16 Thread Terry Hancock
after they've got it working. I know that'd be a good motivator for my kids, anyway. ;-) -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: dir() with string as argument

2005-06-16 Thread Terry Hancock
to take (noticeably) longer than: mod = __import__('sys') dir(mod) -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: What is different with Python ?

2005-06-15 Thread Terry Hancock
, which is what high-level programming is all about. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: What is different with Python ? (OT I guess)

2005-06-15 Thread Terry Hancock
from the French Informatique. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: What is different with Python ? (OT I guess)

2005-06-15 Thread Terry Hancock
a very denigrative view of craftsmen, and does not pay them well enough, so computer programmers have been motivated to attempt to elevate the profession by using the appellative of science. How different would the world be if we (more accurately) called it Computer Arts? -- Terry Hancock ( hancock

Re: Does Python cause tides?

2005-06-15 Thread Terry Hancock
environment (unless they can drive the atmosphere to a better composition fast enough). And as for the subject line, I'd say the Python list is very much at high-tide here. ;-) -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http

Re: also to balance else ?

2005-06-15 Thread Terry Hancock
. OTOH, I see no reason for an opposite construct, since, as you and others have pointed out, that can be handled by the if in the loop or by an exception handler. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org

Re: FAQ: __str__ vs __repr__

2005-06-15 Thread Terry Hancock
, and for others, str() and repr() are sensibly the same thing, but for some, the distinction is useful. That's all. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: also to balance else ?

2005-06-14 Thread Terry Hancock
On Tuesday 14 June 2005 12:07 am, Ron Adam wrote: Terry Hancock wrote: On Monday 13 June 2005 11:09 pm, Ron Adam wrote: My suggestion is to use, also as the keyword to mean on normal exit 'also' do this. Unfortunately, also is also a bad keyword to use for this, IMHO. I don't find it any

Re: What is different with Python ?

2005-06-13 Thread Terry Hancock
. Interestingly, my son had no problem at all with the name versus variable distinction -- that seems to be a case where my C experience caused me problems, but it's a non-issue coming from a tabula rasa perspective. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http

Re: case/switch statement?

2005-06-13 Thread Terry Hancock
this even more so: case = { 5: do_this, 6: do_that, } case.get(x, do_default)() Which is looking pretty close to a case statement, anyway. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org

Re: Dealing with marketing types...

2005-06-13 Thread Terry Hancock
). Not sure how many other jurisdictions have implemented something like this, but it sounds like a very good thing to me. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get/set class attributes in Python

2005-06-13 Thread Terry Hancock
behind a dynamically-typed language like Python and a statically typed one like Java. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Request for help on naming conventions

2005-06-13 Thread Terry Hancock
an intermediary like this (_ for .): Topic_create = Topic.create After that, it's kind of case-by-case. Do read PEP 8, too, of course. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: \r\n or \n notepad editor end line ???

2005-06-13 Thread Terry Hancock
. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get/set class attributes in Python

2005-06-13 Thread Terry Hancock
On Monday 13 June 2005 03:50 pm, Kalle Anke wrote: On Mon, 13 Jun 2005 20:41:48 +0200, Terry Hancock wrote (in article [EMAIL PROTECTED]): 1) Assume the variables are of a sensible type (not necessarily the one you expected, though), and provide exception handling to catch the case

Re: also to balance else ?

2005-06-13 Thread Terry Hancock
break if-else code, I don't think it would be allowed, anyway). I can't think of what would be a better keyword, though. :-/ -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: What language to manipulate text files

2005-06-12 Thread Terry Hancock
of the Library Reference -- also look at the string module, though it's usually easier to use the string methods approach). You will probably end up with more readable code using Python and take less time to develop sufficient proficiency to do the job with it. -- Terry Hancock ( hancock

Re: Any way to not create .pyc files?

2005-06-11 Thread Terry Hancock
On Saturday 11 June 2005 06:14 am, Piet van Oostrum wrote: Terry Hancock [EMAIL PROTECTED] (TH) wrote: TH It looks to me like Python just deleted a read-only file owned by TH root in order to replace it with a new pyc file. Can somebody TH explain that to me?! Isn't that supposed

Re: case/switch statement?

2005-06-11 Thread Terry Hancock
doesn't have a switch/case construct -- it encourages you to use a smarter solution which you'll be glad of later on. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Dealing with marketing types...

2005-06-10 Thread Terry Hancock
a bit of brainstorming, I tried: architecture astronauts ryan tomayko and got this: http://naeblis.cx/rtomayko/2005/05/28/ibm-poop-heads which is probably what you meant. I love that file name. ;-) Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http

Re: Dealing with marketing types...

2005-06-10 Thread Terry Hancock
On Friday 10 June 2005 03:06 pm, Kay Schluehr wrote: Python projects are submarines. You have to care not to go up to soon. Ooh, I like that. I'm going to file that under useful excuses. Could come in handy! ;-D Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi

Re: without shell

2005-06-10 Thread Terry Hancock
2.4 documentation, the subprocess module does not use any shell. Or the shell is python, as it were. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Any way to not create .pyc files?

2005-06-10 Thread Terry Hancock
in order to replace it with a new pyc file. Can somebody explain that to me?! Isn't that supposed to be impossible? (I can only guess that Python is running setuid root in this situation, and taking advantage of that --- but isn't that, well, *evil*?) -- Terry Hancock ( hancock

Re: Software licenses and releasing Python programs for review

2005-06-09 Thread Terry Hancock
of the software. I think you will actually get what you want by just using a copyleft free-license like the GPL. This will prevent the software from being absorbed into a commercial proprietary product, which is what I consider the reasonable part of what you are asking for. -- Terry Hancock ( hancock

Re: (OT) lincense protection generator

2005-06-09 Thread Terry Hancock
as the standard way to contact tech support. Most likely you are working with Windows clients, so you'll need something other than uname, but I'm sure there is something appropriate. You can do it by examining information in Python's sys module, too, which I think should be portable. -- Terry Hancock

Re: Any way to not create .pyc files?

2005-06-09 Thread Terry Hancock
with mixed versions and pyc files, so my assumptions may be a little off, but hopefully someone will correct me if that's so. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie learning OOP

2005-06-01 Thread Terry Hancock
unnecessarily crucifying a piece of toy code for learning OOP, this is *really* nice set of test cases! Thank you, I'm saving this for reference. :-) Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman

Re: Software licenses and releasing Python programs for review

2005-06-01 Thread Terry Hancock
, won't they? Of course, you're *entitled* to use any twisted, snare-throwing license you like, but don't expect to be respected for it. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: The need to put self in every method

2005-06-01 Thread Terry Hancock
around than learning all the implicit variables that Javascript introduces (e.g. this, prototype, etc). -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] SQL-records and OOP

2005-06-01 Thread Terry Hancock
there's really much overhead in creating Python classes. In any case, it's never been an issue for me. But I'd still recommend only wrapping the data after you've already reduced the number of rows as much as possible. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi

Re: idiom for constructor?

2005-06-01 Thread Terry Hancock
') Traceback (most recent call last): File stdin, line 1, in ? File stdin, line 4, in __init__ File stdin, line 7, in _get_args TypeError: __init__ takes exactly 4 arguments (5 given) HTH Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http

<    1   2   3   4   5   >