Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

openpyxl font

import openpyxl
  
# import Font function from openpyxl
from openpyxl.styles import Font
  
wb = openpyxl.Workbook()
sheet = wb.active
  
sheet.cell(row = 1, column = 1).value = "Ankit Rai"
  
# set the size of the cell to 24
sheet.cell(row = 1, column = 1).font = Font(size = 24 )
  
sheet.cell(row = 2, column = 2).value = "Ankit Rai"
  
# set the font style to italic
sheet.cell(row = 2, column = 2).font = Font(size = 24, italic = True)
  
sheet.cell(row = 3, column = 3).value = "Ankit Rai"
  
# set the font style to bold
sheet.cell(row = 3, column = 3).font = Font(size = 24, bold = True)
  
sheet.cell(row = 4, column = 4).value = "Ankit Rai"
  
# set the font name to 'Times New Roman'
sheet.cell(row = 4, column = 4).font = Font(size = 24, name = 'Times New Roman')
  
wb.save('styles.xlsx')
Comment

PREVIOUS NEXT
Code Example
Python :: add column as index pandas 
Python :: exclude columns pandas 
Python :: r2 score sklearn 
Python :: python read file csv 
Python :: python hsl to rgb 
Python :: conda install nltk 
Python :: panda dataframe to list 
Python :: python random string 
Python :: how to install flask 
Python :: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 
Python :: matplotlib 3D plots reduce margins 
Python :: pygame change color mouse hover 
Python :: on_ready discord.py 
Python :: train_test_split without shuffle 
Python :: install os python 
Python :: how to count max repeated count in list python 
Python :: python count repeated elements in a list 
Python :: pytho list items to int 
Python :: pandas reciprocal 
Python :: selenium scroll element into view inside overflow python 
Python :: python read file without newline 
Python :: csrf token exempt django 
Python :: django select database for migrate 
Python :: PySpark get columns with null or missing values 
Python :: strptime python decimal seconds 
Python :: downgrade pip 
Python :: how to dynamically access class properties in python 
Python :: rename the console python 
Python :: get file extension python 
Python :: how to accept input as list pyhton 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =