Reuse Code in Multiple Projects with Python Modules

Share this video with your friends

Send Tweet

A module is a function extracted to a file. This allows you to import the function and use it in any other code you may write. You’ll learn how to create modules, import them, and make them stand-alone as you learn what if __name__ == “__main__” means in Python.

Victor Hazbun
Victor Hazbun
~ 7 years ago

This can be compared to Ruby modules? They look similar btw.

Will Button
Will Button(instructor)
~ 7 years ago

Ruby? There's a name I haven't heard in a long time.... said in Obi Wan Kenobi voice Honestly, I'm not sure- I'd have to refresh my ruby skills to answer that confidently.