Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Modules

📅 2009-Oct-06 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

module.py

def foobar():
    print("Function inside module.")
 
# main0.py
import module
module.foobar()

# main1.py
from module import foobar
foobar()

# main2.py
from module import *
foobar()