add while True
This commit is contained in:
5
main.py
5
main.py
@@ -1,6 +1,7 @@
|
|||||||
#import os
|
#import os
|
||||||
#always use absolute paths
|
#always use absolute paths
|
||||||
import os
|
import os
|
||||||
|
import time
|
||||||
|
|
||||||
#get pid
|
#get pid
|
||||||
pid = os.getpid()
|
pid = os.getpid()
|
||||||
@@ -8,4 +9,6 @@ pid = os.getpid()
|
|||||||
#write pid to file /tmp/battleship_server.pid
|
#write pid to file /tmp/battleship_server.pid
|
||||||
with open('/tmp/battleship_server.pid', 'w') as f:
|
with open('/tmp/battleship_server.pid', 'w') as f:
|
||||||
f.write(str(pid))
|
f.write(str(pid))
|
||||||
print('Hello my(battleship_server) pid is ' + str(pid))
|
print('Hello my(battleship_server) pid is ' + str(pid))
|
||||||
|
while True:
|
||||||
|
time.sleep(1)
|
Reference in New Issue
Block a user