Created
July 2, 2011 03:34
-
-
Save karanparikh/1059713 to your computer and use it in GitHub Desktop.
Python simple import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import a specific module | |
from vehicle.four_wheels import car | |
my_car = car.Car(transmission="automatic") | |
# import a specific class within a module | |
from vehicle.four_wheels.car import Car | |
my_car = Car(transmission="automatic") | |
# import everything from a module into the current namespace | |
from vehicle.four_wheels import * | |
my_car = Car(transmission="automatic") | |
my_bus = Bus(color="Yellow") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment