Advertisement
Guest User

Untitled

a guest
Dec 10th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import time
  4. import thread
  5.  
  6. LISTA = '/home/test.txt'
  7.  
  8.  
  9. def abcd1():
  10. global LISTA
  11. while true:
  12. with open(LISTA,'a') as file:
  13. file.write('<1>')
  14. if '<2>' in LISTA:
  15. file.close
  16.  
  17. def abcd2():
  18. global LISTA
  19. while true:
  20. with open(LISTA,'a') as file:
  21. file.write('<2>')
  22. if '<1>' in LISTA:
  23. file.close
  24.  
  25.  
  26. thread.start_new(abcd1, ())
  27. thread.start_new(abcd2, ())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement