您的位置:首页 > 编程语言 > Python开发

Notepad++: Insert Timestamp -- Using Python

2013-12-26 21:00 10 查看
1. Select menu Plugins\Python Script\New Script.
2. Create a script file "DateTime.py" for example. Then, input following statements in it:

import time


editor.addText(time.strftime('%Y-%m-%d %H:%M'))

3. Select menu Plugins\Python Script\Configuration.

4. In Python Script Shortcut Configuration dialog,

1) Check radio button of "User Scripts"
2) Select the file you just created
3) Click [Add] button which is above "Menu Items" frame.
4) Click [OK] to close this dialog.

5. You will find there is an item of "DateTime" in Plugins\Python Script\

If you want to assign a shortcut to this item/command, please follow these steps:
1. Open Shortcut mapper dialog with menu path "Settings\Shortcut Mapper".
2. Select tab of "Plugin commands"
3. Scroll the window to locate to the DateTime command.
4. Click [Modify] button and assign a shortcut for the DateTime command.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: