On Wed, 10/23/13, Steven D'Aprano wrote:
Subject: Re: [Tutor] Beginner Question
To: tutor@python.org
Date: Wednesday, October 23, 2013, 5:27 AM
On Tue, Oct 22, 2013 at 04:25:59PM
+0200, Sven Hennig wrote:
> Hello, I would like to learn a progr
Hi guys,
I need a bit of help. I'm writing a class, and in the main function I'm trying
to say if this method gets called, do this. I'm trying things like:
program = AnimalClass(x,y,z)for i in range(x): for j in range(y): for k
in range(z): animal = program.animal() if animal:
On 23 October 2013 08:58, Albert-Jan Roskam wrote:
> So the built-in 'len()' is *really* a function, but calls to len()
> implemented by __len__ are method calls *disguised* as function calls? I
> sometimes find it easier to write calls to special methods the "normal" way,
> e.g. instead of "
On 23/10/13 08:25, Corinne Landers wrote:
Hi guys,
I need a bit of help.
I'm writing a class, and in the main function I'm trying to say if this
method gets called, do this.
What you are actually doing is "if the method returns
a truth-like value do this." Not quite the same thing,
but much ea
On 23 October 2013 08:25, Corinne Landers wrote:
> Hi guys,
Hi Corrine,
> I need a bit of help.
> I'm writing a class, and in the main function I'm trying to say if this
> method gets called, do this.
> I'm trying things like:
>
> program = AnimalClass(x,y,z)
> for i in range(x):
>for j in r
On 23/10/2013 03:25, Corinne Landers wrote:
> -->
> Hi guys, I
> need a bit of help. I'm writing a class, and in the main
> function I'm trying to say if this method gets called, do
> this. I'm trying things
> like:program = AnimalClass(x,y,z)for i
> in range(x): for j in range(y):
>
Hello eryksun,
Thanks, very much, for the very quick and helpful reply. It fixed my
problem.
-Sm
On Tue, Oct 22, 2013 at 10:33 PM, eryksun wrote:
> On Tue, Oct 22, 2013 at 9:04 PM, SM wrote:
> > def run(self):
> > (process, err) = Popen(self.fwcmd, stdout=PIPE,
> > std
I have come across the term "self" in a number of Python scripts and as a
beginner to the language I am wondering if it has any specific meaning. It
is usually used in the same manner as in this example by Steven D'Aprano.
class DefaultModelCar:
model = "Unknown"
BRAKE_COMMAND = "B"
Hello all.i have a quite big task, but i have a feeling it could be easily
solved using python.
The thing is, i need to export the whole company DB(Postgresql) to an XML
template provided by another company.
the template looks like this(just a fragment) :
?xml version="1.0" encoding="utf-8"?>
On 23/10/13 17:01, Glenn Lester wrote:
I have come across the term "self" in a number of Python scripts and as
a beginner to the language I am wondering if it has any specific
meaning.
Technically no, the name is arbitrary but self is used by (very strong)
tradition. As to what it is used for
I've looked online but I'm confused - I need to keep it so that the
following program limits the output to two decimal places since it deals in
currency.
How do I incorporate that into my current code below? The textbook I'm
using doesn't describe how to do that. Thanks in advance.
#Challenge Ch
On 23/10/13 22:39, Shelby Martin wrote:
I've looked online but I'm confused - I need to keep it so that the
following program limits the output to two decimal places since it deals
in currency.
Its generally a bad idea to use floats when dealing with currency since
they can introduce small err
On Wed, Oct 23, 2013 at 4:13 PM, Alan Gauld wrote:
> On 23/10/13 22:39, Shelby Martin wrote:
>
>> I've looked online but I'm confused - I need to keep it so that the
>> following program limits the output to two decimal places since it deals
>> in currency.
>>
>
> Its generally a bad idea to use f
13 matches
Mail list logo