No candidate defeated at a primary election shall be permitted to file an affidavit declaring a write-in candidacy, file by petition, or file a nomination, if nominated by party convention or committee, for the following general election for the same office except as provided in section , , or .