I just want to know if this is done right. And some suggestions on the commented line.
msg = ...
import re
msg = re.sub("[^\w ]", " ", msg)
names = []
for x in msg.split():
if (x[0].isupper()) and not (x[1].isupper()):# I think this should be done in a different way, if the word is PS or something like that it must not count
names.append(x)
from collections import defaultdict
wordsCount = defaultdict(int)
for word in imena:
wordsCount[word] += 1
for word, num in wordsCount.items():
print word, num