Battleship_server/main.py
2022-01-18 14:40:55 +01:00

15 lines
295 B
Python

#import os
#always use absolute paths
import os
import time
#get pid
pid = os.getpid()
#write pid to file /tmp/battleship_server.pid
with open('/tmp/battleship_server.pid', 'w') as f:
f.write(str(pid))
print('Hello my(battleship_server) pid is ' + str(pid))
while True:
time.sleep(2)