[ANN] Leipzig Python User Group - Meeting, May 11, 2010, 08:00pm

2010-05-08 Thread Stefan Schwarzer
=== Leipzig Python User Group === We will meet on Tuesday, May 11, 8:00 pm at the training center of Python Academy in Leipzig, Germany ( http://www.python-academy.com/center/find.html ). Julian Moritz will give a talk about CouchDB. Food and soft drinks are provided. Please send a short

PyCon Ireland 2010 - Early bird registration open

2010-05-08 Thread Vicky Twomey-Lee
Hi All, Python Ireland would like to announce that we will be holding our first PyCon Ireland event on the Saturday July 17th and Sunday 18th in the heart of Dublin city. The conference will consist of workshops, tutorials, birds of a feather on Saturday morning, followed by talks in the

[ANN] Pyspread 0.1.1 released

2010-05-08 Thread Martin Manns
Pyspread 0.1.1 released === I am pleased to announce the new release 0.1.1 of pyspread. About: -- Pyspread is a cross-platform Python spreadsheet application. It is based on and written in the programming language Python. Instead of spreadsheet formulas, Python

Re: idiomatic way to collect and report multiple exceptions?

2010-05-08 Thread Ben Cohen
I've condensed the advice from this thread into this. import sys import traceback class ExceptionList(object): def __init__(self, msg, errors=None, *args): self.errortb = errors or [] super(ExceptionList, self).__init__(msg, *args) def __str__(self): Print a pretty

Re: Picking a license

2010-05-08 Thread Patrick Maupin
On May 7, 6:44 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Patrick Maupin pmau...@gmail.com writes: On May 7, 5:33 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Since no-one is forcing anyone to take any of the actions permitted in the license, and since those actions would not

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-08 Thread Lawrence D'Oliveiro
In message mailman.2760.1273288730.23598.python-l...@python.org, exar...@twistedmatrix.com wrote: This is a good example of why it's a bad idea to use select on Windows. Instead, use WaitForMultipleObjects. How are you supposed to write portable code, then? --

Re: Picking a license

2010-05-08 Thread Steven D'Aprano
On Fri, 07 May 2010 23:40:22 -0700, Patrick Maupin wrote: Personally, I believe that if anything is false and misleading, it is the attempt to try to completely change the discussion from MIT vs. GPL to GPL vs. no license (and thus very few rights for the software users), after first trying

Re: Picking a license

2010-05-08 Thread Martin P. Hellwig
On 05/08/10 09:37, Steven D'Aprano wrote: cut If encouraging third parties to take open source code and lock it up behind proprietary, closed licences *isn't* a moral hazard, then I don't know what one is. cut I fail to see what is morally wrong with it. When I ,as the author, share my work to

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-08 Thread Giampaolo Rodolà
2010/5/7 Antoine Pitrou solip...@pitrou.net: Le Fri, 07 May 2010 21:55:15 +0200, Giampaolo Rodolà a écrit : Of course, but 30 seconds look a little bit too much to me, also because (I might be wrong here) I noticed that a smaller timeout seems to result in better performances. That's

Re: Cross-platform file paths

2010-05-08 Thread News123
Hi TIA, utabintarbo wrote: Until now, I have used the UNC under Windows (XP) to allow my program to access files located on a Samba-equipped *nix box (eg. os.path.normpath(r\\serverFQDN\sharename\dir\filename)). When I try to open this file under Linux (Red Hat 5), I get a file not found

Re: py3 tkinter acceps bytes. why?

2010-05-08 Thread Martin v. Loewis
Matthias Kievernagel wrote: Me: If I don't want bytes to get passed to tkinter I just have to raise an exception in AsObj, no? Or is it even sufficient to just remove the bytes case? Martin v. Loewis mar...@v.loewis.de wrote: But why would you want that? There are commands which legitimately

[PATCH] Re: ConfigParser.get() defaults?

2010-05-08 Thread Tim Chase
On 05/07/2010 07:56 PM, Steven D'Aprano wrote: On Fri, 07 May 2010 15:05:53 -0500, Tim Chase wrote: With a normal dictionary, I can specify a default fallback value in the event the requested key isn't present: [...] However, with the ConfigParser object, there doesn't seem to be any way to

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-08 Thread Antoine Pitrou
On Sat, 8 May 2010 13:47:53 +0200 Giampaolo Rodolà g.rod...@gmail.com wrote: Assuming loop() function does something like this: ... select.select(r, w, e, timeout) scheduler() # checks for scheduled calls to be fired ... ...imagine a case where there's a connection

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-08 Thread exarkun
On 07:48 am, l...@geek-central.gen.new_zealand wrote: In message mailman.2760.1273288730.23598.python-l...@python.org, exar...@twistedmatrix.com wrote: This is a good example of why it's a bad idea to use select on Windows. Instead, use WaitForMultipleObjects. How are you supposed to write

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-08 Thread exarkun
On 11:47 am, g.rod...@gmail.com wrote: 2010/5/7 Antoine Pitrou solip...@pitrou.net: Le Fri, 07 May 2010 21:55:15 +0200, Giampaolo Rodol� a �crit�: Of course, but 30 seconds look a little bit too much to me, also because (I might be wrong here) I noticed that a smaller timeout seems to result

shortcut for large amount of global var declarations?

2010-05-08 Thread Alex Hall
Hi all, I am sorry if this is the second message about this you get; I typed this and hit send (on gmail website) but I got a 404 error, so I am not sure if the previous message made it out or not. Anyway, I have about fifteen vars in a function which have to be global. Is there a faster and more

Re: fast regex

2010-05-08 Thread Bryan
Tim Chase wrote: James wrote: [Tim had written:] If the keys in your word_list are more than just words, then the regexp may not find them all, and thus not replace them all.  In that case you may have to resort to my 2nd regexp which builds the 5k branch regexp from your actual dictionary

Re: Python is cool!!

2010-05-08 Thread lkcl
On Mar 25, 3:01 pm, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote: Jose Manuel a écrit : I have been learning Python, and it is amazing I am using the tutorial that comes with the official distribution. At the end my goal is to develop applied mathematic in

Re: fast regex

2010-05-08 Thread MRAB
Bryan wrote: Tim Chase wrote: James wrote: [Tim had written:] If the keys in your word_list are more than just words, then the regexp may not find them all, and thus not replace them all. In that case you may have to resort to my 2nd regexp which builds the 5k branch regexp from your actual

Re: shortcut for large amount of global var declarations?

2010-05-08 Thread MRAB
Alex Hall wrote: Hi all, I am sorry if this is the second message about this you get; I typed this and hit send (on gmail website) but I got a 404 error, so I am not sure if the previous message made it out or not. Anyway, I have about fifteen vars in a function which have to be global. Is there

Re: shortcut for large amount of global var declarations?

2010-05-08 Thread Jon Clements
On 8 May, 15:08, Alex Hall mehg...@gmail.com wrote: Hi all, I am sorry if this is the second message about this you get; I typed this and hit send (on gmail website) but I got a 404 error, so I am not sure if the previous message made it out or not. Anyway, I have about fifteen vars in a

Re: Picking a license

2010-05-08 Thread Aahz
In article 4be522ac$0$27798$c3e8...@news.astraweb.com, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: For the record, I've published software under an MIT licence because I judged the cost of the moral hazard introduced by encouraging freeloaders to be less than the benefits of

Re: Windows - select.select, timeout and KeyboardInterrupt

2010-05-08 Thread Giampaolo Rodolà
2010/5/8 Antoine Pitrou solip...@pitrou.net: On Sat, 8 May 2010 13:47:53 +0200 Giampaolo Rodolà g.rod...@gmail.com wrote: Assuming loop() function does something like this:      ...      select.select(r, w, e, timeout)      scheduler()  # checks for scheduled calls to be fired      ...

Re: shortcut for large amount of global var declarations?

2010-05-08 Thread Alex Hall
On 5/8/10, Jon Clements jon...@googlemail.com wrote: On 8 May, 15:08, Alex Hall mehg...@gmail.com wrote: Hi all, I am sorry if this is the second message about this you get; I typed this and hit send (on gmail website) but I got a 404 error, so I am not sure if the previous message made it

Re: shortcut for large amount of global var declarations?

2010-05-08 Thread James Mills
On Sun, May 9, 2010 at 12:08 AM, Alex Hall mehg...@gmail.com wrote: Hi all, I am sorry if this is the second message about this you get; I typed this and hit send (on gmail website) but I got a 404 error, so I am not sure if the previous message made it out or not. Anyway, I have about

Re: ActivePython - how to configure portable framework?

2010-05-08 Thread Sridhar
Copy all the files in the ZIP to your USB stick and run INSTALLDIR\python.exe -srid On 5/7/2010 3:24 AM, balzer wrote: I downloaded ActivePython-2.6.5.12-win32-x86.zip, it contains two folders and 3 files: SystemFolder INSTALLDIR sh2.py install.bat _install.py Anyone know how to configure

Re: shortcut for large amount of global var declarations?

2010-05-08 Thread Jon Clements
On 8 May, 16:03, Alex Hall mehg...@gmail.com wrote: On 5/8/10, Jon Clements jon...@googlemail.com wrote: On 8 May, 15:08, Alex Hall mehg...@gmail.com wrote: Hi all, I am sorry if this is the second message about this you get; I typed this and hit send (on gmail website) but I got a 404

Re: Picking a license

2010-05-08 Thread Patrick Maupin
On May 8, 3:37 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Fri, 07 May 2010 23:40:22 -0700, Patrick Maupin wrote: Personally, I believe that if anything is false and misleading, it is the attempt to try to completely change the discussion from MIT vs. GPL to GPL vs.

Fastest way to calculate leading whitespace

2010-05-08 Thread dasacc22
Hi This is a simple question. I'm looking for the fastest way to calculate the leading whitespace (as a string, ie ''). Here are some different methods I have tried so far --- solution 1 a = 'some content\n' b = a.strip() c = ' '*(len(a)-len(b)) --- solution 2 a = 'some content\n'

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread Shashank Singh
On Sat, May 8, 2010 at 10:49 PM, dasacc22 dasac...@gmail.com wrote: Hi This is a simple question. I'm looking for the fastest way to calculate the leading whitespace (as a string, ie ''). Here are some different methods I have tried so far --- solution 1 a = 'some content\n' b =

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread Daniel Skinner
That solution actually runs slower then the generator method. On Sat, May 8, 2010 at 12:33 PM, Shashank Singh shashank.sunny.si...@gmail.com wrote: On Sat, May 8, 2010 at 10:49 PM, dasacc22 dasac...@gmail.com wrote: Hi This is a simple question. I'm looking for the fastest way to

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread Daniel Skinner
sorry, my mistake it runs faster (looking at the wrong line of code). But the first two solutions are still faster. On Sat, May 8, 2010 at 12:48 PM, Daniel Skinner dasac...@gmail.com wrote: That solution actually runs slower then the generator method. On Sat, May 8, 2010 at 12:33 PM,

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread Patrick Maupin
On May 8, 12:19 pm, dasacc22 dasac...@gmail.com wrote: Hi This is a simple question. I'm looking for the fastest way to calculate the leading whitespace (as a string, ie '    '). Here are some different methods I have tried so far --- solution 1 a = '    some content\n' b = a.strip() c

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread dasacc22
On May 8, 12:59 pm, Patrick Maupin pmau...@gmail.com wrote: On May 8, 12:19 pm, dasacc22 dasac...@gmail.com wrote: Hi This is a simple question. I'm looking for the fastest way to calculate the leading whitespace (as a string, ie '    '). Here are some different methods I have

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread Steven D'Aprano
On Sat, 08 May 2010 10:19:16 -0700, dasacc22 wrote: Hi This is a simple question. I'm looking for the fastest way to calculate the leading whitespace (as a string, ie ''). Is calculating the amount of leading whitespace really the bottleneck in your application? If not, then trying to

Re: shortcut for large amount of global var declarations?

2010-05-08 Thread Steven D'Aprano
On Sat, 08 May 2010 10:08:08 -0400, Alex Hall wrote: Hi all, I am sorry if this is the second message about this you get; I typed this and hit send (on gmail website) but I got a 404 error, so I am not sure if the previous message made it out or not. Anyway, I have about fifteen vars in a

Need help with my 1st python program

2010-05-08 Thread Dave Luzius
Pleaser help me with this. Here's a copy of the program, but it keeps calling for me to define pressure. # A small program to fetch local barometer reading from weather.com # and convert the value from metric to imperial. # My

[RELEASED] Python 2.7 beta 2

2010-05-08 Thread Benjamin Peterson
On behalf of the Python development team, I'm elated to announce the second beta release of Python 2.7. Python 2.7 is scheduled (by Guido and Python-dev) to be the last major version in the 2.x series. 2.7 will have an extended period of bugfix maintenance. 2.7 includes many features that were

Re: ConfigParser.get() defaults?

2010-05-08 Thread Steven D'Aprano
On Fri, 07 May 2010 20:46:47 -0500, Tim Chase wrote: On 05/07/2010 07:56 PM, Steven D'Aprano wrote: On Fri, 07 May 2010 15:05:53 -0500, Tim Chase wrote: With a normal dictionary, I can specify a default fallback value in the event the requested key isn't present: [...] However, with the

Re: Need help with my 1st python program

2010-05-08 Thread Steven D'Aprano
On Sat, 08 May 2010 18:52:33 +, Dave Luzius wrote: Pleaser help me with this. Here's a copy of the program, but it keeps calling for me to define pressure. That's because you haven't defined pressure. When Python tells you there is a bug in your program, it is almost always correct. #

Re: Need help with my 1st python program

2010-05-08 Thread Dave Luzius
On Sat, 08 May 2010 19:02:42 +, Steven D'Aprano wrote: On Sat, 08 May 2010 18:52:33 +, Dave Luzius wrote: Pleaser help me with this. Here's a copy of the program, but it keeps calling for me to define pressure. That's because you haven't defined pressure. When Python tells you

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread Wolfram Hinderer
On 8 Mai, 20:46, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: def get_leading_whitespace(s):     t = s.lstrip()     return s[:len(s)-len(t)] c = get_leading_whitespace(a) assert c == leading_whitespace Unless your strings are very large, this is likely to be faster than

Re: Need help with my 1st python program

2010-05-08 Thread Walter Brameld IV
Dave Luzius wrote: On Sat, 08 May 2010 19:02:42 +, Steven D'Aprano wrote: On Sat, 08 May 2010 18:52:33 +, Dave Luzius wrote: Pleaser help me with this. Here's a copy of the program, but it keeps calling for me to define pressure. That's because you haven't defined pressure. When

Re: Picking a license

2010-05-08 Thread Steven D'Aprano
On Sat, 08 May 2010 10:14:18 -0700, Patrick Maupin wrote: On May 8, 3:37 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Fri, 07 May 2010 23:40:22 -0700, Patrick Maupin wrote: Personally, I believe that if anything is false and misleading, it is the attempt to try to

Re: Need help with my 1st python program

2010-05-08 Thread Benjamin Kaplan
On Sat, May 8, 2010 at 3:13 PM, Dave Luzius dluz...@comcast.net wrote: Pressure is a term for barometric pressure, and is understood by Conky, which this program is designed to work with, and is understood by weather.com. But the value it passes to conky is metric, and I want it to display

Re: Need help with my 1st python program

2010-05-08 Thread Steven D'Aprano
On Sat, 08 May 2010 19:13:12 +, Dave Luzius wrote: What is pressure? It is an undefined name. Where does pressure get its value from? Pressure is a term for barometric pressure, and is understood by Conky, which this program is designed to work with, and is understood by weather.com.

how to play a sound file repeatedly in loop

2010-05-08 Thread varnikat t
How to run sound file repeatedly in loop ? When I do this, it does nothing and terminates: import pygst pygst.require(0.10) import gst, gtk n=0 while n10: player = gst.element_factory_make(playbin2, player) player.set_property(uri, file:/home/varnika/hello.ogg)

Re: Need help with my 1st python program

2010-05-08 Thread Vincent Davis
I think what is not clear by what is being said is that you have passed in pressure and not 'pressure'. The first is undefined, pressure = 1 would define it. Where as 'pressure' is a string type. On Sat, May 8, 2010 at 1:35 PM, Walter Brameld IV wb4remove_this_t...@wbrameld4.name wrote: Dave

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread Steven D'Aprano
On Sat, 08 May 2010 12:15:22 -0700, Wolfram Hinderer wrote: On 8 Mai, 20:46, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: def get_leading_whitespace(s):     t = s.lstrip()     return s[:len(s)-len(t)] c = get_leading_whitespace(a) assert c == leading_whitespace

[ANN] Pyspread 0.1.1 released

2010-05-08 Thread Martin Manns
Pyspread 0.1.1 released === I am pleased to announce the new release 0.1.1 of pyspread. About: -- Pyspread is a cross-platform Python spreadsheet application. It is based on and written in the programming language Python. Instead of spreadsheet formulas, Python

Re: Picking a license

2010-05-08 Thread Patrick Maupin
On May 8, 2:38 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: most of the discussion about moral hazard snipped I don't think you understand what a moral hazard is. Under no circumstances is it a moral hazard to say If you do X, I will do Y -- in this case, If you obey these

Re: ConfigParser.get() defaults?

2010-05-08 Thread Tim Chase
On 05/08/2010 01:58 PM, Steven D'Aprano wrote: If your patch doesn't attract the interest of a Python-Dev developer, you might need to give them a prod occasionally. Their time for reviewing bugs and patches is always in short supply. - where (or to whom) to I submit the patch (and possibly

Kindly show me a better way to do it

2010-05-08 Thread Oltmans
Hi, I've a list that looks like following a = [ [1,2,3,4], [5,6,7,8] ] Currently, I'm iterating through it like for i in [k for k in a]: for a in i: print a but I was wondering if there is a shorter, more elegant way to do it? --

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread Mark Dickinson
On May 8, 8:46 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sat, 08 May 2010 12:15:22 -0700, Wolfram Hinderer wrote: On 8 Mai, 20:46, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: def get_leading_whitespace(s):     t = s.lstrip()     return

Re: Kindly show me a better way to do it

2010-05-08 Thread superpollo
Oltmans ha scritto: Hi, I've a list that looks like following a = [ [1,2,3,4], [5,6,7,8] ] Currently, I'm iterating through it like for i in [k for k in a]: for a in i: i think you used te a identifier for two meanings... print a but I was wondering if there is a

Re: Kindly show me a better way to do it

2010-05-08 Thread Chris Rebert
On Sat, May 8, 2010 at 1:41 PM, Oltmans rolf.oltm...@gmail.com wrote: Hi, I've a list that looks like following a = [ [1,2,3,4], [5,6,7,8] ] Currently, I'm iterating through it like for i in [k for k in a]:        for a in i:                print a but I was wondering if there is a

Re: Kindly show me a better way to do it

2010-05-08 Thread superpollo
superpollo ha scritto: Oltmans ha scritto: Hi, I've a list that looks like following a = [ [1,2,3,4], [5,6,7,8] ] Currently, I'm iterating through it like for i in [k for k in a]: for a in i: i think you used te a identifier for two meanings... print a but I was wondering if

Re: Kindly show me a better way to do it

2010-05-08 Thread Alain Ketterlin
Oltmans rolf.oltm...@gmail.com writes: a = [ [1,2,3,4], [5,6,7,8] ] Currently, I'm iterating through it like for i in [k for k in a]: for a in i: print a I would prefer: for i in a: for v in i: print v i.e., not messing with a and avoiding an additional

Re: Kindly show me a better way to do it

2010-05-08 Thread Tycho Andersen
On Sat, May 8, 2010 at 3:41 PM, Oltmans rolf.oltm...@gmail.com wrote: Hi, I've a list that looks like following a = [ [1,2,3,4], [5,6,7,8] ] Currently, I'm iterating through it like for i in [k for k in a]:        for a in i:                print a but I was wondering if there is a

Re: Kindly show me a better way to do it

2010-05-08 Thread Oltmans
On May 9, 1:53 am, superpollo ute...@esempio.net wrote: add = lambda a,b: a+b for i in reduce(add,a):      print i This is very neat. Thank you. Sounds like magic to me. Can you please explain how does that work? Many thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Re: Kindly show me a better way to do it

2010-05-08 Thread superpollo
Oltmans ha scritto: On May 9, 1:53 am, superpollo ute...@esempio.net wrote: add = lambda a,b: a+b for i in reduce(add,a): print i This is very neat. Thank you. Sounds like magic to me. Can you please explain how does that work? Many thanks again. here: http://tinyurl.com/3xp

Re: Kindly show me a better way to do it

2010-05-08 Thread Günther Dietrich
Tycho Andersen ty...@tycho.ws wrote: On Sat, May 8, 2010 at 3:41 PM, Oltmans rolf.oltm...@gmail.com wrote: Hi, I've a list that looks like following a = [ [1,2,3,4], [5,6,7,8] ] Currently, I'm iterating through it like for i in [k for k in a]:        for a in i:                print a

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread dasacc22
U presume entirely to much. I have a preprocessor that normalizes documents while performing other more complex operations. Theres nothing buggy about what im doing On May 8, 1:46 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sat, 08 May 2010 10:19:16 -0700, dasacc22

Re: Kindly show me a better way to do it

2010-05-08 Thread Tycho Andersen
On Sat, May 8, 2010 at 4:09 PM, Günther Dietrich gd.use...@spamfence.net wrote: [snip] Too simple? No, not at all. I really only intended to point the OP to itertools, because it does lots of useful things exactly like this one. \t -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread Patrick Maupin
On May 8, 1:16 pm, dasacc22 dasac...@gmail.com wrote: On May 8, 12:59 pm, Patrick Maupin pmau...@gmail.com wrote: On May 8, 12:19 pm, dasacc22 dasac...@gmail.com wrote: Hi This is a simple question. I'm looking for the fastest way to calculate the leading whitespace (as a string,

Re: Kindly show me a better way to do it

2010-05-08 Thread Nathan Rice
itertools is also written in c, so if you're working with a big nested list is long it will be a lot faster. On Sat, May 8, 2010 at 5:40 PM, Tycho Andersen ty...@tycho.ws wrote: On Sat, May 8, 2010 at 4:09 PM, Günther Dietrich gd.use...@spamfence.net wrote: [snip] Too simple? No, not at

Re: how to play a sound file repeatedly in loop

2010-05-08 Thread MRAB
varnikat t wrote: How to run sound file repeatedly in loop ? When I do this, it does nothing and terminates: import pygst pygst.require(0.10) import gst, gtk n=0 while n10: player = gst.element_factory_make(playbin2, player) player.set_property(uri, file:/home/varnika/hello.ogg)

Re: Picking a license

2010-05-08 Thread Carl Banks
On May 6, 4:56 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: a...@pythoncraft.com (Aahz) writes: In article 4be05d75.7030...@msn.com, Rouslan Korneychuk  rousl...@msn.com wrote: The only question I have now is what about licensing? Is that something I need to worry about? Should I go

accessing superclass methods from subclass

2010-05-08 Thread ben
Why doesn't this work: class C1: def f1(self): print(f1) class C2(C1): f1() It throws this error: Traceback (most recent call last): File ./c1.py, line 7, in module class C2(C1): File ./c1.py, line 8, in C2 f1() NameError: name 'f1' is not defined f1() is an

Re: accessing superclass methods from subclass

2010-05-08 Thread Chris Rebert
On Sat, May 8, 2010 at 4:50 PM, ben thomasstr...@gmail.com wrote: Why doesn't this work: class C1:    def f1(self):        print(f1) class C2(C1):    f1() It throws this error: Traceback (most recent call last):  File ./c1.py, line 7, in module    class C2(C1):  File ./c1.py, line

Re: accessing superclass methods from subclass

2010-05-08 Thread MRAB
ben wrote: Why doesn't this work: class C1: def f1(self): print(f1) class C2(C1): f1() It throws this error: Traceback (most recent call last): File ./c1.py, line 7, in module class C2(C1): File ./c1.py, line 8, in C2 f1() NameError: name 'f1' is not defined

Re: Picking a license

2010-05-08 Thread Aahz
In article e2467908-621e-4ed4-a549-48160ad64...@b7g2000yqk.googlegroups.com, Carl Banks pavlovevide...@gmail.com wrote: GPL is about fighting a holy war against commercial software. And really, that's a Good Thing. We wouldn't have Python, to some extent, were it not for Stallman and his

Re: Picking a license

2010-05-08 Thread Ben Finney
Patrick Maupin pmau...@gmail.com writes: On May 8, 2:38 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: Which brings us back full circle to Ben's position, which you took exception to. […] To me, the clear implication of the blanket statement that you have to use the GPL

Re: Picking a license

2010-05-08 Thread Ben Finney
a...@pythoncraft.com (Aahz) writes: In article e2467908-621e-4ed4-a549-48160ad64...@b7g2000yqk.googlegroups.com, Carl Banks pavlovevide...@gmail.com wrote: GPL is about fighting a holy war against commercial software. And really, that's a Good Thing. We wouldn't have Python, to some

Re: Picking a license

2010-05-08 Thread Patrick Maupin
On May 8, 8:41 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Patrick Maupin pmau...@gmail.com writes: On May 8, 2:38 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: Which brings us back full circle to Ben's position, which you took exception to. […] To me, the

Re: Cross-platform file paths

2010-05-08 Thread Tim Roberts
utabintarbo utabinta...@gmail.com wrote: Until now, I have used the UNC under Windows (XP) to allow my program to access files located on a Samba-equipped *nix box (eg. os.path.normpath(r\\serverFQDN\sharename\dir\filename)). When I try to open this file under Linux (Red Hat 5), I get a file not

Re: Picking a license

2010-05-08 Thread Paul Rubin
Carl Banks pavlovevide...@gmail.com writes: People who esteem their users give them freedom to use software however they see fit, including combining it with proprietary software. Huh That makes no sense at all. Why should a standard like that be expected from free software developers,

Re: Picking a license

2010-05-08 Thread Paul Rubin
Martin P. Hellwig martin.hell...@dcuktec.org writes: I fail to see what is morally wrong with it. When I ,as the author, share my work to the public, I should have made peace with the fact that I, for all intends and purposes, lost control over its use. Does the same thing apply to Microsoft?

Re: Picking a license

2010-05-08 Thread Paul Rubin
Steven D'Aprano st...@remove-this-cybersource.com.au writes: For the record, I've published software under an MIT licence because I judged the cost of the moral hazard introduced by encouraging freeloaders to be less than the benefits of having a more permissive licence that encourages

Re: accessing superclass methods from subclass

2010-05-08 Thread ben
Ok, thanks for the info. What would be a better way to do this? What I'm trying to do is treat things in a reasonable OOP manner (all fairly new to me, esp. in Python). Here's a made-up example with a little more context. Let's say you're making a drawing program that can draw various shapes.

A more general solution

2010-05-08 Thread 3Jane
You could interpret [[1,2,3,4],[5,6,7,8]] as a tree and your task as traversal of its leaves. All solutions before would not work with trees with bigger height. Here is how to traverse such trees recursively: def eventualPrint(x): for v in x: if isinstance(v, list): eventualPrint(x)

Re: Picking a license

2010-05-08 Thread Robert Kern
On 2010-05-08 22:03 , Paul Rubin wrote: Martin P. Hellwigmartin.hell...@dcuktec.org writes: I fail to see what is morally wrong with it. When I ,as the author, share my work to the public, I should have made peace with the fact that I, for all intends and purposes, lost control over its use.

Re: Picking a license

2010-05-08 Thread Robert Kern
On 2010-05-08 22:12 , Paul Rubin wrote: Steven D'Apranost...@remove-this-cybersource.com.au writes: For the record, I've published software under an MIT licence because I judged the cost of the moral hazard introduced by encouraging freeloaders to be less than the benefits of having a more

Re: accessing superclass methods from subclass

2010-05-08 Thread Chris Rebert
On May 8, 7:05 pm, Chris Rebert c...@rebertia.com wrote: On Sat, May 8, 2010 at 4:50 PM, ben thomasstr...@gmail.com wrote: Why doesn't this work: class C1:    def f1(self):        print(f1) class C2(C1):    f1() It throws this error: Traceback (most recent call last):  File

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread dasacc22
On May 8, 5:18 pm, Patrick Maupin pmau...@gmail.com wrote: On May 8, 1:16 pm, dasacc22 dasac...@gmail.com wrote: On May 8, 12:59 pm, Patrick Maupin pmau...@gmail.com wrote: On May 8, 12:19 pm, dasacc22 dasac...@gmail.com wrote: Hi This is a simple question. I'm looking for

Re: Picking a license

2010-05-08 Thread Paul Rubin
Martin wrote: I fail to see what is morally wrong with it. When I ,as the author, share my work to the public, I should have made peace with the fact that I, for all intends and purposes, lost control over its use. Robert Kern robert.k...@gmail.com writes: Martin is not saying that you

Re: Picking a license

2010-05-08 Thread Carl Banks
On May 8, 7:58 pm, Paul Rubin no.em...@nospam.invalid wrote: Carl Banks pavlovevide...@gmail.com writes: People who esteem their users give them freedom to use software however they see fit, including combining it with proprietary software. Huh  That makes no sense at all.  Why should

Re: Picking a license

2010-05-08 Thread Aahz
In article 7xtyqhu5sg@ruckus.brouhaha.com, Paul Rubin no.em...@nospam.invalid wrote: I don't know if it counts as a moral hazard but some programmers simply don't want to do proprietary product development for free. That's why Linux (GPL) has far more developers (and consequentially far

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread dasacc22
On May 8, 2:46 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sat, 08 May 2010 12:15:22 -0700, Wolfram Hinderer wrote: On 8 Mai, 20:46, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: def get_leading_whitespace(s):     t = s.lstrip()     return

Re: Picking a license

2010-05-08 Thread Paul Rubin
Carl Banks pavlovevide...@gmail.com writes: If a commercial developer has a EULA that prevents users from combining their tools with tools from (say) their competitors, Do you mean something like a EULA that stops you from buying a copy of Oracle and combining it with tools from IBM on the

Re: Picking a license

2010-05-08 Thread Paul Rubin
a...@pythoncraft.com (Aahz) writes: What does your argument claim about Apache? No idea. I don't have the impression the developer communities are really similar, and Apache httpd doesn't have all that many developers compared with something like Linux (I don't know what happens if you add all

Openings at Aspire Systems, Chennai. (Product Dev. Company)

2010-05-08 Thread Nathas
Hi All, Please find below the openings at Aspire Systems, Chennai (www.aspiresys.com) 1. Testing - Selenium, TestComplete, RFT, Manual - SSE and Engineers - 2 + years 2. Java, Swings - Project Leader Position – 5+ years 3. Java, J2EE – Enngineer, SSE, Tech Arch – 2+ Yrs 4. .NET - SSE and Tech

Re: Cross-platform file paths

2010-05-08 Thread Wolfgang Rohdewald
On Sonntag 09 Mai 2010, Tim Roberts wrote: No. On Linux, you need to mount the share in some empty directory (using mount or smbmount), then read the files from that directory. actually the mount directory does not have to be empty - whatever it contains is invisible while someting is mounted

Re: [ANN] Leipzig Python User Group - Meeting, May 11, 2010, 08:00pm

2010-05-08 Thread Eric Stechmann
On May 7, 2010, at 11:00 AM, Stefan Schwarzer wrote: === Leipzig Python User Group === We will meet on Tuesday, May 11, 8:00 pm at the training center of Python Academy in Leipzig, Germany ( http://www.python-academy.com/center/find.html ). Julian Moritz will give a talk about CouchDB. Food

Re: Picking a license

2010-05-08 Thread Patrick Maupin
On May 8, 11:29 pm, Paul Rubin no.em...@nospam.invalid wrote: No it doesn't (not like the above).  You, the licensee under the GPL, can make those combinations and use them as much as you want on your own computers.  You just can't distribute the resulting derivative to other people.  With

Re: Picking a license

2010-05-08 Thread Patrick Maupin
On May 8, 11:36 pm, Paul Rubin no.em...@nospam.invalid wrote: a...@pythoncraft.com (Aahz) writes: What does your argument claim about Apache? No idea.  I don't have the impression the developer communities are really similar, and Apache httpd doesn't have all that many developers compared

Re: Fastest way to calculate leading whitespace

2010-05-08 Thread Steven D'Aprano
On Sat, 08 May 2010 13:46:59 -0700, Mark Dickinson wrote: However, s[:-len(t)] should be both faster and correct. Unless len(t) == 0, surely? Doh! The hazards of insufficient testing. Thanks for catching that. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Picking a license

2010-05-08 Thread Steven D'Aprano
On Sat, 08 May 2010 16:39:33 -0700, Carl Banks wrote: GPL is about fighting a holy war against commercial software. Much GPL software *is* commercial software. Given that you're so badly misinformed about the GPL that you think it can't be commercial, why should we pay any attention to your

Re: Kindly show me a better way to do it

2010-05-08 Thread Lie Ryan
On 05/09/10 07:09, Günther Dietrich wrote: Why not this way? a = [[1,2,3,4], [5,6,7,8]] for i in a: for j in i: print(j) 1 2 3 4 5 6 7 8 Too simple? IMHO that's more complex due to the nested loop, though I would personally do it as: a = [

Re: Picking a license

2010-05-08 Thread Paul Rubin
Patrick Maupin pmau...@gmail.com writes: hybrid models that the GPL doesn't support. See, for example, Apple's support of BSD, Webkit, and LLVM. Apple is not a do no evil corporation, and their contributions back to these packages are driven far more by hard-nosed business decisions than by

  1   2   3   >