Computer and IT knowledge - things to know
A very flexible way is to use the Python Script plugin to insert the current date dynamically.
Install the Python Script plugin via the Plugin Manager if you haven't already:
- Go to Plugins > Plugins Admin.
- Find Python Script and install it, then restart Notepad++.
now to sample scripts:
_____________________________________
#Go to Plugins > Python Script > Configuration.
#Select your script (InsertMainHeader.py).
from datetime import datetime
# Get current date in DD.MM.YYYY format
current_date = datetime.now().strftime("%d.%m.%Y")
# Create the header lines
header_lines = [
"###############################################################################",
"#",
"# Customer / VK",
"#",
"# DL",
"#\t",
"# (c) by bla",
"#",
"###############################################################################"
]
# Join the lines into a single string
header_text = "\n".join(header_lines)
# Insert the header at the current cursor position
editor.addText(header_text + "\n")
_____________________________________
#Go to Plugins > Python Script > Configuration.
#Select your script (InsertHeaderDate.py).
from datetime import datetime
# Get current date in DD.MM.YYYY format
current_date = datetime.now().strftime("%d.%m.%Y")
# Prepare the header lines
header_lines = [
"---------------------------------",
"- {}",
"---------------------------------"
]
# Construct the full header
header_text = "\n".join(header_lines).format(current_date)
# Insert at cursor position
editor.addText(header_text + "\n")
_____________________________________
computer2know :: thank you for your visit :: have a nice day :: © 2025