Python from Keyword

Example

Only import the time part from the datetime module and then print the time as 15:00:

from datetime import time
x = time(hour=15)
print(x)

Run Example

Definition and Usage

The from Keyword is used to import only the specified parts from a module.

Related Pages

import Keyword

as Keyword

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