Basil, lavender, mint, eucalyptus, and even geranium (and more particularly lemon geranium) give off strong odors that most of us appreciate but that flies hate above all else.
The trick is simple: just place the pots on the windowsill so that the flies don’t enter. In addition to repelling flies, your windows will be decorated with pretty plants!
You can also burn green tobacco leaves, on a stove or barbecue, in the places they like most.
Eucalyptus, in addition to being used as an essential oil, is also effective as an infusion. Simply infuse eucalyptus leaves in boiling water, let cool, then spray around your home or on tea towels near windows.