Python Forum
List showing running total of instances
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List showing running total of instances
#11
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
>>>
Reply
#12
Winner? For sure. I am not a programmer. I code for fun  Tongue
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python List with Total and Average mcnhscc39 3 3,040 Nov-28-2018, 09:02 AM
Last Post: DeaD_EyE
  TypeError: '<=' not supported between instances of 'list' and 'int' Leonzxd 4 62,655 May-18-2018, 09:49 AM
Last Post: Leonzxd
  applying total in a loop to a list JustinxFFx 1 2,136 Feb-11-2018, 03:14 AM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020