Re: Virtual functions are virtually invisible!

2011-07-12 Thread Chris Angelico
On Tue, Jul 12, 2011 at 7:46 AM, rantingrick wrote: > Actually no i was purposely implying Mt. Vesuvius. You know, the > VOLCANO that erupted and left poor Pompeii in ruins? Here is some text > from the wiki verbatim: > Yes, I do know that mountain. But it doesn't have very many gods sitting on i

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread Steven D'Aprano
Thorsten Kampe wrote: > * sturlamolden (Mon, 11 Jul 2011 06:44:22 -0700 (PDT)) >> On 11 Jul, 14:39, Ben Finney wrote: >> > The Unix model is: a collection of general-purpose, customisable >> > tools, with clear standard interfaces that work together well, and >> > are easily replaceable without l

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.12 05:24 AM, Steven D'Aprano wrote: > Rather than taking advantage of that convenience, commercial vendors > put barriers in the way and try to carve out little walled gardens. > Did they not learn anything from AOL? DRM and activation

What Programing Language are the Largest Website Written In?

2011-07-12 Thread Xah Lee
maybe this will be of interest. 〈What Programing Language Are the Largest Website Written In?〉 http://xahlee.org/comp/website_lang_popularity.html - i don't remember how, but today i suddenly got reminded that Facebook is written in PHP. So, on the spur of the mo

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread Chris Angelico
On Tue, Jul 12, 2011 at 8:24 PM, Steven D'Aprano wrote: > Where is the Windows equivalent of yum or apt-get? Why isn't there a central > repository of independent and third party Windows software? It seems clear > to me that it is the major open source communities that aim for > convenience, at th

Re: Python bug? Indexing to matrices

2011-07-12 Thread sturlamolden
On 12 Jul, 07:39, David wrote: > Should the following line work for defining a matrix with zeros? > > c= [[0]*col]*row No. The rows will be aliased. This will work: c = [[0]*col for i in range(row)] Note that Python lists are not ment to be used as matrices. We have NumPy or the array module f

Re: Python bug? Indexing to matrices

2011-07-12 Thread sturlamolden
On 12 Jul, 14:59, sturlamolden wrote: >    ma = np.matrix(a) >    mb = np.matrix(b) >    a*b ma*mb Sorry for the typo. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python bug? Indexing to matrices

2011-07-12 Thread David
Thank all for the very helpful replies. The goal of the matrix multiply exercise was just to help my son and I learn Python better. I now understand *why* my initialization of [c] was wrong and I am continuing to check out numpy and scipy. Regards, David -- http://mail.python.org/mailman/listinf

Set run vars with each call

2011-07-12 Thread Gnarlodious
Question. Is there a special method or easy way to set default values with each call to an instance? Any ideas to make it easier? What I want to do is have a constantly updating set of values which can be overridden. Just thought there was an easy way to set that up. -- Gnarlie -- http://mail.pyt

Re: Set run vars with each call

2011-07-12 Thread Alister Ware
On Tue, 12 Jul 2011 06:32:32 -0700, Gnarlodious wrote: > Question. Is there a special method or easy way to set default values > with each call to an instance? Any ideas to make it easier? What I want > to do is have a constantly updating set of values which can be > overridden. Just thought there

How to write a file generator

2011-07-12 Thread Billy Mays
I want to make a generator that will return lines from the tail of /var/log/syslog if there are any, but my function is reopening the file each call: def getLines(): with open('/var/log/syslog', 'rb') as f: while True: line = f.readline() if line:

Re: Lisp refactoring puzzle

2011-07-12 Thread Terry Reedy
On 7/11/2011 11:37 PM, Xah Lee wrote: it's funny, in all these supposedly modern high-level langs, they don't provide even simple list manipulation functions such as union, intersection, and the like. Not in perl, not in python, Union and intersection are set operations, not list operations. Py

Re: Lisp refactoring puzzle

2011-07-12 Thread jvt
I might argue that it isn't quite right (or politic) to call those who resist technological changes "idiots" so much as to observe they often have goals which cannot wait for the ideal expressive system. People love python not because Python is the platonic programming language, but because it doe

Re: Lisp refactoring puzzle

2011-07-12 Thread WJ
Xah Lee wrote: > it's funny, in all these supposedly modern high-level langs, they > don't provide even simple list manipulation functions such as union, > intersection, and the like. Not in perl, not in python, not in lisps. Ruby has them. Intersection: [2,3,5,8] & [0,2,4,6,8] ==>[2, 8] U

