Mastering Python Scripting for System Administrators by Ganesh Sanjiv Naik

Mastering Python Scripting for System Administrators by Ganesh Sanjiv Naik

Author:Ganesh Sanjiv Naik
Language: eng
Format: epub, pdf
Tags: COM088000 - COMPUTERS / System Administration / General, COM051360 - COMPUTERS / Programming Languages / Python, COM043000 - COMPUTERS / Networking / General
Publisher: Packt Publishing
Published: 2019-01-25T08:26:37+00:00


Appending values

In this section, we are going to append values in Excel. For that, we are going to use the append() method. We can add a group of values at the bottom of the current sheet in which we want to put the values. Create a script called append_values.py and write the following content in it:

from openpyxl import Workbook

book_obj = Workbook()

excel_sheet = book_obj.active

rows = (

(11, 12, 13),

(21, 22, 23),

(31, 32, 33),

(41, 42, 43)

)

for values in rows:

excel_sheet.append(values)

print()



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.