Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread Ken Tilton
Xah Lee wrote: > Python, Lambda, and Guido van Rossum > > Xah Lee, 2006-05-05 > > In this post, i'd like to deconstruct one of Guido's recent blog about > lambda in Python. > > In Guido's blog written in 2006-02-10 at > http://www.artima.com/weblogs/viewpost.jsp?thread=147358 > > is first of

Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread Ken Tilton
Alex Martelli wrote: > Ken Tilton <[EMAIL PROTECTED]> wrote: >... > >>But the key in the whole thread is simply that indentation will not >>scale. Nor will Python. > > > Absolutely. That's why firms who are interested in building *seriously* >

Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread Ken Tilton
David Hopwood wrote: > Ken Tilton wrote: > >>[...] The upshot of what [Guido] wrote is that it would be really hard to make >>semantically meaningful indentation work with lambda. > > > Haskell manages it. > To be honest, I was having a hard time imagining pr

Re: A critic of Guido's blog on Python's lambda

2006-05-05 Thread Ken Tilton
Steve R. Hastings wrote: > On Fri, 05 May 2006 21:16:50 -0400, Ken Tilton wrote: > >>The upshot of >>what he wrote is that it would be really hard to make semantically >>meaningful indentation work with lambda. > > > Pretty much correct. The complete tho

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Ken Tilton
Thomas F. Burdick wrote: > Ken Tilton <[EMAIL PROTECTED]> writes: > > >> Hopefully it can be a big issue and still not justify a flame war. >> >>Mileages will always vary, but one reason for lambda is precisely not >>to have to stop, go make a new fu

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Ken Tilton
Martin P. Hellwig wrote: > Bill Atkins wrote: > > >> >> How do you define scalability? >> > http://www.google.com/search?hl=en&q=define%3Ascalability&btnG=Google+Search > Damn! Google can do that?! Omigod!!! Not joking, I never knew that,a lways used dictionary.com. Thx! I meant: > The abi

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Ken Tilton
Kay Schluehr wrote: > Ken Tilton wrote: > > >>Oh, my, you are preaching to the herd (?!) of lemmings?! Please tell me >>you are aware that lemmings do not have ears. You should just do Lisp >>all day and add to the open source libraries to speed Lisp's as

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Ken Tilton
Alex Martelli wrote: > Ken Tilton <[EMAIL PROTECTED]> wrote: > > >>Martin P. Hellwig wrote: >> >>>Bill Atkins wrote: >>> >>> >>>>How do you define scalability? >>>> >>> >>>http://www.google.com/s

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Ken Tilton
Ken Tilton wrote: > > Come on, try just one meaty Common Lisp project at Google. Have someone > port Cells to Python. I got halfway done but decided I would rather be > doing Lisp. uh-oh. Does Python have anything like special variables? :) Omigod. I scare myself sometimes. Thi

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Ken Tilton
Alex Martelli wrote: > Ken Tilton <[EMAIL PROTECTED]> wrote: >... > >>Looks like dictionaries are no match for the ambiguity of natural >>language. :) Let me try again: it is Python itself that cannot scale, as >>in gain "new power and capability&quo

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Ken Tilton
Alex Martelli wrote: > Ken Tilton <[EMAIL PROTECTED]> wrote: >... > >>True but circular, because my very point is that () was a great design >>choice in that it made macros possible and they made CL almost >>infinitely extensible, while indentation-sen

Re: A critic of Guido's blog on Python's lambda