Re: Lisp refactoring puzzle

2011-07-12 Thread Chris Kaynor
On Mon, Jul 11, 2011 at 8:37 PM, Xah Lee wrote: > > it's funny, in all these supposedly modern high-level langs, they > don't provide even simple list manipulation functions such as union, > intersection, and the like. Not in perl, not in python, not in lisps. > (sure, lib exists, but it's a ride

Re: How to write a file generator

2011-07-12 Thread bruno.desthuilli...@gmail.com
On Jul 12, 4:46 pm, Billy Mays wrote: > I want to make a generator that will return lines from the tail of > /var/log/syslog if there are any Err... I must have missed something, but python files are their own iterators. Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC 4.4.5] on linux2 Type

Re: How to write a file generator

2011-07-12 Thread Thomas Jollans
On 07/12/2011 04:46 PM, Billy Mays wrote: > I want to make a generator that will return lines from the tail of > /var/log/syslog if there are any, but my function is reopening the file > each call: > > def getLines(): > with open('/var/log/syslog', 'rb') as f: > while True: >

Re: Lisp refactoring puzzle

2011-07-12 Thread fortunatus
I think the problem with so-called "forward looking" or "highest level" languages is that they tend to become domain specific. What Lispers are always saying is construct your own high level language out of your favorite Lisp. Of course no one else will use it then, or even discuss it, unless you

"Python Wizard," with apologies to The Who

2011-07-12 Thread John Keisling
After too much time coding Python scripts and reading Mark Lutz's Python books, I was inspired to write the following lyrics. For those too young to remember, the tune is that of "Pinball Wizard," by The Who. May it bring you as much joy as it brought me! I cut my teeth on BASIC At scripting I'm

Re: How to write a file generator

2011-07-12 Thread Billy Mays
On 07/12/2011 11:52 AM, Thomas Jollans wrote: On 07/12/2011 04:46 PM, Billy Mays wrote: I want to make a generator that will return lines from the tail of /var/log/syslog if there are any, but my function is reopening the file each call: def getLines(): with open('/var/log/syslog', 'rb') a

Re: "Python Wizard," with apologies to The Who

2011-07-12 Thread Matty Sarro
I don't know whether to LOL or mourn the part of me that just died inside :-P j/k j/k clever song, and it made me laugh :) On Tue, Jul 12, 2011 at 12:40 PM, John Keisling wrote: > After too much time coding Python scripts and reading Mark Lutz's > Python books, I was inspired to write the follow

Re: Lisp refactoring puzzle

2011-07-12 Thread Terry Reedy
On 7/11/2011 11:37 PM, Xah Lee wrote: watch the first episode of Douglas Crockford's talk here: http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-1 The link includes a transcript of the talk, which I read I suspect Lee likes Crockford because they both think they are smarter than

Re: How to write a file generator

2011-07-12 Thread sturlamolden
On 12 Jul, 16:46, Billy Mays wrote: > I know the problem lies with the StopIteration, but I'm not sure how to > tell the caller that there are no more lines for now. Try 'yield None' instead of 'raise StopIteration'. Sturla -- http://mail.python.org/mailman/listinfo/python-list

Re: "Python Wizard," with apologies to The Who

2011-07-12 Thread Tim Daneliuk
On 7/12/2011 11:40 AM, John Keisling said this: > After too much time coding Python scripts and reading Mark Lutz's > Python books, I was inspired to write the following lyrics. For those > too young to remember, the tune is that of "Pinball Wizard," by The > Who. May it bring you as much joy as it

Re: Set run vars with each call

2011-07-12 Thread Gnarlodious
On Jul 12, 8:46 am, Alister Ware wrote: > I thought that was the role of the __init__ function > > class Something: >         def __init__(self): >                 self.value="some value" OK, that sets a value at init time. But is there a similar built-in to run whenever the class instance is ca

Re: "Python Wizard," with apologies to The Who

2011-07-12 Thread Tim Daneliuk
On 7/12/2011 12:08 PM, Tim Daneliuk said this: > On 7/12/2011 11:40 AM, John Keisling said this: >> After too much time coding Python scripts and reading Mark Lutz's >> Python books, I was inspired to write the following lyrics. For those >> too young to remember, the tune is that of "Pinball Wizar

Re: Set run vars with each call

2011-07-12 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 On 2011.07.12 12:32 PM, Gnarlodious wrote: > OK, that sets a value at init time. But is there a similar built-in > to run whenever the class instance is called? What do you mean by call an instance? Do you want to run certain code whenever any me

