Excel OFFICETOOL Python

How to handle an excel file (Python+Excel method #3, w/xlsxwriter)

In a min, you can data manipulation as Excel & Python Expert

Step 1

  • Installation of free python tools for MacBook/Windows using pycharm program with anaconda
    → a link for installation guide

Step 2

  • Installation python plug-ins for Excel
    → a link for installation guide
  • Step by Step
    • Move to terminal in PyCharm
    • Install plug-in using a comment : pip install package-name (xlsxwriter-xxxx, pandas)
      • Example : pip install xlsxwriter

Step 3

  • Writing a source Code (Sample) → a video link for installtion guide (tbd)
  • Creation three excel files to merge as one file, then run python code to merge those

→ a sample code

import xlsxwriter

input_folder = '/Users/tippang/PycharmProjects/pythonProject2/tmp'
excel_file = input_folder + 'tst5.xlsx'

wb = xlsxwriter.Workbook(excel_file)

ws = wb.add_worksheet()

ws.set_row(0,10)
ws.set_row(1,30)
ws.set_row(2,50)

ws.set_column(0, 0, 10)
ws.set_column(1, 3, 30)
ws.set_column(3, 4, 50)

ws.write('A1',"height : 10, width : 10")
ws.write('A2',"height : 30, width : 30")
ws.write('A3',"height : 50, width : 50")

wb.close()

print("created file", excel_file)