functions.py
def run_program(var, playlist, ep_dir):
    """Run the program depending on the player option selected."""
    option_chosen = var.get()

    if option_chosen == 1:
        # Create file path for videos in playlist.
        new_string = ''
        for file in playlist:
            new_string += '%s%s ' % (ep_dir, file)
        new_string = new_string.rstrip()
        new_string = new_string.replace(' ', '\ ')
        new_string = new_string.replace('mp4\\', 'mp4')

        # Run the playlist.
        subprocess.call(['castnow --address 192.168.2.178 %s' % (new_string)],
                        shell=True)

    else:
        # Play the shuffle episode list.
        subprocess.call(['castnow --address 192.168.2.178 '
            '/Users/justinlaureano/Movies/Its\ Always\ Sunny\ '
            'In\ Philadelphia/All --shuffle'], shell=True)
Run the program depending on the player option selected.
Run the program depending on the player option selected.
Run the program depending on the player option selected .
def run_program(var, playlist, ep_dir):
    option_chosen = var.get()
    if option_chosen == 1:
        new_string = ''
        for file in playlist:
            new_string += '%s%s ' % (ep_dir, file)
        new_string = new_string.rstrip()
        new_string = new_string.replace(' ', '\ ')
        new_string = new_string.replace('mp4\\', 'mp4')
        subprocess.call(['castnow --address 192.168.2.178 %s' % (new_string)],
                        shell=True)
    else:
        subprocess.call(['castnow --address 192.168.2.178 '
            '/Users/justinlaureano/Movies/Its\ Always\ Sunny\ '
            'In\ Philadelphia/All --shuffle'], shell=True)
def run_program ( var , playlist , ep_dir ) : option_chosen = var . get ( ) if option_chosen == 1 : new_string = '' for file in playlist : new_string += '%s%s ' % ( ep_dir , file ) new_string = new_string . rstrip ( ) new_string = new_string . replace ( ' ' , '\ ' ) new_string = new_string . replace ( 'mp4\\' , 'mp4' ) subprocess . call ( [ 'castnow --address 192.168.2.178 %s' % ( new_string ) ] , shell = True ) else : subprocess . call ( [ 'castnow --address 192.168.2.178 ' '/Users/justinlaureano/Movies/Its\ Always\ Sunny\ ' 'In\ Philadelphia/All --shuffle' ] , shell = True )
Run the program depending on the player option selected.
Run the program depending on the player option selected .
"""Run the program depending on the player option selected.""" # Create file path for videos in playlist. # Run the playlist. # Play the shuffle episode list.
var
playlist
ep_dir