Idiomatic Python: ‘times’ loop [duplicate]
You’ve already shown the idiomatic way: for _ in range(n): # or xrange if you are on 2.X foo() Not sure what is “hackish” about this. If you have a more specific use case in mind, please provide more details, and there might be something better suited to what you are doing.