[Python example] Using Python to insert an example in Excel

Source: Internet
Author: User

[Python example] Using Python to insert an example in Excel


I used Python to handle excel. I used openpyxl and pyexcel.
At present, I think other functions (such as using the formula in the lattice) should be used in addition to the aggregate functions)
You can use xlwings to Make Excel fly with Python! "It sounds worse than just warning.

The following describes how to insert the full program of the solution program into my Python on my Github.

 

#-*-Coding: UTF-8-*-from xlwings import Workbook, Sheet, Range, Chartimport win32com. client # Open the Excel worksheet xl = win32com. client. dispatch ("Excel. application ") # Do not let the excel sheet pop out xl. visible = Falsewb = xl. workbooks. open (R' the path to the Excel worksheet ') sheet = wb. activeSheet # This is an animated sheet inserted into the solution. range ("A1 "). addComment () # Let the sheet solution be seen in sheet. range ("A1 "). comment. visible = True # the string to be put in: commentString = 'Allow cannot be decrypted. '# because it is Chinese, please refer to commentString = (commentString ). decode ('utf-8') # Put the string into the sheet. range ("A1 "). comment. text (commentString) # Save the signature parameter wb. saveAs (r 'excel excel tutorial route') xl. displayAlerts = Falsewb. close (True) xl. quit ()

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.