#!/usr/bin/env python3 import concurrent.futures import logging def do_work(): logging.getLogger().info("From worker thread") if __name__ == "__main__": logging.basicConfig(level=logging.INFO, format="%(threadName)s %(message)s") logging.getLogger().info("From main thread") with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor: executor.submit(do_work)