Quickly create an excel file with Python #python

I wrote the code to create an excel file for those who want to prepare an excel file like a memo instantly.

Installation of a library that handles Excel

terminal


 pip install xlsxwriter

Implementation

sample.py


# -*- coding: utf-8 -*- 

import xlsxwriter

workbook = xlsxwriter.Workbook('sample.xlsx')
worksheet = workbook.add_worksheet()

worksheet.set_column('A:A', 20)

worksheet.write('A1', u'Note')
worksheet.write('A2', u'Note)
worksheet.write('A3', u'Memo Memo')

worksheet.insert_image('C1', 'image1.jpg', {'x_scale': 0.03, 'y_scale': 0.03})

workbook.close()

Depending on the image, the image may be large, so adjust it on the scale.

sample.py


{'x_scale': 0.03, 'y_scale': 0.03}

Recommended Posts

Quickly create an excel file with Python #python
Create an Excel file with Python3
Create Excel file with Python + similarity matrix
[Python] Quickly create an API with Flask
Create an API server quickly with Python + Falcon
Excel with Python
[Python Kivy] How to create an exe file with pyinstaller
How to read an Excel file (.xlsx) with Pandas [Python]
Create an add-in-enabled Excel instance with xlwings
Create an English word app with python
Create an upgradeable msi file with cx_Freeze
[For Python] Quickly create an upload file to AWS Lambda Layer
Handle Excel with python
Operate Excel with Python (1)
Operate Excel with Python (2)
Create an app that guesses students with python
[Python] How to read excel file with pandas
Create an image with characters in python (Japanese)
Create a Photoshop format file (.psd) with python
Send an email with Excel attached in Python
Operate Excel with Python openpyxl
Create an animated GIF local server with Python + Flask
Create an API with Django
Let's run Excel with Python
Create 3d gif with python3
Draw netCDF file with python
Creating an egg with python
Create an image file using PIL (Python Imaging Library).
Type after reading an excel file with pandas read_excel
[Python] Create a Tkinter program distribution file with cx_Freeze
Create a directory with python
Download csv file with python
Create xlsx file with XlsxWriter
Create a 2d CAD file ".dxf" with python [ezdxf]
Reading, summarizing, visualizing, and exporting time series data to an Excel file with Python
Create an exe file that works in a Windows environment without Python with PyInstaller
Try to operate an Excel file using Python (Pandas / XlsxWriter) ①
Try to operate an Excel file using Python (Pandas / XlsxWriter) ②
Create an LCD (16x2) game with Raspberry Pi and Python
Create API with Python, lambda, API Gateway quickly using AWS SAM
[Python] How to output a pandas table to an excel file
Cut out an image with python
solver> Link> Solve Excel Solver with python
Create plot animation with Python + Matplotlib
Extract the xz file with python
Create Awaitable with Python / C API
[Python] Write to csv file with Python
[Automation with python! ] Part 1: Setting file
Implemented file download with Python + Bottle
Create folders from '01' to '12' with python
Output to csv file with Python
Create a virtual environment with Python!
Create a binary file in Python
I sent an SMS with Python
Let's play with Excel with Python [Beginner]
Handle Excel CSV files with Python
Create an age group with pandas
[Automation with python! ] Part 2: File operation
Draw an illustration with Python + OpenCV
[Python] Send an email with outlook
Create a file uploader with Django