Pyhon/excel python in Chinese when exporting to Excel

Source: Internet
Author: User

Yesterday using python+win32com to export the form of the Web page to local Excel, encountered the output garbled problem, the workaround:

Change X to X.decode ('utf-8')

Setcall (' Sheet1 ', Row,col,x.decode ('utf-8'))

Part of my source code:

Self.xlbook = self.xlApp.Workbooks.Add ()    def Setcell (self,sheet,row,col,value):# set the data        for a cell " Set value of one cell " = Self.xlBook.Worksheets (sheet)        print  row,col        =           Value
Setcall (' Sheet1 ', i,j,x)

Related Article

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.