import re
regex = r"\s\.(?=[a-zA-Z])"
result = re.sub(regex, ". ", "My friend is hungry .I am happy")
if result:
print (result)
aW1wb3J0IHJlCgpyZWdleCA9IHIiXHNcLig/PVthLXpBLVpdKSIKcmVzdWx0ID0gcmUuc3ViKHJlZ2V4LCAiLiAiLCAiTXkgZnJpZW5kIGlzIGh1bmdyeSAuSSBhbSBoYXBweSIpCgppZiByZXN1bHQ6CiAgICBwcmludCAocmVzdWx0KQ==