import openpyxl
wb = openpyxl.load_workbook('printtitle.xlsx')
ws = wb['Sheet0']
#Add Print Titles
#You can print titles on every page to ensure that the data is properly labelled.
ws.print_title_rows = '1:3' # the first row
ws.print_title_cols = 'A:B' # the first two cols
#Add a Print Area
#You can select a part of a worksheet as the only part that you want to print
ws.print_area = 'A1:F10'
wb.save('print_area_test.xlsx')