in fact this should not be a problem because it\'s fairly basic. I just want to print out an array of categories, but in one line and separated by comma.
for ent
Check categories isn't empty - that'd make it print nothing - also I'd consider changing your code to make use of the sep argument instead (depending how large categories is):
print(*categories, sep=', ')
eg:
>>> categories = range(10)
>>> print(*categories, sep=', ')
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Then you don't have to worry about flushing/trailing separators etc...