Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my_dict={'key1':('a','b','c','d'), 'key2':('e','f','c','h'}
- global_syntax=""
- for key, val in my_dict.iteritems():
- if val[2][0]='c':
- mysyntax(key)
- def write_to_file (syntax_to_write):
- global global_syntax
- global_syntax=global_syntax+str(syntax_to_write)
- def mysyntax(key):
- my_variable=key
- my_syntax="""
- do all stuff + {key} + {val}
- """.format(
- key=key,
- val=val[2][0])
- write_to_file(mysyntax.encode('utf8'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement