Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def parse(fdl):
- files = open(fdl)
- command = {}
- rule = []
- for line in files:
- line = line.strip()
- splitted = line.split()
- if splitted == 'start':
- start = splitted[1:]
- elif splitted[0] == 'rule':
- rule.append((splitted[1],splitted[3:]))
- elif splitted[0] =='cmd':
- cmd = (splitted[2],splitted[3:])
- command[splitted[1]] = cmd
- elif splitted[0] == 'length':
- length = int(splitted[1])
- elif splitted[0] == 'depth':
- depth = int(splitted[1])
- return start,rule,commands,length,depth
- parse(fern)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement