rewite lnmp shell with python