John Howard Davies in the ‘Please, sir – I want some more’ scene from Oliver Twist (1948). Photograph: Rex

'Please, sir – I want some more." Rationing was still in force when, under the eye of David Lean's camera, a thin, pale eight-year-old boy named John Howard Davies raised his gruel bowl and dared to request a second serving. That image of Davies in Oliver Twist (1948) spoke to the mood of the moment – suggesting the sort of deprivation that postwar Britain was attempting to legislate out of existence. One scene called for Davies, who has died of cancer aged 72, and his fellow child actors to look on enviously as the bigwigs of the workhouse devoured a great pile of pastries, hams and chicken. The astonished expressions are genuine. None of these boys had ever seen food like it.

Davies in 1986. He thought himself insufficiently gifted to be a character actor

The film's production company, Cineguild, had launched a national campaign to secure a talented unknown for the title role. (Cinemagoers were invited to submit the names of boys of their acquaintance who possessed "a natural flair for acting".) In the event, the producer, Ronald Neame, found the successful candidate closer to home. Davies was the son of a childhood friend. Neame and Lean did not burden their young star with much dialogue, preferring to capture the haunted eloquence of his features. Sometimes Lean would let the camera roll and whisper a mournful story to produce the tears or anxious looks that he required.

JHD – as his friends knew him – would confess in later years that he thought himself insufficiently gifted to be a character actor, and insufficiently good-looking to be a star. Briefly, however, this is exactly what he was. He gave his best performance as the tormented hero of The Rocking Horse Winner (1949), punched above his weight in Tom Brown's Schooldays (1951), and made a cameo appearance alongside Robert Donat in The Magic Box (1951) – but by the time the Festival of Britain had marked the nation's emergence from postwar austerity, his acting career was over and he was sitting in a classroom at Haileybury school, Hertford. More than a decade later, however, Davies would receive a spectacular second helping – in the form of a new career as a producer, director and commissioner of epoch-making television comedy.

Davies was born in Paddington, west London, the son of Jack Davies, a film critic and prolific screenwriter at Gainsborough and Elstree studios, and the novelist Dorothy Davies. After national service in the Royal Navy, he pursued a variety of short-lived careers from clerk to salesman. He even made a brief return to acting, in the ITC series The Adventures of William Tell (1958) and in an Australian production of The Sound of Music, on which he met his first wife, Leonie.

In 1966 he joined the BBC as a production assistant and was promoted to the producer's chair two years later. His credit appeared on episodes of the ecclesiastical sitcom All Gas and Gaiters, the legal satire Misleading Cases, Spike Milligan's The World of Beachcomber and As Good Cooks Go, an ill-fated vehicle for the comedian Tessie O'Shea.

But it was his trust in a coalition of young performers and their idea for a stream-of-consciousness sketch show with the provisional title of Bun, Whackett, Buzzard, Stubble and Boot that inaugurated his golden period and allowed Monty Python's Flying Circus (1969-74) to take wing over the BBC2 schedules. He produced and directed the first four episodes and defended the programme from its detractors within the BBC – though not all of its stars took to him. Graham Chapman recalled Davies as "not a very human person … if you made a mistake of any kind, any sort of pause in speech, he would treat you rather as if he was a schoolmaster".

This instinct for discipline, however, gave Davies common ground with John Cleese, who, once he had left Python, sent his former producer a script he had co-written with his wife, Connie Booth. Davies read the first draft of Fawlty Towers (1975, 1979) in bed, and laughed so much that he fell out.

His creative influence over the series was considerable. He chose the hotel used in the exterior shots (for its smell of rancid beer and convenient location halfway between TV Centre and his home). He cast Prunella Scales as Sybil Fawlty (and claimed that her character was an amalgam of his first two wives). It was his idea that the letters on the hotel's sign should be in a permanent state of flux – sometimes reading "flowery twats", sometimes "farty towels". His natural taste was for the comedy of violence and schadenfreude, and he took pride in having devised the moment in which Cleese gives Andrew Sachs's Manuel a sharp blow to the forehead with a dessert spoon.

Less cruel humour also thrived under his guidance. Davies produced the entire run of The Good Life (1975-78), the 1972 series of Steptoe and Son, Frankie Howerd's Whoops Baghdad (1973) and the first two series of The Goodies (1970-72), a role that obliged him to balance the cost of elaborate visual effects against the size of the laugh they were likely to yield. In 1972 an episode emerged from the typewriter of Graeme Garden and Bill Oddie that asked for a giant kitten to demolish the Post Office Tower before being sedated by the principals, dressed as mice, riding a three-wheeled cycle borne aloft by hot air balloons. Davies said yes. Kitten Kong won the Silver Rose of Montreux.

Promoted to BBC head of comedy in 1978, and then head of light entertainment in 1982, Davies was involved in the production or commissioning of The Fall and Rise of Reginald Perrin (1976-79), Yes, Minister (1980-84), Only Fools and Horses (1981-96) and Not the Nine O'Clock News (1979-82). There were also forays into commercial television. In 1973 he was briefly managing director of EMI Productions, and in 1985 moved to Thames where he launched Mr Bean (1990-95), oversaw the television transfer of Simon Brett's genteel radio sitcom After Henry (1988-92), and became a hate figure for Benny Hill fans when he was credited with terminating the comedian's television career. His direction of the 1996 Easter special of The Vicar of Dibley proved to be his lap of honour for the BBC.

In later years, as sitcoms waned, he was often asked for the secret of how to formulate a successful series. "All the best sitcom characters," he said, "are relentlessly horrible."

He is survived by his third wife, Linda, two children and two stepchildren.

• John Howard Davies, actor, director, producer and television executive, born 9 March 1939; died 22 August 2011