Need help with simple OOP Python question

2011-09-04 Thread Kristofer Tengström
Hi, I'm having trouble creating objects that in turn can have custom objects as variables. The code looks like this: - class A: sub = dict() def sub_add(self, cls): obj = cls() self.sub[obj.id] = obj class B(A): id = 'inst'

Hello, and request for help with 'dynamic grids'

2011-09-04 Thread Simon Cropper
Hi, I am a applications developer - originally from Windows using primarily Visual Foxpro, although I am familiar with a variety of other xbase derivatives. I now use Linux / Ubuntu, and have been actively teaching myself Python with the view to migrate most of my applications to sqlite-based

Re: Functions vs OOP

2011-09-04 Thread Chris Angelico
On Mon, Sep 5, 2011 at 9:41 AM, Steven D'Aprano wrote: > http://docs.python.org/dev/howto/functional.html > > What about the entire "Introduction" section, which starts with this > statement? > > "This section explains the basic concept of functional programming" > > If you would like to suggest i

Re: Functions vs OOP

2011-09-04 Thread William Gill
On 9/4/2011 7:41 PM, Steven D'Aprano wrote: William Gill wrote: The source of my error is "Functional Programming HOWTO (/python-3.1.3-docs-html/howto/functional.html)" For those who don't have access to William's local file system, I expect he's looking at this: http://docs.python.org/relea

Re: Functions vs OOP

2011-09-04 Thread Steven D'Aprano
William Gill wrote: > The source of my error is "Functional Programming HOWTO > (/python-3.1.3-docs-html/howto/functional.html)" For those who don't have access to William's local file system, I expect he's looking at this: http://docs.python.org/release/3.1.3/howto/functional.html or the most

pyOpenSSL 0.13 release

2011-09-04 Thread exarkun
Hello all, I'm happy to announce the release of pyOpenSSL 0.13. With this release, pyOpenSSL now supports OpenSSL 1.0. Additionally, pyOpenSSL now works with PyPy. Apart from those two major developments, the following interesting changes have been made since the last release: * (S)erve

Re: Tkinter label height to fit content

2011-09-04 Thread rantingrick
On Sep 4, 2:39 pm, Bart Kastermans wrote: > Thx.  That function should allow for a bit of robustness. Correction. The function is actually "tkFont.metrics(arg)" which takes "linespace" as an optional argument. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter label height to fit content

2011-09-04 Thread rantingrick
On Sep 4, 2:39 pm, Bart Kastermans wrote: > I get bits of information over RSS, these are of varying length.  I > want to show 10 at a time, and scroll through them.  Now when I > scroll the window grows and shrinks depending on their size, I want > to right from the start make it high enough to

[RELEASED] Python 3.2.2

2011-09-04 Thread Georg Brandl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team, I'm happy to announce the Python 3.2.2 maintenance release. Python 3.2.2 mainly fixes `a regression `_ in the ``urllib.request`` module that prevented opening many HTTP resources

Re: Functions vs OOP

2011-09-04 Thread William Gill
On 9/4/2011 2:32 PM, Terry Reedy wrote: On 9/4/2011 4:13 AM, tinn...@isbd.co.uk wrote: Ian Kelly wrote: Functional programming is about using functions in the *mathematical* sense. A mathematical function maps one value (or tuple of values) to another value. The mapped value never varies; if

Re: Tkinter label height to fit content

2011-09-04 Thread Bart Kastermans
rantingrick writes: > On Sep 3, 5:15 pm, Bart Kastermans wrote: > >> Any suggestions? > > Yeah, have you considered using the "linespace()" method of tk.Font > objects to calculate the height? Although i must say it "feels" as if > your doing something you should not need to do, however i cannot

Re: Installing WebDAV server

2011-09-04 Thread Thomas 'PointedEars' Lahn
Fokke Nauta wrote: > "Thomas 'PointedEars' Lahn" wrote in message > news:109595831.vcn276c...@pointedears.de... > > > > If you don't have anything better to contribute, please stop answering. > > Es gen�gt schon. I should have expected as much from an address munger. *plonk* -- PointedEar

Re: allow line break at operators

2011-09-04 Thread rantingrick
On Sep 4, 10:22 am, ron3200 wrote: > I think this is one of those areas where computers and people differ, > but it may also depend on the persons native language as to what works > better for them. Yes but what works better for "them" is not always a better way of doing things! People do foolis

Re: Functions vs OOP

2011-09-04 Thread Terry Reedy
On 9/4/2011 4:13 AM, tinn...@isbd.co.uk wrote: Ian Kelly wrote: Functional programming is about using functions in the *mathematical* sense. A mathematical function maps one value (or tuple of values) to another value. The mapped value never varies; if it did, it would be a different functi

