The title pretty much says it, although it does not need to be specific to a cmd, just closing an application in general. I have seen
os.system(taskkill bla
something like this?
import sys sys.exit()
or easier ...
raise SystemExit
if that's not what your looking for tell me
also you can just save the file with a .pyw and that doesn't open the cmd at all