Re: How to write a file generator

2011-07-12 Thread Terry Reedy
On 7/12/2011 10:46 AM, Billy Mays wrote: I want to make a generator that will return lines from the tail of /var/log/syslog if there are any, but my function is reopening the file each call: def getLines(): with open('/var/log/syslog', 'rb') as f: while True: line = f.readline() if line: yield l

new python contracts library

2011-07-12 Thread Rodney Gomes
Hey I recently created a contracts library for python and was wondering if anyone finds it useful or wants to have additional features added ? Feel free to open new issues on the github project. https://github.com/rlgomes/contracts This is just a v0.1 and I welcome any and all suggestions to m

Re: "Python Wizard," with apologies to The Who

2011-07-12 Thread Phlip
> That modeling and sim guy > Sure codes some mean Python! C-; And he changes key on the fly, too! -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp refactoring puzzle

2011-07-12 Thread gene heskett
On Tuesday, July 12, 2011 02:08:02 PM Terry Reedy did opine: > On 7/11/2011 11:37 PM, Xah Lee wrote: > > watch the first episode of Douglas Crockford's talk here: > > http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-1 > > The link includes a transcript of the talk, which I read > >

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread CM
> > One reason there hasn't been much demand for a GUI builder is that, in > > many cases, it's just as simpler or simpler to code a GUI by hand. I use a GUI builder because I'd rather click less than type more. I just tried that in Boa Constructor; with ~10 mouse clicks I produced 964 characters

Re: "Python Wizard," with apologies to The Who

2011-07-12 Thread John Keisling
On Jul 12, 11:34 am, Tim Daneliuk wrote: > On 7/12/2011 12:08 PM, Tim Daneliuk said this: > > > On 7/12/2011 11:40 AM, John Keisling said this: > >> After too much time coding Python scripts and reading Mark Lutz's > >> Python books, I was inspired to write the following lyrics. For those > >> too

Re: Set run vars with each call

2011-07-12 Thread Ian Kelly
On Tue, Jul 12, 2011 at 11:50 AM, Andrew Berg wrote: > On 2011.07.12 12:32 PM, Gnarlodious wrote: >> OK, that sets a value at init time. But is there a similar built-in >> to run whenever the class instance is called? > What do you mean by call an instance? Do you want to run certain code > whenev

Re: "Python Wizard," with apologies to The Who

2011-07-12 Thread Carl Banks
On Tuesday, July 12, 2011 9:40:23 AM UTC-7, John Keisling wrote: > After too much time coding Python scripts and reading Mark Lutz's > Python books, I was inspired to write the following lyrics. For those > too young to remember, the tune is that of "Pinball Wizard," by The > Who. May it bring you

Re: How to write a file generator

2011-07-12 Thread Thomas Jollans
On 07/12/2011 06:42 PM, Billy Mays wrote: > On 07/12/2011 11:52 AM, Thomas Jollans wrote: >> On 07/12/2011 04:46 PM, Billy Mays wrote: >>> I want to make a generator that will return lines from the tail of >>> /var/log/syslog if there are any, but my function is reopening the file >>> each call: >>

Re: Lisp refactoring puzzle

