Weeks after being routed in local elections, the left staved off a widely predicted general election triumph by the right. Now comes the really hard part: forming a government.