Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """___________________
- Lunch Picker
- Version_0.3
- cwisbg
- Brandon Gillespie
- 1/30/2012
- ______________________
- """
- from datetime import datetime
- import random as r
- times = str(datetime.now()) # Get system time/date
- weekDays = ['Monday','Tuesday','Wednesday','Thursday','Friday']
- title = "You will have"
- dataPath = "E:/"
- # Get lunch ideas
- lunchIdeas = open("{0}lunchIdeas.txt".format(dataPath), "r")
- readLunchIdeas = lunchIdeas.readlines()
- # Make used choices file
- openlunchData = open("{0}lunchData.txt".format(dataPath), "a+")
- lunchData = openlunchData.readlines()
- # Make Lunch Menu
- openMenu = open("{0}lunchMenu.txt".format(dataPath), "w+")
- menu = openMenu.readlines()
- currentLunchList = []
- z = 0 # Zero start incramentor
- # load up currentLunch list with lunch ideas
- if len(lunchData) <= 0:
- pass
- else:
- for i in readLunchIdeas:
- if z == len(lunchData):
- pass
- else:
- if i == lunchData[z]:
- z += 1
- else:
- currentLunchList.append(i)
- z += 1
- if len(lunchData) <= 0:
- for i in range(0,len(weekDays)):
- rando = r.randint(0,len(readLunchIdeas))
- menu.append(readLunchIdeas[rando])
- # Ittorate thought the week
- else:
- for i in range(0,len(weekDays)):
- rando = r.randint(0,len(currentLunchList))
- menu.append(currentLunchList[i])
- #print menu
- for i in menu:
- openlunchData.write(i)
- openMenu.write(i)
- lunchIdeas.close()
- openlunchData .close()
- openMenu.close()
Advertisement
Add Comment
Please, Sign In to add comment