Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Modules

📅 2009-Oct-06 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ modules, python ⬩ 📚 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()

© 2023 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 Mastodon📧 Email