Python scrip to launch and close terminal