0 Basic White How do I use Python to make forms?

Source: Internet
Author: User

Using Python to manipulate excel in the work is still quite common, because after all, do not understand Excel is a user of large data management software. This paper uses python3! Before you share, small make recommend a very good exchange treasure, inside are a group of love and learning Python's small partners, big thousands of, a variety of people have, especially like to see the atmosphere of this kind of people together to solve the problem, the group of information also uploaded a lot, all kinds of Daniel to solve the problem of small white , this Python group: 330637182 Welcome to join us in a conversation, progress together and master this Python language as early as possible.

First import two modules xlrd and XLWT,XLRD to read Excel table, XLWT is to write Excel table

At the command prompt, enter the command:

Pip Install Xlrd

Pip Install XLWT

Let's take a look at the use of these two modules

First, XLRD

1. First import the module, import xlrd

2. First write a table for the experiment, the contents of the table are as follows:

This is the basic operation, the following extension point

About the time format:

Take a look at the time that column of data, get what

[' Time ', 42993.0, ' 2017.01.12 ', 40900.0]

This is not what we want, this time format is in Excel, with January 1, 1900 as the starting time, the obtained data in days

In fact, in this module, there is a property to display the type of cell data, CType, there are several types:

CType = 1 # type 0 empty,1 string, 2 number, 3 date, 4 Boolean, 5 error

We can look at what type of this is it printed

The result is modified, but it's only temporary, and the original form has not been modified.

4. Save

Myworkbook.save (' Test.xls ') #保存

Thank you for reading, this case is more suitable for 0 basic novice

If everyone is interested, or the novice is learning python, can private me, my side will give tutorial guidance.

0 Basic White How do I use Python to make forms?

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.