Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def replace_vars(fname):
- try:
- f = open(fname,'r')
- new_lines = []
- for line in f:
- line_word = []
- word = line.split()
- for w in word:
- w = w.strip()
- if w.startswith('?'):
- w = w[1:]
- w = w.replace('_', ' ')
- w = raw_input("Give me a " + w + ":")
- line_word.append(w)
- new_lines.append(line_word)
- for line in new_lines:
- for word in line:
- print word + " ",
- except IOError:
- print "I could not find a file name" + fname
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement