[Tutor] simple arg problem

Keith Winston keithwins at gmail.com
Sat Jan 4 03:56:25 CET 2014


gmail is driving me crazy. Anyway, every time I run it with:

if __name__ == "__main__":
    tarray = CandL_Array
    tarray.populate(100)

I get an error

Traceback (most recent call last):
  File "/home/keithwins/Dropbox/Python/CandL8.py", line 127, in <module>
    tarray.populate(100)
TypeError: populate() missing 1 required positional argument: 'gamecount1'
>>>

Which seems to say it wants another argument, but I am in the habit of not
counting the self argument... I thought I understood that. I'm sure it's
something obvious, but I've been staring at it for hours. This is going to
be embarrassing...



On Fri, Jan 3, 2014 at 9:53 PM, Keith Winston <keithwins at gmail.com> wrote:

> I'm trying to rewrite/reshuffle my Chutes & Ladders code, which I
> generally find more confusing than writing anew.
>
> Anyway, I've got a method that seems like it calls for one argument but...
>
>     def populate(self, gamecount1):
>         """populate candl_array with a set of games"""
>
> (method of a new class CandL_Array, which contains a list called
> candl_array)
>
> Every time I run it with
>
>
> --
> Keith
>



-- 
Keith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140103/bc430ce9/attachment.html>


More information about the Tutor mailing list