On Apr 7, 2:53 am, "R. David Murray" wrote:
> I think the OO way to do this is to provide a method on A that does the
> right thing:
>
> def Bfoo_func(self):
> self.B.foo_func(self)
>
> Or maybe you could look at generic methods, which provide a way
> to do multiple dispatch.
+1
Whic
Wouldn't it be easier just to avoid the windows slashes altogether and
stick to the posix:
title = 'c:/thesis/refined_title.txt'
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 24, 12:50 pm, Johannes Bauer wrote:
> Sebastian Bassi schrieb:
> I'll hand out the "Johannes Bauer Python Certificate of Total
> Awesomeness" for anyone who can write a hello world in python and hands
> me $25000 in cash.
$25,000?! For a certificate? You must be kidding! I can buy a
Do
On Mar 23, 5:59 am, timo.my...@gmail.com (Timo Myyrä) wrote:
> I might get summer job in doing some 2nd tier support and doing
> some scripting besides that in Solaris environment. I gotta see
> what kind of scripts are needed but I'd guess the 2.6 would be the
> safest option.
>
> Timo
Solaris?
On Mar 18, 1:32 am, Armin wrote:
> On Wednesday 18 March 2009 11:01:00 Boris Borcic wrote:
>
> > Armin wrote:
> > >>
> > >> Why on earth would you want to? That'd be like translating Shakespeare
> > >> into a bad rap song!
> > >>
>
> > > lol, actually I would prefer a rap song over Shakespeare,
On Mar 18, 3:05 pm, Grant Edwards wrote:
> {snip] ... If it
> only going to be used once, then just do the usual thing:
>
> f = open(...)
> while True:
> buf = f.read()
> if not buf: break
> # whatever.
> f.close()
+1
That's the canonical way (maybe using "with ... as" nowadays). Surel
On Feb 23, 2:13 am, Torsten Mohr wrote:
> Hi,
>
> how is the rule in Python, if i pass objects to a function, when is this
> done by reference and when is it by value?
>
> def f1(a):
> a = 7
>
> b = 3
> f1(b)
> print b
> => 3
>
> Integers are obviously passed by value, lists and dicts by refer
On Feb 11, 1:48 pm, Jervis Whitley wrote:
> Hello, an idea is optional keyword arguments.
>
> def fact(n, check=False):
> if not check:
> if n < 0: raise ValueError
> if n == 0: return 1
> return fact(n - 1, check=True) * n
>
> essentially hiding an expensive check with a cheap one. It
On Feb 5, 11:45 am, Tim Rowe wrote:
[snip]
> Python in a Nutshell states that os.uname "exists only on certain
> platforms", and in the code sample wraps it in a try statement. That
> seems to be the safe way to go -- except (and I don't know much about
> this) wouldn't code have to be digging
On Feb 5, 11:14 am, Tim Rowe wrote:
...
> On an MS Windows system, os.uname()[0] raises an AttributeError -- sys
> doesn't seem to contain uname. Is that a Linux thing? Would os.name
> work on Linux? Or would one have to use exception handling and catch
> the Windows case?
It seems to be a Wind
On Jan 27, 4:52 am, Paul McGuire wrote:
[snip]
>
> # how you have to do it in C++ and Java
> # light = light.next_state()
>
> # using Python
> light.__class__ = light.next_state
I'm sure you can, but why poke yourself in the eye with a blunt
stick? ;)
IMO there are two obvious pr
On Jan 16, 12:02 pm, The Music Guy wrote:
> Just out of curiousity, have there been any attempts to make a version
> of Python that looks like actual English text? I mean, so much of Python
> is already based on the English language that it seems like the next
> natural step would be to make a pro
12 matches
Mail list logo