add python mode and close buffer without closing the window