René's URL Explorer Experiment


Title: Scripts, Modules, Packages, and Libraries (Video) – Real Python

Open Graph Title: Scripts, Modules, Packages, and Libraries – Real Python

Description: Python uses a lot of fancy terminology that you may not be familiar with if you’re new to programming or if you come from a different language. Before Python, my background was primarily in C# and Microsoft’s .NET framework. I remember trying to…

Open Graph Description: Python uses a lot of fancy terminology that you may not be familiar with if you’re new to programming or if you come from a different language. Before Python, my background was primarily in C# and Microsoft’s .NET framework. I remember trying to…

Opengraph URL: https://realpython.com/videos/scripts-modules-packages-and-libraries/

X: @realpython

direct link

Domain: realpython.com


Hey, it has json ld scripts:
  {
    "@context": "https://schema.org",
    "@type": "VideoObject",
    "name": "Scripts, Modules, Packages, and Libraries",
    "description": "Python uses a lot of fancy terminology that you may not be familiar with if you’re new to programming or if you come from a different language. Before Python, my background was primarily in C# and Microsoft’s .NET framework. I remember trying to…",
    "thumbnailUrl": ["https://files.realpython.com/media/What-is-PIP_Watermarked.c46f49dc33f9.jpg"],
    "uploadDate": "2020-05-26T14:00:00+00:00",
    "duration": "PT5M20S",
    "embedUrl": "https://player.vimeo.com/video/420448526",
    "potentialAction": {
      "@type": "SeekToAction",
      "target": "https://realpython.com/videos/scripts-modules-packages-and-libraries/#t={seek_to_second_number}",
      "startOffset-input": "required name=seek_to_second_number"
    }
  }
  

authorReal Python
twitter:cardsummary_large_image
twitter:imagehttps://files.realpython.com/media/What-is-PIP_Watermarked.c46f49dc33f9.jpg
og:imagehttps://files.realpython.com/media/What-is-PIP_Watermarked.c46f49dc33f9.jpg
twitter:creator@realpython
og:typevideo.episode

Links:

