[Tutor] Problem with creating a class to access a 2d array

W W srilyk at gmail.com
Sat Aug 23 03:09:16 CEST 2008


On Fri, Aug 22, 2008 at 7:46 PM, lawful falafel <lawfulfalafel at gmail.com>wrote:

> I really like python, but the one thing I really hate is that most of the
> tutorials treat it like interactive scripting instead of object oriented
> development, which really confuses me. So basically right now I dont even
> know what equivelent version of main() I would write. I also dont understand
> how I could write an accessing method so that I could write Map(1,2), since
> the only place that deals with arguments is the __init__ function I think,
> and that doesnt seem to deal with arguments. Any help or links to sites
> about python and OO stuff would really be appreciated.
>

well, if it helps you feel familiar, you could write:

def main():
    # call some functions here

But in reality, anything that's not defined in a function will be executed
at runtime.

I don't have much experience with classes, so I'm sure someone else would be
of more help there.

but I hope I've helped a bit.
-Wayne

-- 
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: every weakness,
every vice, has found its defenders, its rhetoric, its ennoblement and
exaltation, but stupidity hasn't. - Primo Levi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080822/f733fe42/attachment.htm>


More information about the Tutor mailing list