Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. my_dict={'key1':('a','b','c','d'), 'key2':('e','f','c','h'}
  2. global_syntax=""
  3. for key, val in my_dict.iteritems():
  4. if val[2][0]='c':
  5. mysyntax(key)
  6.  
  7. def write_to_file (syntax_to_write):
  8. global global_syntax
  9. global_syntax=global_syntax+str(syntax_to_write)
  10.  
  11. def mysyntax(key):
  12. my_variable=key
  13. my_syntax="""
  14. do all stuff + {key} + {val}
  15. """.format(
  16. key=key,
  17. val=val[2][0])
  18. write_to_file(mysyntax.encode('utf8'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement