Python import Keyword

Example

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

import datetime
x = datetime.datetime.now()
print(x)

Run Instance

Definition and Usage

The import Keyword is used to import modules.

related pages

from Keyword

as Keyword

Please visit our Python Modules Learn more about modules in the tutorials.