THE WORLD'S LARGEST WEB DEVELOPER SITE

Python import Keyword

❮ Python Keywords


Example

Import the datetime module and display the current date and time:

import datetime

x = datetime.datetime.now()
print(x)
Run example »

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.


❮ Python Keywords