2006-05-06 Thread Ken Tilton
Alex Martelli wrote: > Ken Tilton <[EMAIL PROTECTED]> wrote: >... > >>Why? (symbol-name '|(|) -> "(" (No, the "s are not part of the name!) >> >>If you want to argue about that, I will have to bring up the Lisp >>readtable.

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Ken Tilton
Serge Orlov wrote: > Ken Tilton wrote: > >>It is vastly more disappointing that an alleged tech genius would sniff >>at the chance to take undeserved credit for PyCells, something probably >>better than a similar project on which Adobe (your superiors at >>softw

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Ken Tilton
Serge Orlov wrote: > Bill Atkins wrote: > >>"Serge Orlov" <[EMAIL PROTECTED]> writes: >> >> >>>Ken Tilton wrote: >>> >>>>It is vastly more disappointing that an alleged tech genius would sniff >>>>at the chance t

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Ken Tilton
Thomas F. Burdick wrote: > Ken Tilton <[EMAIL PROTECTED]> writes: > > >>As for: >> >> >>> At a syntax-sugar >>>level, for example, Lisp's choice to use parentheses as delimiter means >>>it's undesirable, even unfeasible, to

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Ken Tilton
Ken Tilton wrote: > >> >> a = negate(sin(pi/2)+one) = -2.0 >> b = negate(a)*10 = 20.0 > > > Very roughly speaking, that is supposed to be the code, not the output. > So you would start with (just guessing at the Python, it has been years > since I did hal

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Ken Tilton
Ken Tilton wrote: > > > Serge Orlov wrote: > >> Ken Tilton wrote: >> >>> It is vastly more disappointing that an alleged tech genius would sniff >>> at the chance to take undeserved credit for PyCells, something probably >>> better than

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Ken Tilton
[EMAIL PROTECTED] wrote: > Alex Martelli wrote: > >>Steve R. Hastings <[EMAIL PROTECTED]> wrote: >> ... >> But the key in the whole thread is simply that indentation will not scale. Nor will Python. >>> >>>This is a curious statement, given that Python is famous for scaling well. >> >>

Re: A critic of Guido's blog on Python's lambda

2006-05-07 Thread Ken Tilton
Alexander Schmolck wrote: > [trimmed groups] > > Ken Tilton <[EMAIL PROTECTED]> writes: > > >>yes, but do not feel bad, everyone gets confused by the /analogy/ to >>spreadsheets into thinking Cells /is/ a spreadsheet. In fact, for a brief >>period I

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
Adam Jones wrote: > Ken Tilton wrote: > >>Alexander Schmolck wrote: >> >>>[trimmed groups] >>> >>>Ken Tilton <[EMAIL PROTECTED]> writes: >>> >>> >>> >>>>yes, but do not feel bad, everyone gets confused b

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
David C. Ullrich wrote: > On Sun, 07 May 2006 10:36:00 -0400, Ken Tilton <[EMAIL PROTECTED]> > wrote: > > >>[...] >> >>Your spreadsheet does not have slots ruled by functions, it has one slot >>for a dictionary where you store names and values/

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
[Sorry, i was just reading comp.lang.lisp, missed the following till someone mentioned it in email. k] Alex Martelli wrote: > Carl Friedrich Bolz <[EMAIL PROTECTED]> wrote: >... > >>>an extension that allows the programmer to specify how the value of >>>some slot (Lisp lingo for "member vari

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
Ken Tilton wrote: > > I just keep what I call a "datapulse ID", sequentially growing from > zero, in a global variable. Each ruled Cell keeps track of its memoized > value, datapulse stamp, and whether it in fact changed value in reaching > its current datapuls

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
Thomas F. Burdick wrote: > Ken Tilton <[EMAIL PROTECTED]> writes: > > >>No, you do not want on-change handlers propagating data to other >>slots, though that is a sound albeit primitive way of improving >>self-consistency of data in big apps. The productivity

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
David C. Ullrich wrote: > On 08 May 2006 12:53:09 -0700, [EMAIL PROTECTED] (Thomas > F. Burdick) wrote: > > >>Ken Tilton <[EMAIL PROTECTED]> writes: >> >> >>>No, you do not want on-change handlers propagating data to other >>>slots, th

Re: A critic of Guido's blog on Python's lambda

2006-05-08 Thread Ken Tilton
Pisin Bootvong wrote: > Joe Marshall wrote: > >>Alex Martelli wrote: >>Most languages allow `unnamed numbers'. The `VAT_MULTIPLIER' argument >>is a >>strawman. Would you want to have to use a special syntax to name the >>increment >>in loop? >> >> defnumber zero 0 >> defnumber one { successor

Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread Ken Tilton
[EMAIL PROTECTED] wrote: > Ken Tilton wrote: > >>Python has a weak lambda, statements do not always >>return values, it does not have macros, and I do not know if it has >>special variables. > > > I am pretty much ignorant of Common Lisp, but I have the im

Re: A critic of Guido's blog on Python's lambda

2006-05-10 Thread Ken Tilton
sross wrote: >>I do wonder what would happen to Cells if I ever want to support >>multiple threads. Or in a parallel processing environment. > > > AFAIK It should be fine. > In LW, SBCL and ACL all bindings of dynamic variables are thread-local. > Ah, I was guilty of making an unspoken segue:

Re: A critic of Guido's blog on Python's lambda

2006-05-10 Thread Ken Tilton
Boris Borcic wrote: > Ken Tilton wrote: > >> "Now if you are like most people, you think that means X. It does not." > > > As far as natural language and understanding are concerned, "to mean" > means conformity to what most people understand, H

Re: A critic of Guido's blog on Python's lambda

2006-05-10 Thread Ken Tilton
Boris Borcic wrote: > Bill Atkins wrote: > >> >> It's interesting how much people who don't have macros like to put >> them down and treat them as some arcane art that are too "*insane*"ly >> powerful to be used well. >> >> They're actually very straightforward and can often (shock of shocks!) >

Re: A critic of Guido's blog on Python's lambda

2006-05-10 Thread Ken Tilton
[Sorry, I missed this one originally.] David C. Ullrich wrote: > On Tue, 09 May 2006 05:35:47 -0500, David C. Ullrich > <[EMAIL PROTECTED]> wrote: > > >>On Mon, 08 May 2006 18:46:57 -0400, Ken Tilton <[EMAIL PROTECTED]> >>wrote: >>[...] >> >

Re: A critic of Guido's blog on Python's lambda

2006-05-10 Thread Ken Tilton
Chris F Clark wrote: > David C Ullrich asked: > >>Q: How do we ensure there are no loops in the dependencies? >> >>Do we actually run the whole graph through some algorithm >>to verify there are no loops? > > > The question you are asking is the dependency graph a "directed > acyclic graph" (c

Re: A critic of Guido's blog on Python's lambda

2006-05-10 Thread Ken Tilton
Ketil Malde wrote: > > Sometimes the best documentation is the code itself. Sometimes the > best name for a function is the code itself. Absolutely. When I take over someone else's code I begin by deleting all the comments. Then I read the code. If a variable or function name makes no sense

Re: A critic of Guido's blog on Python's lambda

2006-05-10 Thread Ken Tilton
Alex Martelli wrote: > Stefan Nobis <[EMAIL PROTECTED]> wrote: > > >>[EMAIL PROTECTED] (Alex Martelli) writes: >> >> >>>if anonymous functions are available, they're used in even more >>>cases where naming would help >> >>Yes, you're right. But don't stop here. What about expressions? Many >>pe

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Ken Tilton
Michele Simionato wrote: > jayessay wrote: > >>I was saying that you are mistaken in that pep-0343 could be used to >>implement dynamically scoped variables. That stands. > > > Proof by counter example: > > from __future__ import with_statement > import threading > > special = threading.loc

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Ken Tilton
Alexander Schmolck wrote: > jayessay <[EMAIL PROTECTED]> writes: > > >>"Michele Simionato" <[EMAIL PROTECTED]> writes: >> >> >>>I was interested in a proof of concept, to show that Python can >>>emulate Lisp special variables with no big effort. >> >>OK, but the sort of "proof of concept" given

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Ken Tilton
Alexander Schmolck wrote: > Ken Tilton <[EMAIL PROTECTED]> writes: > > >>In Common Lisp we would have: >> >>(defvar *x*) ;; makes it special >>(setf *x* 1) >>(print *x*) ;;-> 1 >>(let ((*x* 2)) >> (print *x*))

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Ken Tilton
Alexander Schmolck wrote: > Duane Rettig <[EMAIL PROTECTED]> writes: > > >>Alexander Schmolck <[EMAIL PROTECTED]> writes: >> >> >>>Ken Tilton <[EMAIL PROTECTED]> writes: >>> >>> >>>>In Common Lisp we would hav

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Ken Tilton
implementation convenience hack > since it was implemented with a very efficient shallow binding cell. > That Common Lisp adapted Scheme's lexical bindings was considered a > big sign of CL's couthness. So I'm a little confused about what Ken > Tilton is getting at. Paul, the

Re: A critic of Guido's blog on Python's lambda

2006-05-12 Thread Ken Tilton
Everything else responded to separately, but... > I'd like to see a demonstration that using the same binding syntax for special > and lexical variables buys you something apart from bugs. Buys me something? Why do I have to sell simplicity, transparency, and clean syntax on c.l.python? kenny

Re: A critic of Guido's blog on Python's lambda

2006-05-14 Thread Ken Tilton
Lasse Rasinen wrote: > Ken Tilton <[EMAIL PROTECTED]> writes: > > >>ps. flaming aside, PyCells really would be amazingly good for Python. And >>so Google. (Now your job is on the line. ) k > > > Here's something I wrote this week, mostly as a menta

Re: A critic of Guido's blog on Python's lambda

2006-05-14 Thread Ken Tilton
Lasse Rasinen wrote: > Ken Tilton <[EMAIL PROTECTED]> writes: > > >>>if any concepts have survived to the Python version. Since Python's object >>>model is sufficiently different, the system is based on rules being >>>defined per-class... >>

Re: A critic of Guido's blog on Python's lambda

2006-05-15 Thread Ken Tilton
Ben wrote: > > Nothing you have described sounds that complicated, and you never come > up with concrete objections to other peoples code (apart that it took > 10 years to write in Lisp, so it must be really hard) Oh, now I have to spend an hour dissecting any code you people toss-off that doe

Re: A critic of Guido's blog on Python's lambda

2006-05-15 Thread Ken Tilton
Ken Tilton wrote: > > > Ben wrote: > >> >> Nothing you have described sounds that complicated, and you never come >> up with concrete objections to other peoples code (apart that it took >> 10 years to write in Lisp, so it must be really hard) >

Re: A critic of Guido's blog on Python's lambda

2006-05-15 Thread Ken Tilton
Lasse Rasinen wrote: > [I trimmed some of the newsgroups away; this mostly concerns Python and Lisp] > > Ken Tilton <[EMAIL PROTECTED]> writes: > > >>Lasse Rasinen wrote: >> >>>Ken Tilton <[EMAIL PROTECTED]> writes: >>> >>&g

Re: A critic of Guido's blog on Python's lambda

2006-05-16 Thread Ken Tilton
Ben wrote: > This kind of discussions between two groups of people, > neither of who know the other person's language very well just wind me > up something chronic! I must say, it is pretty funny how a flamewar turned into a pretty interesting SoC project. > Anything that makes programming mor

Re: A critic of Guido's blog on Python's lambda

2006-05-16 Thread Ken Tilton
Lasse Rasinen wrote: > Ken Tilton <[EMAIL PROTECTED]> writes: > > >>If you want to insist on how perfect your code is, please go find >>ltktest-cells-inside.lisp in the source you downloaded and read the long >>comment detailing the requirements I have identi

Re: John Bokma harassment

2006-05-24 Thread Ken Tilton
Tim N. van der Leeuw wrote: > [EMAIL PROTECTED] wrote: > >>I agree there are limits to you right to free speech, but I believe Xah >>Lee is not crossing >>any boundaries. If he starts taking over newspapers and TV stations be >>sure to notify me, >>I might revise my position. >>Immanuel > > >

Re: John Bokma harassment

2006-05-24 Thread Ken Tilton
Ben Bullock wrote: > "Xah Lee" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> If you believe this lobbying to my webhosting provider is unjust, >> please write to my web hosting provider [EMAIL PROTECTED] > > > Why don't you just change your provider? It would take less ti

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-02-02 Thread Ken Dere
ur assistance in correcting this error is > appreciated. Never used Matlab but I did use IDL (also commercial) a lot. However, I recently switched almost entirely to python with the help of numpy, scipy, matplotlib, and ipython for the interactive shell. As far as I am concerned, that day has come and gone. Ken D. -- http://mail.python.org/mailman/listinfo/python-list

Re: python for a matlab user

2008-02-02 Thread Ken Dere
> thanks for your comments, > d. I used IDL for data analysis and recently switched almost entirely to python. However, it did not happen overnight but I would not say it was difficult. Actually enjoyed it. Ken D. -- http://mail.python.org/mailman/listinfo/python-list

Odd behaviour with list comprehension

2008-02-29 Thread Ken Pu
there a way for me keep the iterating variable in list comprehension local to the list comprehension? Any comments on the current behaviour of Python is greatly appreciated. Ken -- http://mail.python.org/mailman/listinfo/python-list

Re: Book Recomendations

2008-03-02 Thread Ken Dere
; > Ira I started off with Fortran 6X so I have been in the business about as long. Do just about everything now in Python. I liked Learning Python Ken D. -- http://mail.python.org/mailman/listinfo/python-list

lazy evaluation is sometimes too lazy... help please.

2009-01-15 Thread Ken Pu
[0, 1, 2, 3, 4] [10, 11, 12, 13, 14] Thanks. Ken -- http://mail.python.org/mailman/listinfo/python-list

Changing return of type(obj)

2009-02-06 Thread Ken Elkabany
tion might possibly be; Could there be a way through the C API? Though I predict it will cause a mess with the interpreter. Thanks, Ken Elkabany -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing return of type(obj)

2009-02-06 Thread Ken Elkabany
class factory that will spawn for me the class that inherits the correct base type. Any other solutions? Thanks Chris. On Fri, Feb 6, 2009 at 3:42 AM, Chris Rebert wrote: > On Fri, Feb 6, 2009 at 3:03 AM, Ken Elkabany wrote: > > Hello, > > > > I am attempting to fully-si

access to MS Access password-protected database?

2009-02-11 Thread Ken McDonald
Can anyone direct me towards a code snippet showing how to use Python to insert data into a password-protected MS Access database? My google searches have been uninformative for dbs that are password-protected. Thanks, Ken -- http://mail.python.org/mailman/listinfo/python-list

Memory problems

2008-11-27 Thread Ken Seehart
ke an application use less memory? Any good overview articles on this subject? Thanks (and Happy Thanksgiving), - Ken Seehart -- http://mail.python.org/mailman/listinfo/python-list

Re: pydoc enforcement.

2008-12-01 Thread Ken Faulkner
public modules/API's/libraries that have so little documentation that it really does force reading a LOT of the source to figure out whats going on. Sure, a lot of the time thats required, but some modules are just painful.. oh well... was just a thought. Ken On Tue, Dec 2, 2008 at 3:

Good introductory book?

2008-12-03 Thread Ken D'Ambrosio
y like "Python Essential Reference", but it's -- well, more of a reference than an intro. So, an introductory text that actually assumes some previous programming experience (as opposed to "Learning Python" which must be the most slowly-paced programming book ever)

Detaching e-mail attachments?

2008-12-06 Thread Ken D'Ambrosio
Hi, all. I've done some poking around, and can find roughly two million different ways to attach attachments to an e-mail... but darn few to detach them. Any suggestions? I'm assuming I'm just missing looking in The Right Place, but thus-far, my Googling has been for naught.

Re: Guido's new method definition idea

2008-12-15 Thread Ken Seehart
, since newbies will still have to learn both syntaxes in order to read other peoples code, it does not simplify the language. The main thing I don't like about it is that it violates this principle: "There should be one-- and preferably only one --obvious way to do it." Ken Da

Re: Structure using whitespace vs logical whitespace

2008-12-16 Thread Ken Seehart
t python is the relative infrequency of special characters. This gives python a certain flavor. I happen to like this flavor a lot. Some people don't, and I recommend Perl to them. But switching between two distinct dialects of python does not seem like a wise idea. I hope this helps. Ken Seehart -- http://mail.python.org/mailman/listinfo/python-list

Re: some question about python2.6 and python3k

2009-01-04 Thread Ken Seehart
Michael Yang wrote: Hi,guys i am a new guy for python world,i have some question want to ask 1.should i learn about python2.6 or python3k?i heard of it has some difference from them . I think you should go directly to 3K to save your self the extra work of learning the differences. The mai

Regular Expressions...

2009-01-07 Thread Ken D'Ambrosio
code? - Get just the seven-digit number? In Perl, I'd so something like m/^1(...)(...)/; and then I'd have that stuff in $1 and $2, respectively. But the Python stuff simply isn't clicking for me. If anyone could supply concrete examples of how to do the problem,

Regular Expressions...

2009-01-07 Thread Ken D'Ambrosio
code? - Get just the seven-digit number? In Perl, I'd so something like m/^1(...)(...)/; and then I'd have the numbers in $1 and $2, respectively. But the Python stuff simply isn't clicking for me. If anyone could supply concrete examples of how to do the problem, a

OOP books?

2008-10-15 Thread Ken D'Ambrosio
;s retrofitted and ugly.] Is there an intro-to-Python book where the emphasis isn't so much on the language, but on OOP, itself? Or, failing that, at least a Python book which doesn't just introduce the language, but gives equal billing to OOP practices, etc. Thanks much! -Ken ** Po

Re: Midi manipulation

2008-11-17 Thread Ken Starks
Massi wrote: On 16 Nov, 23:23, Tim Roberts <[EMAIL PROTECTED]> wrote: Massi <[EMAIL PROTECTED]> wrote: Hi everyone, I'm searching for "something" which allows me to write scripts which handle midi files. I'm totally a newbie in audio manipulation, therefore any suggestion or link related to th

Re: Midi manipulation

2008-11-17 Thread Ken Starks
Ken Starks wrote: Massi wrote: On 16 Nov, 23:23, Tim Roberts <[EMAIL PROTECTED]> wrote: Massi <[EMAIL PROTECTED]> wrote: Hi everyone, I'm searching for "something" which allows me to write scripts which handle midi files. I'm totally a newbie in audio manipu

Re: How do I count the distance between strings in a list?

2009-02-27 Thread Ken Seehart
on.org/mailman/listinfo/python-list randomlist.index("4") - randomlist.index("1") Ken -- http://mail.python.org/mailman/listinfo/python-list

Mail client in Python?

2009-03-23 Thread Ken D'Ambrosio
OP queries), but could save myself a huge amount of work re-creating the wheel. Thanks for any recommendations! -Ken -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to start

2009-04-09 Thread Ken Dere
ctual programming. The best way is to figure out some program that you would like to write. Ken D -- http://mail.python.org/mailman/listinfo/python-list

Re: Python inside C++

2009-04-14 Thread Ken Seehart
callable from python. (there are actually several alternatives available, but that is another topic). Enjoy, Ken -- http://mail.python.org/mailman/listinfo/python-list

Re: December 21, 2012: Judgment Day

2009-04-16 Thread Ken Seehart
lways make more Harry Potter flicks. Unless, of course, judgment day intervenes. - Ken -- http://mail.python.org/mailman/listinfo/python-list

Re: Non-secure execution environment

2009-04-17 Thread Ken Seehart
nt, given that this is an embedding situation. See: http://wingware.com/psupport/python-manual/1.5/api/initialization.html You can use Py_NewInterpreter() to create multiple instances of python, which should give you the desired effect (though I have not tried this). - Ken -- http://mail.py

Re: Can I get a value's name

2009-05-15 Thread Ken Seehart
jalanb3 wrote: Context for this question arises from some recent code. In particular the "replace_line" method, which takes in a regexp to look for, and a replacement for when it matches. It is supposed to work for single lines only (we add ^ and $ to the regexp), so arguments which have '\n'

Re: What is the difference between init and enter?

2009-05-26 Thread Ken Seehart
t. The __init__ method is called when the object is initialized, but the __enter__ method is called when the context is entered (i.e. when the 'with' statement is invoked). Ken -- http://mail.python.org/mailman/listinfo/python-list

Re: What text editor is everyone using for Python

2009-05-26 Thread Ken Seehart
ger is way more powerful in the Pro version. Of course, favorites are ultimately determined by religious preference. Ken -- http://mail.python.org/mailman/listinfo/python-list

Re: large array in a single line

2009-05-26 Thread Ken Seehart
y a list of strings. There is no return value. (The name is intended to match readlines(); writelines() does not add line separators.) So you are asking it to effectively concatenate the characters in your string, (which gives you back your original string), and write the result. Si

Re: What text editor is everyone using for Python

2009-05-26 Thread Ken Seehart
retty good. http://www.notepad.org/ :-) Ken -- http://mail.python.org/mailman/listinfo/python-list

Browser based Canvas UI?

2009-05-30 Thread Ken Seehart
uirements 1,2,3) - Seems quite magical since I didn't know the necessary graphical raw materials existed in javascript - I think it's based on Ajax, but I can't seem to find a relevant python demo of it due to too much clutter in my google searches Ken -- http://mail.python.org/mailman/listinfo/python-list

Re: How does Python's OOP feel?

2009-05-30 Thread Ken Seehart
vantages, but on the whole, I like it. What else can I say? See also: http://www.ferg.org/projects/python_java_side-by-side.html Ken -- http://mail.python.org/mailman/listinfo/python-list

Re: Browser based Canvas UI?

2009-05-30 Thread Ken Seehart
CTO wrote: On May 30, 4:12 am, Ken Seehart wrote: A couple years ago I stumbled upon an interesting technology but I can't seem to find it, and I can remember what it is called. Unfortunately this makes it difficult to search for. I am am aware of several partial matches (items that

Re: addendum Re: working with images (PIL ?)

2008-05-17 Thread Ken Starks
As others have said, PIL has the 'histogram' method to do most of the work. However, as histogram works on each band separately, you have a bit of preliminary programming first to combine them. The ImageChops darker method is one easy-to-understand way (done twice), but there are lots of alterna

Re: addendum Re: working with images (PIL ?)

2008-05-18 Thread Ken Starks
Oops. I meant: WhiteArea=Result.histogram()[255] of course, not WhiteArea=Result.histogram()[0] Ken Starks wrote: As others have said, PIL has the 'histogram' method to do most of the work. However, as histogram works on each band separately, you have a bit of preliminary program

Re: Write bits in file

2008-05-18 Thread Ken Starks
You want your file considered as a sequence of bits rather than a sequence of 8-bit bytes, do you? is the 10-bit bit-pattern to be stored at an arbitrary bit-position in the file, or is the whole file regularly subdivided at 10-bit intervals? Monica Leko wrote: Hi I have a specific format and

Re: Write bits in file

2008-05-18 Thread Ken Starks
are after. I have no experience with it, myself: http://cobweb.ecn.purdue.edu/~kak/dist/BitVector-1.4.1.html Monica Leko wrote: On May 18, 2:20 pm, Ken Starks <[EMAIL PROTECTED]> wrote: You want your file considered as a sequence of bits rather than a sequence of 8-bit bytes, do you? Yes.

Re: How do *you* use Python in non-GUI work?

2008-05-19 Thread Ken Starks
John Salerno wrote: Hey all. Just thought I'd ask a general question for my own interest. Every time I think of something I might do in Python, it usually involves creating a GUI interface, so I was wondering what kind of work you all do with Python that does *not* involve any GUI work. This c

Re: addendum Re: working with images (PIL ?)

2008-05-19 Thread Ken Starks
I would still be concerned that you are checking against the percentage of the 768 bins returned by the histogram method. Two pixels of widely different colour end up in the same bin, so long as just ONE of the Red, Green, or Blue components is equal. So, for example, colours (2, 27, 200) and (20

Re: simple way to touch a file if it does not exist

2008-05-22 Thread Ken Starks
After os.path.exists, you need to check it _is_ a file, and not a directory. Giampaolo Rodola' wrote: On 22 Mag, 01:15, Nikhil <[EMAIL PROTECTED]> wrote: what are the simple ways? I could think of os.open(), os.exec(touch file) are there any simpler methods? Just use os.path.exists to check

Re: Writing HTML

2008-06-02 Thread Ken Starks
[EMAIL PROTECTED] wrote: I've searched the standard library docs, and, while there are a couple options for *reading* HTML from Python, I didn't notice any for *writing* it. Does anyone have any recommendations (particularly ones not listed on PyPI)? Thanks My approach is usually to write the

Re: Interesting Math Problem

2008-06-05 Thread Ken Starks
BEES INC wrote: I've been awfully busy programming lately. My Django-based side project is coming along well and I hope to have it ready for use in a few weeks. Please don't ask more about it, that's really all I can say for now. Anyways, I came across an interesting little math problem today and

Re: Most effective coding.. IDE question.

2008-06-08 Thread Ken Starks
dave wrote: Hello everyone, I'm a beginning self-taught python student. Currently, I work out my code within IDLE then when I have a version that I like, or that's working, I move it over to a new window and save it. I've been playing w/ Komodo IDE lately, and while it's nice, what I don't

binary number format ? format character %b or similar.

2008-06-22 Thread Ken Starks
I'm was wanting to format a positive integer in binary, and not finding it--to my surprise--I rolled my own version. Is this already in python, or have I missed it somewhere? I have Googled around a bit, and found a few threads on the subject, but they all seem to fizzle out. (e.g. : INPUT 35,

Re: binary number format ? format character %b or similar.

2008-06-22 Thread Ken Starks
weheh wrote: I don't know if you found this example: http://www.daniweb.com/code/snippet285.html Thanks for that. The offerings are very similar to the algorithms I wrote myself. It wasn't the solution I was after,really; that's easy. It was whether anything had found its way into the standa

Re: binary number format ? format character %b or similar.

2008-06-23 Thread Ken Starks
Mensanator wrote: On Jun 22, 4:07�pm, Ken Starks <[EMAIL PROTECTED]> wrote: weheh wrote: I don't know if you found this example: http://www.daniweb.com/code/snippet285.html Thanks for that. The offerings are very similar to the algorithms I wrote myself. It wasn't the solu

Re: automatically import modules upon interpreter invocation

2008-06-25 Thread Ken Seehart
python execute the above whenever it starts up so that I don't have to type it all the time? Cheers, Daniel environment variable PYTHONSTARTUP can be set to a python file that runs when you start the python interpreter - Ken -- http://mail.python.org/mailman/listinfo/python-list

How do I unit-test a specific case of a home-rolled exception ?

2008-06-27 Thread Ken Starks
""" I'm a bit new to both home-made exceptions and unit tests, so sorry if I'm just being stupid or doing it totally wrong. I have an exception class, and I want to check that a particular instance of it has been raised; or more accurately that one is raised that is equal to an instance I specify

Re: How do I unit-test a specific case of a home-rolled exception ?

2008-06-27 Thread Ken Starks
Peter Otten wrote: Ken Starks wrote: I have an exception class, and I want to check that a particular instance of it has been raised; or more accurately that one is raised that is equal to an instance I specify. In the example below, I can check that a 'LongRationalError' is rai

Re: Getting a path from a file object

2008-07-05 Thread Ken Starks
Andrew Fong wrote: Newbie question: Let's say I open a new file for writing in a certain path. How do I get that path back? Example: f = open('/some/path/file.ext') some_function(f) '/some/path/file.ext' Does some_function(f) already exist? And if not, how would I define it? -- Andrew Rea

<    1   2   3   4   >