#!/usr/bin/python3
#======================================================================================
# Using the Car class
#======================================================================================
import sys                                              
sys.path.insert(0,'/home/s/sultans/web/python/demo/oo/car')
from Car import Car                          #from the Car file/module import Car class 

print("Content-type: text/html \n")                     #required response header

print('<br>')
print(Car.classType)                                    #access class attribute
print('<br>')
print(Car.getType())                                    #call static method
print('<br>')

myCar   = Car('Lexus','RX450h')                         #instantiate an object
wifeCar = Car('Audi','A4')                              #instantiate another object

print(myCar.make, myCar.model)                          #access instance attributes
print('<br>')

print("My Car make is.: " + myCar.getMake())            #access getter method
print('<br>')
print("My Car model is: " + myCar.getModel())                
print('<br>')

print("<b>My Car:</b>", myCar.__str__() )               #no need to code __str__()
print('<br>')
print("<b>My Wife's Car: </b>", wifeCar)                                  
print('<br>')




#=== link to see the python code =================================================
import os, sys
sys.path.insert(0,'/home/s/sultans/web/python/demo')
import zCode                          #import func to display the Python code
filename = os.path.abspath(__file__)  #get absolute file name 
zCode.display(filename)               #call it
#=================================================================================