D
D
Daidin2021-12-11 22:54:01
Parsing
Daidin, 2021-12-11 22:54:01

How to set excel column width?

import csv
with open('test.csv', 'w', newline='') as file:
    
    writer = csv.writer(file, delimiter=';')
    writer.writerow(['Name', 'Preview', 'Price', 'URL'])
    writer.writerow(["name_of_product", "image_of_product", "price_of_product", "url_of_product"])


There is such a code, i.e. the data is already written to the table, how can I make the width of each column larger so that the data fits, let it be some kind of width I set. I can't find anywhere how to do it with the finished table.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question