examples/modules/my_module.py
def a():
    return "in a"

b = "value of b"

def _c():
    return "in _c"

def d():
    return "in d"
examples/modules/x.py
from my_module import a,b,_c

print(a())     # in a
print(b)       # value of b
print(_c())    # in _c

print(d())
# Traceback (most recent call last):
#   File ".../examples/modules/x.py", line 7, in <module>
#     print(d())
# NameError: name 'd' is not defined
examples/modules/y.py
from my_module import *

print(a())     # in a
print(b)       # value of b

print(d())     # in d


print(_c())

# Traceback (most recent call last):
#   File ".../examples/modules/y.py", line 9, in <module>
#     print(_c())    # in _c
# NameError: name '_c' is not defined