Connect all the particles with each other with splines

Hi all, i had the idea to create a particle system and then try to connect each particle at a specific time frame with all the rest particles. So, everything will be connected with simple lines.

Maybe this can be animated too.

I was thinking to use the start of this script by Anubis

but i'm stuck.

The total number of lines for i particles would be i think i+ i(i-3)/2
This is the number of polygon sides + polygon diagonals.

According to it,
1 particle 0 lines
2 particles 1 line
3 particles 3 lines
4 particles 6 lines etc.

So any help !?
Thank you very much !