Re: Can't use subprocess.Popen() after os.chroot() - why?

2011-09-04 Thread Hans Mulder
On 4/09/11 17:25:48, Alain Ketterlin wrote: Erik writes: import os from subprocess import Popen, PIPE os.chroot("/tmp/my_chroot") p = Popen("/bin/date", stdin=PIPE, stdout=PIPE, stderr=PIPE) stdout_val, stderr_val = p.communicate() print stdout_val but the Popen call is dying with the follow

Re: [Python-ideas] allow line break at operators

2011-09-04 Thread ron3200
On Sat, 2011-09-03 at 13:38 +0900, Stephen J. Turnbull wrote: > Guido van Rossum writes: > > On Fri, Sep 2, 2011 at 12:28 AM, Stephen J. Turnbull > wrote: > > > > Sure, but IIRC one design principle of Python is that the keyword that > > > denotes the syntax should be the first thing on the l

Re: allow line break at operators

2011-09-04 Thread rantingrick
On Sep 3, 11:50 am, Stephen Hansen wrote: > Freedom is not and never has been, IMHO, a virtue or goal or even desire > in Python. Exactly! > Where it occurs, it is at best a happy coincidence, Exactly! > and even > if that happy coincidence happens often, it is not a design feature, IMHO. Ex

Re: Can't use subprocess.Popen() after os.chroot() - why?

2011-09-04 Thread Alain Ketterlin
Erik writes: > import os > from subprocess import Popen, PIPE > > os.chroot("/tmp/my_chroot") > p = Popen("/bin/date", stdin=PIPE, stdout=PIPE, stderr=PIPE) > stdout_val, stderr_val = p.communicate() > print stdout_val > > but the Popen call is dying with the following exception: > > Traceback (m

Can't use subprocess.Popen() after os.chroot() - why?

2011-09-04 Thread Erik
Hi All, I'm trying to do the following: import os from subprocess import Popen, PIPE os.chroot("/tmp/my_chroot") p = Popen("/bin/date", stdin=PIPE, stdout=PIPE, stderr=PIPE) stdout_val, stderr_val = p.communicate() print stdout_val but the Popen call is dying with the following exception: Tra

Re: Functions vs OOP

2011-09-04 Thread rusi
On Sep 3, 9:15 pm, William Gill wrote: > During some recent research, and re-familiarization with Python, I came > across documentation that suggests that programming using functions, and > programming using objects were somehow opposing techniques. Staying with (for the moment) the suggestion th

Re: Functions vs OOP

2011-09-04 Thread Steven D'Aprano
tinn...@isbd.co.uk wrote: > I think there may be another issue here. If someone says "functional > programming" to me then I would generally assume that they *do* mean > "programming using functions". Strictly speaking you are correct, "functional programming" does mean "programming using func

Re: Need advice on Web / Database framework...

2011-09-04 Thread Alexandru Lazar
> How does web2py compare to django? I just started playing with django, > but don't know web2py I haven't used Django, but I did use web2py for a project that fell on my head just before leaving my old workplace. I just wanted it to end quickly so I took web2py as a shortcut. It's a great framew

Re: [Python-ideas] allow line break at operators

2011-09-04 Thread Yingjie Lan
> Thanks, I think that's the rule described in its full glory. Currently I am not  quite sure of the use case for continuation nested in continuation -- it seems to be still a single continuation, but it allows for some additional freedom in formatting the continued line. Do you have other use

Re: Functions vs OOP

2011-09-04 Thread Adam Jorgensen
Progranming with functions vs Progranming with objects sounds like C vs. C++ more than functional programming vs. OO programming On 4 September 2011 04:18, William Gill wrote: > On 9/3/2011 9:51 PM, Terry Reedy wrote: > >> >> It is possible that our doc was less than crystal clear. We are >> con

Re: Installing WebDAV server

2011-09-04 Thread Fokke Nauta
"Thomas 'PointedEars' Lahn" wrote in message news:109595831.vcn276c...@pointedears.de... If you don't have anything better to contribute, please stop answering. Es genügt schon. Fokke -- http://mail.python.org/mailman/listinfo/python-list

Re: Functions vs OOP

2011-09-04 Thread tinnews
Ian Kelly wrote: > On Sat, Sep 3, 2011 at 10:15 AM, William Gill wrote: > > During some recent research, and re-familiarization with Python, I came > > across documentation that suggests that programming using functions, and > > programming using objects were somehow opposing techniques. > > > >