Multiprocessing Thread Not Starting

I’m trying to create a toggleable process (starts or ends when I press “r”). I know the process gets started, but I never receive any output from the process’s print statement. I’m new to multiprocessing but in my mind, the code should:

  1. wait for r to be pressed (stop program if p is pressed).
  2. if the process already exists, terminate and set to None (so I can call it repeatedly).
  3. if process does not exist, create process that will run record(), set to daemon so if I quit the program, the process also ends, and start process.
    Any help or clarity on the problem would be greatly appreciated!

Code:

from pynput import keyboard as k
import mulitprocessing as mp
import os

def record():
    print("started record process")
    # will do things here

def on_release(key):
    global record_process
    if key == k.KeyCode.from_char("p"):
        print("quitting")
        os._exit(0)
    if key == k.KeyCode.from_char("r"):
        if record_process == None:
            record_process = mp.Process(target=record, args=())
            record_process.daemon = True
            record_process.start()
            # insanity check, make sure process gets started
            print(record_process.is_alive())
        else:
            record_process.terminate()
            print("terminated process")
            record_process = None

record_process = None
key_list = k.Listener(on_release=on_release)
key_list.start()

while(True):
    pass

a) You have a typo in multiprocessing.
b) You code works for me on Linux.

OK  /tmp $ python p.py 
rTrue
started record process
pquitting

Note that the keyboard listener works in the parent process.

rMain process 24897
True
started record process 24903
pquitting 24897