Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- # Filename: create_example_html.py
- # Version: 1.0.0
- # Author: Jeoi Reqi
- """
- Description:
- This script creates an example HTML file ('example.html') with sample content.
- Requirements:
- - Python 3.x
- Usage:
- 1. Save this script as 'create_example_html.py'.
- 2. Run the script.
- Note: Adjust the 'html_filename' variable in the script as needed.
- """
- def create_example_html(html_filename):
- html_content = """
- <!DOCTYPE html>
- <html>
- <head>
- <title>Example HTML</title>
- </head>
- <body>
- <h1>Hello, World!</h1>
- <p>This is an example HTML file.</p>
- <p>Feel free to customize the content.</p>
- </body>
- </html>
- """
- with open(html_filename, 'w') as htmlfile:
- htmlfile.write(html_content)
- if __name__ == "__main__":
- # Set the filename for the example HTML file
- html_filename = 'example.html'
- # Create the example HTML file in the current working directory
- create_example_html(html_filename)
- print(f"Example HTML file '{html_filename}' created in the current working directory.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement