<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def frames(skip=1):
    '''Useful command to iterate on the trajectory frames. It can be
    used in a for loop.

    ::
    
        for i in frames():
            coords = current_trajectory()[i]
            # Do operation on coords

    You can use the option *skip* to take every i :sup:`th` frame.
    
    '''
    from PyQt4 import QtGui
    
    for i in range(0, viewer.traj_controls.max_index, skip):
        viewer.traj_controls.goto_frame(i)
        yield i
        QtGui.qApp.processEvents()