Londonderry Crown Court Judge Piers Grant, said that a drunken 57-year-old Marian Dziopak was more interested in sexually gratifying himself than involving either the children or woman in what he was doing.
Dziopak, now of Dereamore Drive, Strathfoyle, pleaded guilty to engaging in a sex act in the presence of a child and indecently exposing himself while standing by the window of his former flat in the Florence Street area.
Judge Grant, sitting in Belfast, said he was prepared to accept this was not the usual flashing case as there was no grooming, coercion or encouragement on Dziopak's part, although what he did was "wholly and utterly unacceptable and something that children should not be exposed to in anyway whatsoever".
The judge added that the offending of a hardworking remorseful Dziopak, with a clear record both here and Poland, was largely bourne out of his drinking and that it was not planned to involve anyone.
Judge Grant, who put the Pole on the 'barring list' preventing him working with children and vulnerable adults for the next five years, said however, they were serious offences needing some clear restraint on Dziopak which could be met by the threat of a jail term hanging over him for the next two years.
At an earlier hearing, prosecution lawyer Russell Connell said that Dziopak had stood naked in the living room of his then home in the Florence Street area of the city in the early evening of August 15 last year.
Initially, a ten-year-old girl walking by with some friends heard a knocking sound on a window and turned to see him, touching himself.
Although she and her friends ran off, when she returned a short time later Dziopak was still standing by the window, with the curtains fully open and the room light on.
Mr Connell said that about five or ten minutes later as an 11-year-old boy was passing the Pole began flashing to him as well. He only desisted when a woman, who also spotted him, began shouting at him.
It was she who contacted police, although it was not until the following month that Dziopak was interviewed until a qualified interpreter could be founds, given his limited understanding and ability to speak English.
During his interviews he told police that he had been drinking at the time and admitted that he had been standing close to the window naked while touching himself.
However, he could not remember anything further, including knocking on the window to attract attention.
His solicitor, Berkeley White, repeated that the Pole had admitted his guilt to police from the outset but that while he accepted his wrong doing he had no recollection of what occurred.
The solicitor said that there was no indication of Dziopak having targeted or groomed the children in any way and that it was a case of the Pole having taken "alcohol and was acting on a whim" and what occurred was more opportunistic rather than planned.
Mr White said that since the incident Dziopak has stopped drinking and that he was "very remorseful about this" and the whole incident "has been a salutary lesson to him."