create a command prompt batch file code example
Example 1: batch write file
REM
REM
echo This is the text you want in the actual file > NewFile.txt
REM
REM
Example 2: how to run bat file without effect main code
import subprocess
from subprocess import Popen
import time
from multiprocessing import Process,freeze_support
def run_batfile(name='world'):
subprocess.call(["launch_pg.bat"])
if __name__ == '__main__':
p = Process(target=run_batfile)
p.start()
count = 0
while True:
count+=1
print(count)
time.sleep(1)