On 16.01.2013 01:23, Scurvy Scott wrote:
> After playing with your example I keep being told that list has no
> attribute int_to_note. I know what the problem is, I just don't know
> how to fix it.
[SNIP]
> So right now my code is:
>
> import mingus.core.notes as notes
                              ^^^^^
On this line you import your module and give it the name "notes".

> def make_notes(num_notes):
>    it = fib()
>    notes = []
        ^^^^^

Inside your function "notes" is a list.

>    for i in range(num_notes):
>            n = next(it) % 12
>            notes.append(notes.int_to_note(n))
                             ^^^^^

Since "notes" is a list inside the function, Python tries to find the method "int_to_note" for a list and fails. But I think you want to use the function which is defined in your module.

You have to either rename your module reference or your list.

Bye, Andreas
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to