From Toxic Hamster, 5 Months ago, written in Python.
This paste is a reply to san from Olga - view diff
Embed
  1. sandwich_test = {
  2.     "bread_top" : "/''''''''''\\",
  3.     "cheese" : "[[[cheese]]]",
  4.     "cotlet_top" : "==cotlet==",
  5.     "tomato" : "_tomato_",
  6.     "ham" : "--ham--",
  7.     "salad" : "~~~salad~~~",
  8.     "cotlet_bottom" : "==cotlet==",
  9.     "cheese_bottom" : "[[[cheese]]]",
  10.     "bread_bottom" : "\__________/"
  11.     }
  12.  
  13. def  read_output():
  14.     sandwich_test_mass = []
  15.     my_sandwich = open('sandwich.txt')
  16.     sandwich_keys = ["bread_top", "cheese", "cotlet_top", "tomato", "ham", "salad", "cotlet_bottom", "cheese_bottom", "bread_bottom"]
  17.    
  18.     # print sandwich_keys
  19.     for line in my_sandwich.readlines():
  20.         line = line.strip()
  21.         sandwich_test_mass.append(line)
  22.         # print "line: ",line
  23.     for n in sandwich_keys:
  24.         print "line: ", line
  25.         print "n: ",n
  26.         if sandwich_test[n] == line:
  27.             print "this is :", n
  28.            
  29. read_output()