2011-07-12 Thread Petter Gustad
Xah Lee writes: > it's funny, in all these supposedly modern high-level langs, they > don't provide even simple list manipulation functions such as union, > intersection, and the like. Not in perl, not in python, not in lisps. In Common Lisp you have: CL-USER> (union '(a b c) '(b c d)) (A B C D

Re: How to write a file generator

2011-07-12 Thread Thomas Jollans
On 07/12/2011 06:42 PM, Billy Mays wrote: > On 07/12/2011 11:52 AM, Thomas Jollans wrote: >> On 07/12/2011 04:46 PM, Billy Mays wrote: >>> I want to make a generator that will return lines from the tail of >>> /var/log/syslog if there are any, but my function is reopening the file >>> each call: >>

Complete Google Advertising Solutions

2011-07-12 Thread Amelia Grace
TheItValley is a capable web development application, software combination, search engine optimization, E-commerce, E-banking and complete Google advertising solution Organization based in UK main branches office in Sweden, Norway and Pakistan. The Internet is the most efficient and greatest growin

Re: Lisp refactoring puzzle

2011-07-12 Thread Neil Cerutti
On 2011-07-12, Petter Gustad wrote: > Xah Lee writes: > >> it's funny, in all these supposedly modern high-level langs, they >> don't provide even simple list manipulation functions such as union, >> intersection, and the like. Not in perl, not in python, not in lisps. > > In Common Lisp you have

Re: Lisp refactoring puzzle

2011-07-12 Thread WJ
Petter Gustad wrote: > Xah Lee writes: > > > it's funny, in all these supposedly modern high-level langs, they > > don't provide even simple list manipulation functions such as union, > > intersection, and the like. Not in perl, not in python, not in lisps. > > In Common Lisp you have: > > CL-

Re: "Python Wizard," with apologies to The Who

2011-07-12 Thread Phlip
> That's pretty funny.  I knew what it would be even when I saw the cut-off > subject line, and I am too young to remember it. > > Carl Banks TTTO "[She put the lime in the] Coconut": Brother wrote a database, he finish it on time His sister add requirements, refactor every line She change

Building Python 2.5.6 on Ubuntu Natty

2011-07-12 Thread Ricardo Bánffy
Hi folks. Has anyone succeeded in building Python 2.5.6 from sources in Ubuntu Natty? I installed all the build dependencies and keep getting running build_ext /usr/include/sqlite3.h: version 3.7.4 Traceback (most recent call last): File "./setup.py", line 1545, in main() File "./setup.p

Re: Enhanced dir() function

2011-07-12 Thread Ethan Furman
Ethan Furman wrote: Tim Chase wrote: If it came in as an effortless (i.e. O(1) where I do it once and never again; not an O(n) where n=the number of times I invoke Python) default replacement for dir(), I'd reach for it a lot more readily. I seem to recall there's some environment-var or magi

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread rantingrick
On Jul 12, 1:43 pm, CM wrote: > > > One reason there hasn't been much demand for a GUI builder is that, in > > > many cases, it's just as simpler or simpler to code a GUI by hand. > > I use a GUI builder because I'd rather click less than > type more. I just tried that in Boa Constructor; with ~10

Re: Set run vars with each call

2011-07-12 Thread Ben Finney
Gnarlodious writes: > OK, [the ‘__init__’ method] sets a value at init time. But is there a > similar built-in to run whenever the class instance is called? You can write a ‘__call__’ method which will be called when the instance is called. But I suspect that's still not what you're asking. Ma

Re: Enhanced dir() function

2011-07-12 Thread rantingrick
On Jun 30, 11:29 pm, Steven D'Aprano wrote: > The dir() function is designed for interactive use, inspecting objects for > the names of attributes and methods. > > Here is an enhanced version that allows you to pass a glob to filter the > names you see: meh, I have always believed in keeping my

Re: Enhanced dir() function

2011-07-12 Thread rantingrick
On Jul 1, 12:20 pm, Tim Chase wrote: > If it came in as an effortless (i.e. O(1) where I do it once and > never again; not an O(n) where n=the number of times I invoke > Python) default replacement for dir(), I'd reach for it a lot > more readily.  I seem to recall there's some environment-var or

Installing PyPy alongside Python 2.7 on Windows?

2011-07-12 Thread Ben Sizer
I'd like to evaluate the recent build of PyPy on the project I'm currently working on, but am not sure how best to go about it. So my question is simply - how would I go about installing PyPy alongside Python 2.7 on Windows? In particular, unzipping PyPy and adding it to the PATH is easy enough, bu

Re: "Python Wizard," with apologies to The Who

2011-07-12 Thread Ethan Furman
John Keisling wrote: After too much time coding Python scripts and reading Mark Lutz's Python books, I was inspired to write the following lyrics. For those too young to remember, the tune is that of "Pinball Wizard," by The Who. May it bring you as much joy as it brought me! Absolutely hilari

Re: Lisp refactoring puzzle

2011-07-12 Thread Pascal J. Bourguignon
Neil Cerutti writes: > What's the rationale for providing them? Are the definitions > obvious for collections that a not sets? The rational is to prove that Xah is dumb. -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}.

Re: How to write a file generator

2011-07-12 Thread Thomas Rachel
Am 12.07.2011 16:46 schrieb Billy Mays: I want to make a generator that will return lines from the tail of /var/log/syslog if there are any, but my function is reopening the file each call ... I have another solution: an object which is not an iterator, but an iterable. class Follower(objec

Re: Wgy isn't there a good RAD Gui tool fo python

2011-07-12 Thread CM
On Jul 12, 5:18 pm, rantingrick wrote: > On Jul 12, 1:43 pm, CM wrote: > > > > > One reason there hasn't been much demand for a GUI builder is that, in > > > > many cases, it's just as simpler or simpler to code a GUI by hand. > > > I use a GUI builder because I'd rather click less than > > type

Re: Set run vars with each call

2011-07-12 Thread Steven D'Aprano
Gnarlodious wrote: > Question. Is there a special method or easy way to set default values > with each call to an instance? Any ideas to make it easier? What I > want to do is have a constantly updating set of values which can be > overridden. Just thought there was an easy way to set that up. Al

mrjob v0.2.7 released

2011-07-12 Thread Jimmy Retzlaff
What is mrjob? - mrjob is a Python package that helps you write and run Hadoop Streaming jobs. mrjob fully supports Amazon's Elastic MapReduce (EMR) service, which allows you to buy time on a Hadoop cluster on an hourly basis. It also works with your own Hadoop cluster. Some impor

Re: "Python Wizard," with apologies to The Who

2011-07-12 Thread Steven D'Aprano
John Keisling wrote: > After too much time coding Python scripts and reading Mark Lutz's > Python books, I was inspired to write the following lyrics. For those > too young to remember, the tune is that of "Pinball Wizard," by The > Who. May it bring you as much joy as it brought me! [...] I wou

Re: Lisp refactoring puzzle

2011-07-12 Thread Gregory Ewing
Xah Lee wrote: they don't provide even simple list manipulation functions such as union, intersection, and the like. Not in perl, not in python, not in lisps. Since 2.5 or so, Python has a built-in set type that provides these (which is arguably a better place for them than lists). -- Greg --

Re: Lisp refactoring puzzle

2011-07-12 Thread Roy Smith
In article <4e1cf936.4050...@canterbury.ac.nz>, Gregory Ewing wrote: > Xah Lee wrote: > > they > > don't provide even simple list manipulation functions such as union, > > intersection, and the like. Not in perl, not in python, not in lisps. > > Since 2.5 or so, Python has a built-in set type t

Re: Set run vars with each call

2011-07-12 Thread Gnarlodious
On Jul 12, 6:44 pm, Steven D'Aprano wrote: > All the words are in English, but the sentences make no sense :) LOL, impressive powers of mind-reading! Exactly what I needed: import time class Event: epoch=time.time() def doSomething(self, epoch=None): if epoch is None:

Re: Enhanced dir() function

2011-07-12 Thread Chris Angelico
On Wed, Jul 13, 2011 at 7:46 AM, rantingrick wrote: [x for x in dir([]) if not x.startswith('_')] > ['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', > 'reverse', 'sort'] > > Because we have plenty of room for args in this function... > dir(verbose=False) > ['append', 'co

Re: Lisp refactoring puzzle

2011-07-12 Thread Terry Reedy
On 7/12/2011 2:23 PM, gene heskett wrote: Now, I hate to mention it Terry, but your clock seems to be about 126 months behind the rest of the world. Please do not hate to be helpful. It was a bad malfunction perhaps due to a run-down battery on a machine turned off for two weeks. I will keep

Re: Lisp refactoring puzzle

2011-07-12 Thread rusi
On Jul 13, 9:39 am, Terry Reedy wrote: > On 7/12/2011 2:23 PM, gene heskett wrote: > > > Now, I hate to mention it Terry, but your clock seems to be about 126 > > months behind the rest of the world. > > Please do not hate to be helpful. Ha Ha. Cute one. Thanks -- http://mail.python.org/mailman/

Re: Virtual functions are virtually invisible!

2011-07-12 Thread alex23
rantingrick wrote: > i cannot force others If only you really understood that. -- http://mail.python.org/mailman/listinfo/python-list

Re: An interesting beginner question: why we need colon at all in the python language?

2011-07-12 Thread alex23
Thomas Jollans wrote: > Coincidentally, Guido wrote this blog post just last week, without which > I'd be just as much at a loss as you: > > http://python-history.blogspot.com/2011/07/karin-dewar-indentation-an... It's also part of the Python FAQ: http://docs.python.org/faq/design.html#why-are-c

Re: Installing PyPy alongside Python 2.7 on Windows?

2011-07-12 Thread cjrh
You can just extract the windows pypy 1.5 distribution to any folder and run "pypy.exe" from there as if it was called "python.exe". This is how I have been using it. In fact, pypy has been the default python for my portable eclipse for a good while now. -- http://mail.python.org/mailman/list

Code hosting services

2011-07-12 Thread Andrew Berg
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 I know this isn't specific to Python, but it is somewhat on topic. Way back when I had a simple project, SourceForge was by far the most prominent place to host (and it still is, though to a lesser extent now). SourceForge is still an option for m