Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #!/usr/local/bin/python
  2. import cgi, cgitb
  3. import time
  4. import threading
  5.  
  6. class TestThread(threading.Thread):
  7. def __init__(self):
  8. super(TestThread, self).__init__()
  9.  
  10. def run(self):
  11. time.sleep(5)
  12. fileHand = open('../Documents/writable/output.txt', 'w')
  13. fileHand.write('Big String Goes Here.')
  14. fileHand.close()
  15.  
  16. print 'Starting Program'
  17.  
  18. thread1 = TestThread()
  19. #thread1.daemon = True
  20. thread1.start()
  21.  
  22. #!/usr/local/bin/python
  23. import time
  24. from multiprocessing import Process, Pipe
  25.  
  26. def f():
  27. time.sleep(5)
  28. fileHand = open('../Documents/writable/output.txt', 'w')
  29. fileHand.write('Big String Goes Here.')
  30. fileHand.close()
  31.  
  32. if __name__ == '__main__':
  33. print 'Starting Program'
  34. p = Process(target=f)
  35. p.start()
  36.  
  37. //PHP
  38. exec("php child_script.php > /dev/null &");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement