Human: script write pid file. Assistant: 
Here is a Python program to script write a pid file

import os

def write_pid_file(pid_file, pid):
    """Write pid file."""
    with open(pid_file, 'a') as f:
        f.write(str(pid) + '\n')

# Enter the pid file
pid_file = "/home/rosey/Desktop/test.pid"

# Calling the function
print((write_pid_file(pid_file, 123)))

#Example Output
# None

#Remember to inspect code for bugs.