https://realpython.com/
Start Herehttps://realpython.com/start-here/
Learn Python https://realpython.com/lessons/scripts-modules-packages-and-libraries
Python Tutorials →In-depth articles and video courseshttps://realpython.com/search?kind=article&kind=course&order=newest
Learning Paths →Guided study plans for accelerated learninghttps://realpython.com/learning-paths/
Quizzes & Exercises →Check your learning progresshttps://realpython.com/quizzes/
Browse Topics →Focus on a specific area or skill levelhttps://realpython.com/tutorials/all/
Community Chat →Learn with other Pythonistashttps://realpython.com/community/
Office Hours →Live Q&A calls with Python expertshttps://realpython.com/office-hours/
Podcast →Hear what’s new in the world of Pythonhttps://realpython.com/podcasts/rpp/
Books →Round out your knowledge and learn offlinehttps://realpython.com/products/books/
Reference →Concise definitions for common Python termshttps://realpython.com/ref/
Code Mentor →BetaPersonalized code assistance & learning toolshttps://realpython.com/mentor/
Unlock All Content →https://realpython.com/account/join/
More https://realpython.com/lessons/scripts-modules-packages-and-libraries
Learner Storieshttps://realpython.com/learner-stories/
Python Newsletterhttps://realpython.com/newsletter/
Python Job Boardhttps://www.pythonjobshq.com
Meet the Teamhttps://realpython.com/team/
Become a Tutorial Writerhttps://realpython.com/write-for-us/
Become a Video Instructorhttps://realpython.com/become-an-instructor/
Searchhttps://realpython.com/search
https://realpython.com/search
Joinhttps://realpython.com/account/join/
Sign‑Inhttps://realpython.com/account/login/?next=%2Fvideos%2Fscripts-modules-packages-and-libraries%2F
https://realpython.com/courses/what-is-pip/#team
A Beginner's Guide to piphttps://realpython.com/courses/what-is-pip/
Austin Cepaliahttps://realpython.com/courses/what-is-pip/#team
Recommended Tutorialhttps://realpython.com/what-is-pip/
Ask a Questionhttps://realpython.com/lessons/scripts-modules-packages-and-libraries#discussion
https://realpython.com/feedback/survey/course/what-is-pip/liked/?from=lesson-title
https://realpython.com/feedback/survey/course/what-is-pip/disliked/?from=lesson-title
Contentshttps://realpython.com/lessons/scripts-modules-packages-and-libraries#description
Transcripthttps://realpython.com/lessons/scripts-modules-packages-and-libraries#transcript
Discussion (5)https://realpython.com/lessons/scripts-modules-packages-and-libraries#discussion
Matplotlibhttps://realpython.com/python-matplotlib-guide/
sending emailshttps://realpython.com/python-send-email/
Python Modules and Packages: An Introductionhttps://realpython.com/courses/python-modules-packages/
00:00https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=0.51
Python uses a lot of fancy terminology that you may not be familiar with ifhttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=0.51
you’re new to programminghttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=5.79
or if you come from a different language. Before Python, my background washttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=7.17
primarily in C# and Microsoft’s .NET framework.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=12.27
00:16https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=16.92
I remember trying to learn Pythonhttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=16.92
but being kind of confused by all of these buzzwords. My goalhttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=19.08
in this course is to clear up some of this so that it’s not confusing to youhttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=23.85
later on.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=28.08
00:30https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=30.57
A Python script is best defined as a Python file that contains commands inhttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=30.57
logical order. For this to be considered a script,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=36.66
the program should do something—really, anything—when it’s run through the Pythonhttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=40.38
interpreter. To better understand this,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=45.72
take a look at these two programs.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=48.6
00:51https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=51.78
Both programs contain a function that will return the sum of two values.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=51.78
However,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=57.42
only the program on the right will actually call that function and print itshttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=58.17
result. The file on the right is intended to be run directly,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=62.34
so we can say that it’s a Python script. On the other hand,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=67.17
the program on the left doesn’t look like it’s actually meant to do anything.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=71.91
01:16https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=76.2
Running that file will not produce any sort of output,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=76.2
since the function is never being called.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=79.47
It’s not intended to be run directly.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=82.32
The file on the left is better classified as a module. That’s because we canhttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=85.32
import it into other files to utilize its classes,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=91.14
functions, variables, and other members it’s defined.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=95.34
01:40https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=100.5
I’m going to change the program on the right so that instead of defining the add()https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=100.5
function, we import it from the module on the left.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=105.12
This has the effect of making the addition function on the lefthttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=109.29
accessible to the script on the right.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=113.58
01:58https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=118.88
So, long story short: scripts are intended to be run directly,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=118.88
whereas modules are meant to be imported. Scriptshttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=123.77
often contain statements outside of the scope of any class or function,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=127.97
whereas modules define classes, functions, variables,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=132.95
and other members for use in scripts that import it.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=138.14
02:22https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=142.76
The words script and module are often used interchangeably,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=142.76
so be aware that you might see other people use them in ways that don’t strictlyhttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=146.81
follow these definitions.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=151.64
02:35https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=155.63
Packages are a collection of related modules.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=155.63
A package can be an individual Python module,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=159.62
but they’re most often a collection of multiple related modules that comehttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=163.22
bundled together. This here is the dateutil package,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=168.83
which allows for performing advanced date-related operations.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=173.69
02:58https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=178.61
It’s bundled in a folder called dateutil. Insidehttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=178.61
there are a bunch of individual modules as well as folders containing otherhttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=183.01
modules, which can be imported into your Python scripts.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=188.65
03:13https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=193.33
These are modules because they don’t do anything interesting on their own.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=193.33
When you import one into your own script, nothing really happens.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=198.46
You have to use something defined within the module,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=203.5
such as a class, function, or a variable.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=207.16
03:31https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=211.15
This special __init__ file tells Python that this is a package,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=211.15
potentially containing more modules nested within subfolders.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=216.07
03:42https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=222.67
We can’t talk about libraries without mentioning the Python standard library.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=222.67
The Python standard library is a large collection of modules and packages thathttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=228.46
come bundled with your installation of Python.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=234.58
03:58https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=238.27
That means that you don’t have to download them from anywhere—https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=238.27
you can just import them into your scripts and start using them right away.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=242.2
dateutil is an example of a standard library package,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=247.03
but there are also others, like email and json.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=251.35
04:16https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=256.93
The key takeaway here is that a lot of this is, to some extent,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=256.93
subjective. Scripts are runnable Python programs that do something when executed.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=261.37
Modules are Python files that are intended to be imported into scripts and otherhttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=268.57
modules so that their defined members—like classes and functions—can be used.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=274.12
04:41https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=281.02
Packages are a collection of related modules that aim to achieve a common goal.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=281.02
Finally,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=286.92
the Python standard library is a collection of packages and modules that can behttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=288.13
used to access built-in functionality. In an ideal world,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=293.23
you’d import any necessary modules into your Python scripts without any issues.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=297.79
05:04https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=304.06
Unfortunately, that’s often not the case. In the next video,https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=304.06
I’ll show you what to do when Python can’t find the module you’ve justhttps://realpython.com/lessons/scripts-modules-packages-and-libraries#t=308.47
installed.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=312.37
Then, you’ll learn how to actually install them with Python’s package manager.https://realpython.com/lessons/scripts-modules-packages-and-libraries#t=313.6
May 26, 2020https://realpython.com/lessons/scripts-modules-packages-and-libraries#comment-193a9dc5-5cd2-4166-bdc3-b01589780186
March 8, 2022https://realpython.com/lessons/scripts-modules-packages-and-libraries#comment-3f0c2f31-a48e-4873-bc5f-56108eb06bf6
March 9, 2022https://realpython.com/lessons/scripts-modules-packages-and-libraries#comment-a5b6a464-a816-4a5d-97bb-00db35700bb8
July 12, 2022https://realpython.com/lessons/scripts-modules-packages-and-libraries#comment-2fab69ac-df2e-4f63-8434-dd53b9ab08da
July 12, 2022https://realpython.com/lessons/scripts-modules-packages-and-libraries#comment-520f3add-654f-44fb-a73d-80aea185a251
Become a Memberhttps://realpython.com/account/join/
https://realpython.com/videos/what-is-pip-overview/
Overviewhttps://realpython.com/courses/what-is-pip/
https://realpython.com/videos/why-cant-python-find-my-modules/
A Beginner's Guide to pip (Overview) 02:37 https://realpython.com/videos/what-is-pip-overview/
Scripts, Modules, Packages, and Libraries 05:20 https://realpython.com/videos/scripts-modules-packages-and-libraries/
Why Can't Python Find My Modules? 06:40 https://realpython.com/videos/why-cant-python-find-my-modules/
What Is a Package Manager? 01:55 https://realpython.com/lessons/what-package-manager/
Getting Started With pip and PyPI 07:15 https://realpython.com/lessons/getting-started-pip-and-pypi/
Using Requirement Files 04:04 https://realpython.com/lessons/using-requirement-files/
Production vs Development Dependencies 03:11 https://realpython.com/lessons/production-vs-development-dependencies/
Uninstalling Packages Using pip 01:27 https://realpython.com/lessons/uninstall-packages/
Alternatives to pip 01:19 https://realpython.com/lessons/alternatives-pip/
A Beginner's Guide to pip (Quiz) 05:30 https://realpython.com/lessons/a-beginners-guide-to-pip-quiz/
A Beginner's Guide to pip (Summary) 00:42 https://realpython.com/lessons/what-is-pip-summary/
Privacy Policyhttps://realpython.com/privacy-policy/

Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover

Robots: max-image-preview:large


URLs of crawlers that visited me.