Iain Macwhirter on Glenrothes

Could we have a new prime minister by Christmas? Possibly, if the Glenrothes by- election goes wrong for Labour. Another sensational defeat, following Crewe and Nantwich and Glasgow East, really could end Gordon Brown's career. The fate of the PM, and perhaps the entire government, rests on the shoulders of the voters of this Fife constituency which must deliver its verdict some time in the next three months.

So what can Labour do to win this supposedly safe seat, which the bookies have already awarded to the SNP? So far the debate has centred on timing. Should Gordon Brown delay the vote - deploying the so-called Travolta-Micawber strategy of staying alive in the hope something turns up? Or is an SNP victory so certain that Brown should go for another snap by-election to get the unpleasantness out of the way? New Labour commentators, such as the Guardian's Martin Kettle, seem to favour the latter course.

My own view, for what it's worth, is that Brown would be mad to go for an early by-election, since the likely defeat would simply provide a springboard for the foreign secretary, David Miliband, to launch a leadership challenge at the Labour conference in Manchester in late September. Delaying allows Brown to call for a show of unity in Manchester in the interests of winning Glenrothes for Labour. Delay, delay and fight another day. If necessary, Brown could put off his date with destiny until late November, by which time there may be a world war to distract attention from his difficulties.

But timing isn't everything - there is the small matter of the campaign itself. Labour cannot afford to repeat the shambles of Glasgow East, where they launched their campaign without a candidate and failed dismally to counter the Alex Salmond effect.

So, what can Labour do to improve their chances in Glenrothes? Unfortunately, they can't get rid of Gordon Brown, who is probably their main electoral liability there. This was made patently clear as early as February 2006, when the Liberal Democrat Willie Rennie snatched nearby Dunfermline and West Fife at a by-election, overturning a similar Labour majority of around 12,000. Even when he was chancellor, and supposedly at the height of his powers, Gordon Brown was a vote-loser. Now, after Glasgow East, where Labour lost the third-safest seat in Scotland on a 22% swing to the SNP, he is the electoral equivalent of toxic waste.

But they can't just dump Gordon, so Labour will have to do the opposite - force him into the front line in the hope he can reawaken some of the respect he once had in Fife. He was brought up in the Kingdom, after all, and sits for the neighbouring constituency of Kirkcaldy and Cowdenbeath. Brown is part of the political landscape of Fife, and if he has to make a last stand in defence of his leadership, then Fife is arguably the best place for it. His late father was a highly respected church minister and there must be a lot of residual affection for the prime minister and his family, especially given his son's health problems. Sarah Brown is a highly respected figure because of her charity work and for her reluctance to hog the limelight in the manner of the previous First Lady of Downing Street. Brown had a good relationship with John MacDougall, the late MP for Glenrothes, an ex-boilermaker, and goes back a long way with the unions there, so he has deep roots to draw on.

But the SNP have roots here too. Glenrothes is a very much easier target for the SNP than Glasgow East. In west central Scotland, nationalism is an alien creed; in Fife it is an accepted part of the political landscape, and the press are much more favourably disposed to nationalism than in Glasgow. The SNP hold the equivalent Holyrood seat for Glenrothes, which makes it doubly difficult to see Labour avoiding another defeat. The Nationalists also lead the coalition on Fife Council and have a strong organisation on the ground.

To demolish that Nationalist presence, Brown would have to tour every corner of the constituency, matching Alex Salmond mile for mile. He would have to convince a sceptical constituency that as prime minister he would personally ensure it doesn't just become another moribund Labour backwater. He would also have to defeat Alex Salmond soundly in intellectual debate, something he was certainly capable of in the past.

And like Salmond in Glasgow, Brown would have to elbow aside the Labour candidate. This is likely to be either Alex Rowley, the Labour group leader on Fife Council or Christine May, the former MSP for Fife Central. I cannot see Brown honouring the former first minister, Henry McLeish, as candidate for Glenrothes - there is not a lot of mutual respect there. Anyway it would be madness so soon after the resignation of Wendy Alexander, over campaign finances. McLeish, remember, resigned as first minister, and local MSP, after a funding scandal in 2001 and while many thought Henry's subletting of his constituency offices wasn't a resignation matter, the fact is that he did resign. The SNP would say he wasn't fit for Holyrood, but Labour thinks he is fit for Glenrothes.

Brown could, of course, try to steal the by-election by political bribery. He has already signalled that there will be some measures - such as a stamp duty holiday, or the scrapping of road tax increases - to sweeten the chancellor's pre-budget report in October. But these are unlikely to do much for him in Glenrothes, and may even create a negative reaction. It didn't go down too well in Crewe and Nantwich when Brown cobbled together that £2.7 billion "rescue" for those hit by the abolition of the 10p tax band. With inflation likely to be at 5% by polling day, and the slide in house prices barely started in Scotland, Brown would have to think very carefully before introducing a by-election fix.

One other possibility might be to announce changes to the party in Scotland to make it more Scottish. Adopt some of the rhetoric being used by Andy Kerr in the Scottish leadership race and promise that the new Scottish leader - whoever wins - is going to have more power to deliver those "Scottish solutions to Scottish problems". He could talk up the Calman Commission which Wendy Alexander established to explore more powers for Holyrood. Do not, however, expect Brown to call for a referendum on independence. Alex Salmond will do that, quoting Wendy Alexander.

No, it isn't looking good for Labour. The SNP will have to mount a dreadful campaign to lose in Glenrothes. I'm afraid this could be Gordon's big red one.