Python Forum
List showing running total of instances - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: List showing running total of instances (/thread-1635.html)

Pages: 1 2


RE: List showing running total of instances - Mekire - Jan-20-2017

Quote:Funny, I'm not getting that error (I'm running from a python tab in maya dont know if that would be any reason)
No clue about Maya, but there is definitely an error in your program.

You can either import like this from collections import Counter and call like this Counter()
Or import like this import collections and call like this collections.Counter().

Even if Maya is for godknowswhatreason allowing this, it is something you should definitely be aware of.

You should most definitely be getting an error like this:  
>>> from collections import Counter
>>> collections.Counter
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'collections' is not defined
>>>



RE: List showing running total of instances - wavic - Jan-20-2017

Winner? For sure. I am not a programmer. I code for fun  Tongue