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 Instance

Definition and Usage

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

Related Pages

import Keyword

as Keyword

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