Skip to content

Instantly share code, notes, and snippets.

Created Feb 14, 2020
What would you like to do?
# -*- coding: utf-8 -*-
import os
import sys
from prompt_toolkit import prompt
pid = os.getpid()
print("old: ", pid)
forked_pid = os.fork()
print("forked pid: ", forked_pid)
if forked_pid == pid:
print("Im exiting...")
pid = os.getpid()
print("my pid: ", pid)
def run_console():
print("You said: %s" % prompt(">>>: "))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment