def main(): setBoard(0) try: ttyLinux.setSpecial() playGame() finally: ttyLinux.setNormal()
def test() : ttyLinux.setSpecial() for i in range(10) : time.sleep(1) keys = ttyLinux.readLookAhead() print "Got", [keys] ttyLinux.setNormal()
def test(): try: ttyLinux.setSpecial() loop() finally: ttyLinux.setNormal()
"""Cobra_StarFish, Radio Automation System Created by Jesse Jurman for WIRQ Uses Pygame, Termios, Random, and Time modules Uses python2.7 (should work with 3.2 if modules are loaded)""" import pygame #pygame module for music pygame.mixer.init() #initalize pygame module for music import random import time #time module for pauses and whatnot import os import ttyLinux #code borrowed for live input ttyLinux.setSpecial() from StarFish_Settings import * #variables for defined settings def mainProgram(): """Main script which contains various methods and the automation loop""" #code to populate what songs are available #### DO NOT MODIFY ###### rotFolders = os.listdir(rotDirectory) #the various folders in the rotation Directory rotAlbums = [] #for loop to append file names of folder "i" into rotAlbums for i in range(0, len(rotFolders)): rotAlbums.append(os.listdir(rotDirectory+"/"+str(rotFolders[i]))) song_count = -1 #so that first cue is actually for the song to be played first