cwisbg

Lunch Picker v_0.4

Feb 3rd, 2012
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.88 KB | None | 0 0
  1. """___________________
  2.    Lunch Picker
  3.    Version_0.4
  4.    
  5.    cwisbg
  6.    Brandon Gillespie
  7.    1/30/2012
  8. ______________________      
  9. """
  10. from datetime import datetime
  11. import random as r
  12.  
  13. times = str(datetime.now()) # Get system time/date
  14.  
  15. weekDays = ['Monday','Tuesday','Wednesday','Thursday','Friday']
  16. title = "You will have"
  17. dataPath = "E:/"
  18. # Get lunch ideas
  19. openlunchIdeas = open("{0}lunchIdeas.txt".format(dataPath), "r")
  20. lunchIdeas = openlunchIdeas.readlines()
  21. # Make used choices file
  22. openlunchData = open("{0}lunchData.txt".format(dataPath), "a+")
  23. lunchData = openlunchData.readlines()
  24. # Make Lunch Menu
  25. openMenu = open("{0}lunchMenu.txt".format(dataPath), "w")
  26. menu = []#openMenu.readlines()
  27.  
  28.  
  29. x = 0 # Lunch data inc
  30. z = 0 # Lunch Ideas inc
  31.  
  32. if len(lunchData) == 0:
  33.     pass
  34. else:
  35.     for i in lunchData: # sort thouth items in list
  36.         if x == len(lunchData): #to reset the cycle of x so we dont go over lunchData indexs
  37.             x = 0
  38.         for l in lunchIdeas: # check for matches
  39.             if l == lunchData[z]:
  40.                 currentLunchList.remove(i)
  41.         z += 1
  42.         x += 1
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. """
  58. currentLunchList = readLunchIdeas
  59.  
  60.  
  61. if len(lunchData) == 0:
  62.     for i in range(0,len(weekDays):
  63.         rando = r.randint(len(readLunchIdeas))
  64.         menu.append(readLunchIdeas[rando])
  65. else:
  66.     for i in range(0,len(weekDays):
  67.         rando = r.randint(len(currentLunchList))
  68.         menu.append(readLunchIdeas[rando])
  69.    
  70. #print menu
  71.  
  72. openlunchData.write(i)
  73. openMenu.write(i)
  74. """
  75. openlunchIdeas.close()
  76. openlunchData .close()
  77. openMenu.close()
  78.  
  79.  
  80.  
  81. """
  82. Lunch List:
  83. pbj sandwich
  84. special sandwich
  85. soup
  86. noodles
  87. hot dogs
  88. pizza
  89. Cheese Stake sandwich
  90. chicken wrap
  91. tacos
  92. taco soup
  93. salad
  94. buritto
  95. fried rice
  96. chinese
  97. meat ball sandwich
  98. roast beef roll
  99. roast beef sandwich
  100. rando from safeway
  101. rando from whole foods
  102. rando from kings
  103. gas station surprise!
  104. ham and cheese sandwich
  105.  
  106.  
  107. """
Advertisement
Add Comment
Please, Sign In to add comment