def add_random_file_from_present_folder(machine_ip, port, zone):
    """Add a random non-py file from this folder and subfolders to soco"""
    # Make a list of music files, right now it is done by collection all files
    # below the current folder whose extension does not start with .py
    # This will probably need to be modded for other pusposes.
    music_files = []
    print('Looking for music files')
    for path, dirs, files in os.walk('.'):
        for file_ in files:
            if not os.path.splitext(file_)[1].startswith('.py'):
                music_files.append(os.path.relpath(os.path.join(path, file_)))
                print('Found:', music_files[-1])

    random_file = choice(music_files)
    # urlencode all the path parts (but not the /'s)
    random_file = os.path.join(
        *[quote(part) for part in os.path.split(random_file)]
    )
    print('\nPlaying random file:', random_file)
    netpath = 'http://{}:{}/{}'.format(machine_ip, port, random_file)

    number_in_queue = zone.add_uri_to_queue(netpath)
    # play_from_queue indexes are 0-based
    zone.play_from_queue(number_in_queue - 1)
Add a random non-py file from this folder and subfolders to soco