I assume you want, of course, your N executions of T to be correctly distributed along your 500 rounds, and each execution to be different.
If you're fine with an approximation of N, an on-place solution would be to have a probability of N/500 to run your task each round.
import random
roundNb = 500
N = 10
for i in range(roundNb):
if random.random() < N / roundNb:
T()
If it's important for you to have this task performed exactly N times, then it's better to generate N different random numbers < 500 and use them to determinate whether or not your task should be performed this round.
import random
roundNb = 500
N = 10
# random.sample takes N elements of range(roundNb), so N valid roundNumbers
# Convert it to a set so `i in doTaskOn` runs in constant time
doTaskOn = set(random.sample(range(roundNb), N))
for i in range(roundNb):
if i in doTaskOn:
T()