A Tunisian court on Friday sentenced a presidential candidate Lotfi Mraihi to eight months in prison and banned him from contesting elections for life.