import subprocess import os from threading import Thread def run_node_server(): subprocess.run(["node", "server.js"]) if __name__ == "__main__": # Start the Node.js server in a separate thread node_thread = Thread(target=run_node_server) node_thread.start() # Keep the main thread alive node_thread.join()