Python iterating from the middle of a cycle to before the start
<p>I've been working on programming a board game to practice python. I use a cycle to do turn order like this:</p>

<pre><code>turncycle = [0,1,2,3]
for turnindex in cycle(turncycle):
    #.
    #...turn stuff
    #...turnindex is used for active player
    #.
</code></pre>

<p>What I want to do is given a turn index start a mini turn where an event-card triggers and they have to something. Is there a way to rebuild the list so I can change [0,1,2,3] into [1,2,3,0] or cycle starting from 1,2, or 3 and then cycle through the rest once?</p>

<p>What about something like this?</p>

<pre><code>def next_cycle(lst):
    return turncycle[1:] + turncycle[:1]

turncycle = [0, 1, 2, 3]

for turnindex in range(len(turncycle)):
    turncycle = next_cycle(turncycle)
    print turncycle
</code></pre>

python list iteration cycle