Office
181208 excel with python, install
openCTRL
2018. 12. 9. 01:08
1. Python install
- homepage link
: https://www.python.org/downloads/
2. PyCharm (IDE) install
- homepage link
- download link
: https://www.jetbrains.com/pycharm/download/#section=windows
: Community : free
3. openpyxl library install (Python library to read/write Excel)
- Pycharm -> File -> settings -> Project interpreter ->
Available Packages -> openpyxl download
4. example source code
from openpyxl import Workbook
MyTestExcelFile = Workbook() # Create excel fileTestWorksheet = MyTestExcelFile.active
TestWorksheet.title = "first_Sheet" # Worksheet name
TestWorksheet["A1"] = "Hello World" # A1 cell data setprint(TestWorksheet["A1"].value) # console output
MyTestExcelFile.save("CreateTest.xlsx") # Save excel file
# openpyxl turorial link