Hello,
Pyenos a écrit :
> Thanks for clarifying the definitions of nested class and
> subclass. However, it did not solve my original problem, and I have
> redefined my question:
>
> class Class1:
> class Class2:
> class Class3:
> def __init__(self):
> self
On Wed, 27 Dec 2006 23:27:08 +0100, Marc 'BlackJack' Rintsch
<[EMAIL PROTECTED]> wrote:
>In <[EMAIL PROTECTED]>, Osiris wrote:
>
>> I have an array (I come from C) of identical objects, called sections.
>> These sections have some feature, say a length, measured in mm, which
>> is calculated by a
At Thursday 28/12/2006 01:31, Pyenos wrote:
class Class3:
def method():print Class1.Class2.variable #problem
In all your examples, you wrote def method() instead of def method(self).
Error messages are usually meaningful, they give you valuable
informati
"Erik Johnson" <> typed
>
> "Ben Finney" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> "Sebastian 'lunar' Wiesner" <[EMAIL PROTECTED]> writes:
>>
>> > Just a tip for you: In python you never use tabs for indentation.
>>
>> For some value of "you".
>>
>> > The python style guid
At Thursday 28/12/2006 01:39, Pyenos wrote:
class Class1:
class Class2(Class1):
variable="variable"
class Class3(Class2):
print Class1().Class2().variable #problem
Also, why is this wrong?
Again, don't write just "problem"!
What
At Thursday 28/12/2006 03:18, Pyenos wrote:
class Class1:
class Class2:
class Class3:
def __init__(self):
self.var="var"
class Class4:
print Class1.Class2.Class3.var
This code gives me the error:
Traceback (most recent call las
Duncan Booth schreef:
> The /> was in the original input that you gave it:
>
>
>
> You don't actually *have* to escape > when it appears in html.
You don't have to escape it in XML either, except when it's preceded by
]].
> As I said before, it looks like BeautifulSoup decided that the tag ende
On Wed, 27 Dec 2006 16:29:29 -0600, "Paul McGuire"
<[EMAIL PROTECTED]> wrote:
>"Osiris" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>> Is the following intuitively feasible in Python:
>> I have an array (I come from C) of identical objects, called sections.
>> These sections have
Hi,
I wish to write a Python wrapper for my C# COM object but am unsure
where to start. I have a dll and a tlb file, and I can use this object
in C via the following code -
// ConsolApp.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "windows.h"
#include
Hi all,
I will try to explain my problem, and wait for someone here give me
solutions: (sorry for the bad, bad english)
I have a server application that talks with another client applications
using socket. The problem isnt this, i did and works very well.
The problem is open the router po
hi,
i am creating a program to go through a directory structure recursively
(including directories below it) and move all files that end in .msf to
a directory above the current level.
the code i have so far is as follows:
#!/usr/bin/python
#Author: Evan Carmi
#Date: 20061101
#Purpose: To unco
On Thu, 28 Dec 2006 09:26:28 +0100, Sebastian 'lunar' Wiesner wrote:
> It is, and especially the problems with tabs shows you, why it is good
> practice to follow the standard in your own code, too...
I don't know what "problems" with tabs you are talking about. I never have
problems with tabs. *
"Anne van Kesteren" <[EMAIL PROTECTED]> wrote:
>> Mind you, the sentence before that says 'should' for quoting <
>> characters which is just plain silly.
>
> For quoted attribute values it isn't silly at all. It's actually part
> of how HTML works.
>
Yes, but the sentence I was complaining abou
In <[EMAIL PROTECTED]>, Osiris wrote:
> Would I put all the stuff that is the same in both classes in the base
> class and only the differing stuff in the subclasses ?
Yes that's the intent of base/sub class relationships. Baseclasses
contain the behavior common to all their subclasses and subcl
Gabriel Genellina wrote:
> >>> class One(object): pass
> ...
> >>> a = One(1,2)
> Traceback (most recent call last):
>File "", line 1, in ?
> TypeError: default __new__ takes no parameters
>
> How do you make Python silently ignore the arguments?
sorry, my bad, that beauvoir was python 2.2
Steven D'Aprano wrote:
> On Thu, 28 Dec 2006 09:26:28 +0100, Sebastian 'lunar' Wiesner wrote:
>
>> It is, and especially the problems with tabs shows you, why it is good
>> practice to follow the standard in your own code, too...
>
> I don't know what "problems" with tabs you are talking about.
I would like some advice, I'm going to build a small app that will, among
other things, scale images so that they can be published on a web site. I've
never done any image processing in python before so I would like to ask what
is the best way of doing this, I will not do anything else than scal
#!/usr/bin/python
# answers.py --- A simple answer bot
# Copyright (C) 2006 Logan Lee
#
# MESSAGE:
#
# This program is a simple text-console program
#+that asks for a problem and its solution then
#+persists the problem-solution dictionary to
Steven D'Aprano <[EMAIL PROTECTED]> typed
> On Thu, 28 Dec 2006 09:26:28 +0100, Sebastian 'lunar' Wiesner wrote:
>
>> It is, and especially the problems with tabs shows you, why it is
>> good practice to follow the standard in your own code, too...
>
> I don't know what "problems" with tabs you
On Thu, 28 Dec 2006 08:48:53 +0100, Osiris <[EMAIL PROTECTED]> wrote:
>On Wed, 27 Dec 2006 16:12:02 +0100, Osiris <[EMAIL PROTECTED]> wrote:
>
>>I found this text about combining C-code with Pyton scripting on the
>>P2P networks in PDF:
>>
>>Python Scripting for Computational Science
>>Hans Petter
On Thu, 28 Dec 2006 11:14:27 +0100, Marc 'BlackJack' Rintsch
<[EMAIL PROTECTED]> wrote:
>In <[EMAIL PROTECTED]>, Osiris wrote:
>
>> Would I put all the stuff that is the same in both classes in the base
>> class and only the differing stuff in the subclasses ?
>
>Yes that's the intent of base/sub
Sebastian 'lunar' Wiesner schrieb:
> Ben <[EMAIL PROTECTED]> typed
>
>> I have a python script on a windows system that runs fine. Both use
>> tabs to indent sections of the code.
>
> Just a tip for you: In python you never use tabs for indentation. The
> python style guide [1] recommends four sp
Christophe Cavalaria schrieb:
> Steven D'Aprano wrote:
> You gave the reason in your post : because other people who are using
> software that doesn't understand tabs as YOU expect them to have problems
> with your code.
>
> Tabs aren't a problem at all as long as nobody else than you edit your c
Kajsa Anka wrote:
> I would like some advice, I'm going to build a small app that will, among
> other things, scale images so that they can be published on a web site. I've
> never done any image processing in python before so I would like to ask what
> is the best way of doing this, I will not do
Felix Benner wrote:
> Christophe Cavalaria schrieb:
>> Steven D'Aprano wrote:
>
>> You gave the reason in your post : because other people who are using
>> software that doesn't understand tabs as YOU expect them to have problems
>> with your code.
>>
>> Tabs aren't a problem at all as long as n
In <[EMAIL PROTECTED]>, Pyenos wrote:
> global ANSWER_PATH
``global`` at module level has no effect. That keyword is used to declare
names in functions or methods global that would be local to the function
otherwise and it's only needed if you want to *assign* to the global name
from within a fu
Felix Benner <[EMAIL PROTECTED]> wrote:
> So what's the point in typing four spaces for indentation instead of one
> tab?
So long as you always use only tabs there is no problem. So long as you
only use spaces there is no problem. If you mix tabs and spaces you can
introduce bugs. In particular
In <[EMAIL PROTECTED]>, Felix Benner wrote:
> I like using tabs. And the style guide doesn't give a reason why one
> shouldn't and neither does the thread
> http://www.python.org/search/hypermail/python-1994q2/0198.html in the
> archive.
> So what's the point in typing four spaces for indentation
Marc 'BlackJack' Rintsch wrote:
> > def __init__(self,answers={}):
> > self.answers=answers
>
> Default arguments are only evaluated once when the ``def`` is executed,
> so all your `Storage` classes share the same dictionary. One idiom to
> solve this is:
>
> def __init__(self,
Kajsa Anka wrote:
> I would like some advice, I'm going to build a small app that will, among
> other things, scale images so that they can be published on a web site. I've
> never done any image processing in python before so I would like to ask what
> is the best way of doing this, I will not do
Kajsa Anka:
> I found the Python Imaging Library but before I dive into that I would like
> to know if there is a better way of doing this.
PIL is very fit for that. Note that it creates thumbnails already by
itself, you can use that for bigger images too.
Bye,
bearophile
--
http://mail.python.
[EMAIL PROTECTED] skrev:
> Hi,
>
> I wish to write a Python wrapper for my C# COM object but am unsure
> where to start. I have a dll and a tlb file, and I can use this object
> in C via the following code -
>
> // ConsolApp.cpp : Defines the entry point for the console application.
> //
> #inclu
Marc 'BlackJack' Rintsch:
You give lot of comments and I agree with most of them.
> One idiom to solve this is:
> def __init__(self, answers=None):
> self.answers = answers or dict()
I suggest to avoid such usage of or/and (expecially for newbies), that
is triky and can produce bugs,
On Dec 28, 10:25 am, Evan Carmi <[EMAIL PROTECTED]> wrote:
> hi,
>
> i am creating a program to go through a directory structure recursively
> (including directories below it) and move all files that end in .msf to
> a directory above the current level.
>
> the code i have so far is as follows:
>
I have tried this, with Psyco it segfaults, and with Python 2.5 (on
Win) hangs the interpreter, is it possible to improve the situation?
class T(object):
def __getattr__(self, x): dir(self)
#import psyco
#psyco.full()
T().method()
(Probably dir calls __getattr__).
Bye,
bearophile
--
http://m
Assume I have a tab-delimited text file called foo.txt organized as
follows:
x11 -0.04
x22 -0.42
x33 0.3
My goal is to read in this file and use the information therein to
output a new file that is organized as follows:
x11 IRM=3PL IPB= -0.04
x22 IRM=3PL IPB= -0.
Erik Johnson wrote:
>> but it's still not quit handy
>>
>> # initialization file (init1.py)
>> import time;
>> xx = 44
>>
>> # main file was
>> print xx
>> x=time.time()
>>
>> # main file should become
>> print init1.xx
>> x=init1.time.time()
>>
>> so even for the "standard" functions like "time" I
I want to return a "simple" variable from a function,
not using the function result.
Is that in any way possible ??
The code below is from O'Reilly, "Learning Python",
and there seems no way
to return a simple var like "z" in the example below.
Is that true ?
thanks,
Stef Mientki
def some_funct
On 2006-12-28, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> I've spent a lot of time reading both sides of the tabs versus spaces
> argument, and I haven't found anything yet that explains why tabs are, in
> and of themselves, bad.
They aren't. Using tabs isn't bad. Using both tabs and spaces
i
Gabriel Genellina wrote:
> At Tuesday 26/12/2006 18:08, John Machin wrote:
> > > > I'm looking for a module to do fuzzy comparison of strings. [...]
> Other alternatives: trigram, n-gram, Jaro's distance. There are some
> Python implem. available.
Quick question, you mentioned the data you need
On 2006-12-28, Felix Benner <[EMAIL PROTECTED]> wrote:
> I like using tabs. And the style guide doesn't give a reason
> why one shouldn't and neither does the thread
> http://www.python.org/search/hypermail/python-1994q2/0198.html
> in the archive. So what's the point in typing four spaces for
> i
[EMAIL PROTECTED] wrote:
> I have tried this, with Psyco it segfaults, and with Python 2.5 (on
> Win) hangs the interpreter, is it possible to improve the situation?
>
> class T(object):
> def __getattr__(self, x): dir(self)
> #import psyco
> #psyco.full()
> T().method()
>
> (Probably dir calls
In <[EMAIL PROTECTED]>, Stef Mientki wrote:
> I want to return a "simple" variable from a function, not using the
> function result.
Why?
> The code below is from O'Reilly, "Learning Python", and there seems no
> way to return a simple var like "z" in the example below. Is that true ?
To return
Gabriel Genellina wrote:
> At Tuesday 26/12/2006 18:08, John Machin wrote:
> > > > I'm looking for a module to do fuzzy comparison of strings. [...]
> Other alternatives: trigram, n-gram, Jaro's distance. There are some
> Python implem. available.
Quick question, you mentioned the data you need
How about restructuring your function like this:
def some_function( z,y ):
z = 2
y[2] = 'global ?'
return z
And then you'll have to react to the returning variable, like this in
your code:
x = 5
y = [1,2,3,4]
print x,y
print some_function( x, y )
print x,y
Now, it appears like you want so
As part of some django usage I need to get some ReportLab C extensions into a
state where they can be safely used with mod_python.
Unfortunately we have C code that seems incompatible with mod_python and I'm
looking for ways to improve the situation.
Basically the main things that are wrong are
On Thu, 2006-12-28 at 16:14 +0100, Stef Mientki wrote:
> I want to return a "simple" variable from a function,
> not using the function result.
> Is that in any way possible ??
>
> The code below is from O'Reilly, "Learning Python",
> and there seems no way
> to return a simple var like "z" in the
Maksim Kasimov:
> how to improve the situation depends on what do you expect to get by calling
> "T().method()"
You are right, sorry for being cryptic. I think that's a kind of bug of
Python (produced maybe by an infinite loop), so an improvement can be a
traceback or some automatic breaking of t
Hi to all,
is there a way to use an RDBMS (in my case, SQL Server) from Python by
using some built-in module of the language (v. 2.5) and through ODBC ??
I saw some samples that use statements like "import dbi" or "import
odbc" but neither modules (dbi, odbc) are present on my system...
Any hint(
On Thu, 2006-12-28 at 15:28 +, Paul Hummer wrote:
> You'd have to either pass the variables by reference into the function, [...]
In Python, all function calls are call by reference. Period. The key
difference between Python and other programming languages is in the
behavior of the assignment
king kikapu wrote:
> Hi to all,
>
> is there a way to use an RDBMS (in my case, SQL Server) from Python by
> using some built-in module of the language (v. 2.5) and through ODBC ??
> I saw some samples that use statements like "import dbi" or "import
> odbc" but neither modules (dbi, odbc) are pre
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> typed
> In <[EMAIL PROTECTED]>, Felix Benner wrote:
>
>> I like using tabs. And the style guide doesn't give a reason why one
>> shouldn't and neither does the thread
>> http://www.python.org/search/hypermail/python-1994q2/0198.html in the
>> archive.
Hey Martin,
thanks for the fast reply!
I have already seen that link and i just downloaded the pyodbc module
but isn't Python already containing a "built-in" odbc module so to
allow for db communication ??
On Dec 28, 6:06 pm, "Martin P. Hellwig" <[EMAIL PROTECTED]> wrote:
> king kikapu wrote:
>
I have an application written in jython which has to process a number
of records. It runs fine until it gets to about 666 records (and maybe
that's a sign), and then, it's performance and responsiveness goes down
the toilet. It looks like it's running out of memory and is being
forced to use extend
On 28 Dec 2006 07:45:05 -0800, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Maksim Kasimov:
> > how to improve the situation depends on what do you expect to get by
> > calling "T().method()"
>
> You are right, sorry for being cryptic. I think that's a kind of bug of
> Python (produced maybe by
> You should also think long and hard about *why* you want to return a
> value from a function by modifying an input parameter instead of just
> using the return statement. The "return by modifying an input parameter"
> approach comes from C where that's the only way to return more than one
> valu
king kikapu wrote:
> Hey Martin,
>
> thanks for the fast reply!
>
> I have already seen that link and i just downloaded the pyodbc module
> but isn't Python already containing a "built-in" odbc module so to
> allow for db communication ??
>
Not that I'm aware of, but it is possible to do odbc w
On 12/28/06, Robin Becker <[EMAIL PROTECTED]> wrote:
> As part of some django usage I need to get some ReportLab C extensions into a
> state where they can be safely used with mod_python.
>
> Unfortunately we have C code that seems incompatible with mod_python and I'm
> looking for ways to improve
On 12/28/06, Chris Mellon <[EMAIL PROTECTED]> wrote:
> On 28 Dec 2006 07:45:05 -0800, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
> > Maksim Kasimov:
> > > how to improve the situation depends on what do you expect to get by
> > > calling "T().method()"
> >
> > You are right, sorry for being cr
king kikapu írta:
> Hey Martin,
>
> thanks for the fast reply!
>
> I have already seen that link and i just downloaded the pyodbc module
> but isn't Python already containing a "built-in" odbc module so to
> allow for db communication ??
>
There is no built-in ODBC module. We all know that Pytho
On 12/28/06, Martin P. Hellwig <[EMAIL PROTECTED]> wrote:
> king kikapu wrote:
> > Hey Martin,
> >
> > thanks for the fast reply!
> >
> > I have already seen that link and i just downloaded the pyodbc module
> > but isn't Python already containing a "built-in" odbc module so to
> > allow for db com
Hi all,
While working on support at work, I have been picking away at Python -
because I think it could be a valuable scripting tool for building
utilities from. I have been reading the python.org tutorials, and
playing around with some basic code, but I have ended up with a few
questions that pro
On 2006-12-28, jonathan.beckett <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> While working on support at work, I have been picking away at Python -
> because I think it could be a valuable scripting tool for building
> utilities from. I have been reading the python.org tutorials, and
> playing around w
Chris Mellon wrote:
> On 12/28/06, Robin Becker <[EMAIL PROTECTED]> wrote:
>> As part of some django usage I need to get some ReportLab C extensions into a
>> state where they can be safely used with mod_python.
.
>>
>
> Just off the top of my head, I'd think that using thread-local storag
On 28 Dec 2006 08:40:02 -0800, jonathan.beckett
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
> While working on support at work, I have been picking away at Python -
> because I think it could be a valuable scripting tool for building
> utilities from. I have been reading the python.org tutorials, and
>
[EMAIL PROTECTED] wrote:
> Maksim Kasimov:
>> how to improve the situation depends on what do you expect to get by calling
>> "T().method()"
>
> You are right, sorry for being cryptic. I think that's a kind of bug of
> Python (produced maybe by an infinite loop), so an improvement can be a
> trac
This month there was/is a 1000+ long thread called:
"merits of Lisp vs Python"
In comp.lang.lisp.
If you followed even parts of the thread, AND previously
used only one of the languages AND (and this is the
crucial bit), were persuaded to have a more positive view
of the other language; (deep bre
I have a TreeView and a ToolButton. The ToolButton should only be
active if the user has selected an item in the TreeView. What signal
should I use to achieve this?
Thanks,
David
--
http://mail.python.org/mailman/listinfo/python-list
Chris Mellon wrote:
>
> Nothing so clever. dir() eats and ignores all exceptions, so when you
> hit the recursion limit it eats the RecursionLimitExceeded exception
> and continues merrily along the way. This is probably not good
> behavior...
>
> class Foo:
>def __getattr__(self, attr):
>
Chris Mellon wrote:
> On 28 Dec 2006 08:40:02 -0800, jonathan.beckett
> <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > While working on support at work, I have been picking away at Python -
> > because I think it could be a valuable scripting tool for building
> > utilities from. I have been readi
Robin Becker wrote:
> Chris Mellon wrote:
>> On 12/28/06, Robin Becker <[EMAIL PROTECTED]> wrote:
>>> As part of some django usage I need to get some ReportLab C extensions into
>>> a
>>> state where they can be safely used with mod_python.
> .
>> Just off the top of my head, I'd think tha
> I know that this probably does not exist in the Python library already
> as a platform-independant abstraction (even though it probably could),
> but then I would at least like solutions that works on Windows and on
> Linux.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/134892
But it
On 12/28/06, Robin Becker <[EMAIL PROTECTED]> wrote:
> Robin Becker wrote:
> > Chris Mellon wrote:
> >> On 12/28/06, Robin Becker <[EMAIL PROTECTED]> wrote:
> >>> As part of some django usage I need to get some ReportLab C extensions
> >>> into a
> >>> state where they can be safely used with mod_
Hello...
I have a dictionary, where each value is a seperate instance of the
same class:
self.mop_list[record_number]=record(self.mops[:])
In my case I know that record_number takes the values 0,3,and 7 thanks
to a loop, giving me three instances of the record class instantiaterd
with some data
Hi Grant, thanks for the code snippets - made total sense.
On the evidence of the last couple of hours, Python is still feeling
very alien, but I'm starting to get my head around it.
I'm just finding it a bit weird that some of the built in functions are
static, rather than methods of objects (su
On 2006-12-28, jonathan.beckett <[EMAIL PROTECTED]> wrote:
>> > Given the code below, why does the count method return what it does?
>> > How *should* you call the count method?
>> > a = []
>> > a.append(1)
>> > print a.count
>>
>> print a.count().
Which will cause an exception, BTW, since
On 2006-12-28, jonathan.beckett <[EMAIL PROTECTED]> wrote:
> I'm just finding it a bit weird that some of the built in functions are
> static, rather than methods of objects (such as len() being used to
> find the length of a list).
Well, they actually are methods of objects (at least they are
no
cypher543 skrev:
> I have a TreeView and a ToolButton. The ToolButton should only be
> active if the user has selected an item in the TreeView. What signal
> should I use to achieve this?
>
> Thanks,
> David
>
Hey
I use the "curselection()" function.
Example:
id = self.listbox.curselection()
id
> > I normally work with PHP, C#, Javascript, and the odd bit of C++,
>
> Do any of them call functions w/o parens?
That's a really good point :)
--
http://mail.python.org/mailman/listinfo/python-list
IRC Server:Freenode
IRC Channel: #moderncalcs
Purpose:
#moderncalcs created December 2005 is intended as a real-time
chat channel for anyone using any model of
scientific/graphing/programmable
calculator, especially those of modern design. However, any
calculator-related
topic is acceptable.
jonathan.beckett wrote:
> Hi all,
>
> While working on support at work, I have been picking away at Python -
> because I think it could be a valuable scripting tool for building
> utilities from. I have been reading the python.org tutorials, and
> playing around with some basic code, but I have en
> Too many misconceptions here (I changed to a more PEP-8 style naming):
>
>class Gun(object):
>def __init__(self):
>self.shells = 10
>
>class Battleship(object):
>def __init__(self):
>self.guns = [Gun(), Gun()]
>
>def getShellsLeft(self):
>
Hey!
I know there is a module named SendKeys.
SendKeys module it can type strings as you where typing it, on the keyboard.
But is there a module that does the reverse. A module that gets
_anything_ what the keyboard writes.
For example. If i type "hey" on my keyboard. Will the program get the
st
"Ben" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This seems to work without any errors. But bizzarely I find that
> whatever my record number, the instance of "my_class" is appended to
> every list. So in this case
>
> self.mop_list[0].my_list.append(my_class(Some data for th
Has anyone seen the following?
I've got a somewhat complicated program that includes pygtk, some C/C++
code, and lots of Python code.
My problem is that when some code tries to use a global variable that
hasn't yet been created, or tries to invoke a method/function that
doesn't exist in anothe
Carsten Haese wrote:
> On Thu, 2006-12-28 at 15:28 +, Paul Hummer wrote:
>> You'd have to either pass the variables by reference into the function, [...]
>
> In Python, all function calls are call by reference. Period. The key
> difference between Python and other programming languages is in t
eldorado wrote:
> >>> g = os.popen("ps -ef | grep HUB | grep -v grep | awk '{ print $2 }'")
> >>> h = g.readlines()
> >>> g.close()
> >>> h
> ['87334\012']
> >>> h = h[:-1]
> >>> h
> []
> >>>
I understand you're probably set, but instead of using readlines() you
could also do this:
g = os
h
I am using the standard xml library to create another library able to
read, and maybe write,
xmp files.
Then an xml library bug popped out:
xml.dom.minidom was unable to parse an xml file that came from an
example provided by an official organism.(http://www.iptc.org/IPTC4XMP)
The parsed file was
Steven D'Aprano wrote:
> I don't know what "problems" with tabs you are talking about. I never have
> problems with tabs. *Other people* who choose to use software that doesn't
> understand tabs have problems.
>
> I've spent a lot of time reading both sides of the tabs versus spaces
> argument, a
Ah - ok. In fact I simply had:
class record:
my_list =[]
mops=[]
def __init__(self,mops):
self.mops=mops
Where mops is something I pass in when i create the instance. I had
thought that then each time I created an instance of the record class
as an element
"Imbaud Pierre" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Now my points are:
> - how do I spot the version of a given library? There is a __version__
>attribute of the module, is that it?
Yes, the module maintainer should be incrementing this version for each new
release a
Ah - I have been very silly indeed!
I had not realised that by creating my lists outside of the
def__init___() constructor they would always be class rather than
instance variables, and so there was only one of them when I referred
to it. Thanks to Erik and Chris for your help!
Ben
Ben wrote:
"Ben" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> class record:
> my_list =[]
> mops=[]
>
> def __init__(self,mops):
> self.mops=mops
Similar to the example I gave, the lists my_list and mops shown above are
executed just once: when your
Yes- I can see that my_list and mops, being outside def __init__()
only get created once, hence the confusion.
Surely def __init__() gets called each time an instance is created
however? But the snag is that if they have default values set these are
shared between all instances, even if they are,
On Thu, 2006-12-28 at 19:49 +0100, Stef Mientki wrote:
> [...]
> When I replace the assignment to "filter_prev", by a loop,
> the function works as expected.
>
>#filter_prev = Extended [ len(Signal_IN) : ]
>for i in range( len(filter_prev )):
> filter_prev[i] = Extended [ len(Signal_I
#!/usr/bin/python
# answers.py --- A simple answer-bot.
# Copyright 2006 Logan Lee
#
# RELEASE NOTES:
#
# - I have fixed an error where the program crashes on query of
#+unknown string to answers dictionary.
# - Rephrased 'Do you h
Thanks, Robert! That was exactly what I was looking for.
-k
"fumanchu" <[EMAIL PROTECTED]> wrote:
>Kevin Little wrote:
>> In Python 2.4 or 2.5, what is the easiest way to hook any and all
>> callables such that designated code is executed at the very start and
>> end of each call? (Yes, I'm t
Tom Plunket wrote:
> Frederic Rentsch wrote:
>
>
>> It this works, good for you. I can't say I understand your objective.
>> (You dedent common leading tabs, except if preceded by common leading
>> spaces (?)).
>>
>
> I dedent common leading whitespace, and tabs aren't equivalent to
> spa
"Ben" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Yes- I can see that my_list and mops, being outside def __init__()
> only get created once, hence the confusion.
>
> Surely def __init__() gets called each time an instance is created
> however? But the snag is that if they have
Erik Johnson a écrit :
> "Imbaud Pierre" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>>Now my points are:
>>- how do I spot the version of a given library? There is a __version__
>> attribute of the module, is that it?
>
>
> Yes, the module maintainer should be incrementing
1 - 100 of 138 matches
Mail list logo