Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/python
- # -*- coding: utf-8 -*-
- """
- Content of test.txt
- STY: 6
- TÅL: 11
- RÖR: 20
- PER: 9
- PSY: 14
- VIL: 11
- BIL: 7
- SYN: 17
- HÖR: 7
- """
- def get_value_str():
- f = file('test.txt', 'r')
- the_string = f.readlines()
- f.close()
- for word in the_string:
- if "STY" in word:
- the_line = str(word)
- return the_line[5:]
- def get_value_con():
- f = file('test.txt', 'r')
- the_string = f.readlines()
- f.close()
- for word in the_string:
- if word.find('TÅL') != -1:
- # if "TÅL" in word:
- the_line = str(word)
- return the_line[5:]
- #else:
- #return 0
- def main():
- strength = int(get_value_str())
- print strength
- constitution = int(get_value_con())
- print constitution
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement