Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5c4c983

Browse files
更新Mymain.py, 修改datetime模块的导入方式
1. 修改`datetime`模块的导入方式 2. 修改`datetime`命令的引用方式
1 parent b58822e commit 5c4c983

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎Mymain.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sublime
44
import sublime_plugin
55
import os
6-
import datetime
6+
fromdatetimeimport datetime
77
from subprocess import Popen
88

99
# 复制当前文件的文件名
@@ -22,7 +22,7 @@ class AddCurrentTimeCommand(sublime_plugin.TextCommand):
2222
def run(self, edit):
2323
self.view.run_command("insert_snippet",
2424
{
25-
"contents": "%s" % datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
25+
"contents": "%s" % datetime.now().strftime("%Y-%m-%d %H:%M:%S")
2626
}
2727
)
2828

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /