Python import Keyword
Example
Import the datetime
module and display the current date
and time:
import datetime
x = datetime.datetime.now()
print(x)
Try it Yourself »
Definition and Usage
The import
keyword is used to import
modules.
Related Pages
The from
keyword.
The as
keyword.
Read more about modules in our Python Modules Tutorial.