According to legendary screenwriter Lorenzo Semple Jr., the beginnings of James Bond on film are as exotic, dangerous, wild and woolly as any page-turner created by Ian Fleming.

That first effort to bring 007 to the screen began in 1955, not the 1960s. It starts with a storied producer and an international film- financing scheme. And it nearly turned James Bond into a woman.

The man who first optioned a Bond novel for the movies, fittingly, was a Hollywood character Semple calls “a delicious scoundrel”: actor-director-producer Gregory Ratoff, whose raffish ways and international pedigree took him from Russia to France to Hollywood to Europe to Egypt — where our story begins.

According to Semple (whose cinematic espionage credits include screenplays for such classics as “Three Days of the Condor” and “The Parallax View” as well as the non-Eon Bond picture, “Never Say Never Again”): “The picture that Ratoff was making at the time for Fox, ‘Abdullah’s Harem,’ was financed by wealthy Europeans, mostly Italians and some Egyptians, to get their assets out of Egypt, where the film was shooting. Some of them tried smuggling diamonds but that was the worst scheme because the fellow who sold you the diamonds also turned you in to the folks at customs.

“Anyway, Ratoff was so stressed and in such a state over the dangers of this enterprise that he vowed when he left Egypt with the only money he had, about $10,000, that he would buy the first book he saw well-reviewed in Time magazine when he landed in New York. That book turned out to be ‘Casino Royale’ and he bought the film rights for $6,000.”

In 1954, CBS had paid Ian Fleming $1,000 for one-time broadcast rights for “Casino Royale,” which aired as a live TV drama with Barry Nelson as Bond. Movie rights were available.

It’s hard to imagine after 50 years of Bond pictures, but at the time Semple sat down to write a draft of what would have been the first Bond movie — sadly, no draft appears to have survived — neither Semple nor Ratoff were all that impressed with the dashing and deadly spy.

“Frankly, we thought he was kind of unbelievable and as I recall, even kind of stupid. So Gregory thought the solution was to make Bond a woman, ‘Jane Bond’ if you will, and he even had a plan to cast Susan Hayward in the role.”

Semple chuckles appreciatively at the memory of Ratoff’s off-kilter and certainly off-color logic about how and why Hayward was a sure thing. Imitating Ratoff’s Russian accent, he recounts: “Gregory announced one day, ‘We’ll get Susie Hayward! I fucked her when she was a $75-a-week actress, so she owes me one!’ “

The world was spared “Jane Bond,” but Semple’s next adventure in Bond screenwriting was 25 years later. The story of how writer-producer Kevin McClory bedeviled Eon Productions for decades over his film rights ownership stake in “Thunderball” has been told elsewhere and makes its own colorful and corrosive international tale.

It was McClory’s knotty rights contract and narrative noodling around the edges of “Thunderball” that led the production team headed by industry vet Jack Schwartzman to undertake “Never Say Never Again.”

Largely as a result of all the rights complexities and the conflicting camp’s interpretations of where one story was off-limits and another could begin, Semple’s role as screenwriter was one of the greatest challenges of his career.

“I don’t know how I managed to write a coherent screenplay, but I do know this: The lawyers made an awful lot of money and perhaps they still are.”

Semple certainly earned his pay, as it was his job to sell the reluctant Connery on his take on the reboot. He flew to Marbella, Spain, and Semple recalls, “It didn’t begin well. I had the worst case of laryngitis I think I ever had before or since. And Sean was tough. And his wife was even tougher. She was almost like his agent. But I understood how Sean felt. Bond was very special to him and he was very careful about Bond. In the end, he loved the idea of Bond coming back as an older man and he was in.”

Semple may not have been totally sold on the fictional Bond back in the ’50s, but he is unreserved in his praise for Connery as Bond, calling it “the greatest piece of casting, ever.”

In Semple’s view, “what made Bond work was the fact that Sean Connery wasn’t an upper-class David Niven-type. That would have been deadly. Sean is working class but he has all the required elegance and intelligence. But the foundation is rooted in something people could relate to.”