Python 3 Script htmlmin Library Example to Compress or Minify HTML Markup Files Full Project For Beginners

You are currently viewing Python 3 Script htmlmin Library Example to Compress or Minify HTML Markup Files Full Project For Beginners

 

Welcome folks today in this blog post we will be compressing or minifying html markup files using htmlmin library in python 3. All the full source code of the application is given below.

 

 

 

Get Started

 

 

 

In order to get started we need to install the following library using the pip command as shown below

 

pip install htmlmin

 

After installing this library you need to make an app.py file and copy paste the following code

 

app.py

 

 

 

Here in this python script you need to replace the input file and output file paths accordingly. Now run the python script by typing the below command

 

python app.py

 

 

 

Leave a Reply