标签:coding import imp font open style strftime name file
import time
print time.strftime(‘%y-%m-%d %H:%M:%S‘,time.localtime())
19-04-21 13:03:08
# coding:utf-8
import os
print u‘当前文件的目录‘,os.path.dirname(__file__)
print u‘当前文件的上一级目录‘,os.path.dirname(os.path.dirname(__file__))
base_dir = os.path.dirname(os.path.dirname(__file__))
f = open(os.path.join(base_dir,‘Days/login‘),‘r‘)
print f.read()
标签:coding import imp font open style strftime name file
原文地址:https://www.cnblogs.com/hyzhang/p/10744895.html