There are
approved interlock kits available which are code compliant however using a mechanical interlock has 2 main disadvantages:
(1) The kit must be approved for the specific panel manufacture
(2) Shutting off the main breaker is not always a good idea in the advent of an emergency as it may fail upon reset - (reenergization), if not properly exercised under regular maintenance periods.
There is also a possibility that the handle on the main breaker could break, as I was called out 2 times during the last power outage for that exact reason - customer were backfeeding panels through dryer outlet using double male cord caps on a cord leading to the generator. Not too smart as BC Hydro was busy for days so permission was required to remove the meter outside so as to replace the main breakers. The costs to repair were a
lot more (materials, permit, BC hydro reseal charges and labour) than if they had used emergency panels or manual transfer switches as RP indicated above.
There are also
kits available c/w a generator inlet that can be mounted on an outside wall providing receptacles on the inside wall if you just want to run cords to several loads and not get into refeeding particular circuits in your existing electrical panel, but cost a bit more and then of course you have to run temporary extension cords inside which can be a trip hazard.
We are talking 1800 watts (one 120 volt 15 amp circuit) so even a cord run into the house with a triple female end on it would be fine as a temporary measure.