Pylint在我调用函数"deletdcmfiles()"的最后一行抱怨."最后的换行线丢失".我是python的新手,我不确定是什么触发了这个?
这是程序的代码:
'''
This program will go through all Work subdirectorys in "D:\\Archvies" folder
and delete all DCM files older then three months.
'''
import os.path
import glob
import time
#Create a list of Work directorys in Archive folder
WORKDIR = glob.glob("D:\\Archives\\ASP*\\Work*")
#Variable holds three months of time in seconds
THREEMONTHSOLD = (time.time()) - (90 * 86400)
def deletdcmfiles():
'''
This function will go through all Work subdirectorys in "D:\\Archvies" folder
and delete all DCM files older then three months. …Run Code Online (Sandbox Code Playgroud) "ModuleNotFoundError: No module named 'blog'"将我的博客应用添加到的INSTALLED_APPS部分时出现错误settings.py。我确定这与我在INSTALLED_APPS下添加“博客”应用程序的方式有关。当我从INSTALLED_APPS错误中删除“博客”引用时,该引用就会消失。似乎Django无法找到我的博客应用程序的目录?
我做了另一件事,那就是使用:
python manage.py startapp blog /myproject
Run Code Online (Sandbox Code Playgroud)
此处的区别是指定/myproject目录,而不使用:
python manage.py startapp blog
Run Code Online (Sandbox Code Playgroud)
它将放置在根目录下myproject。我想避免在根文件夹中添加应用程序目录,以便保持井井有条。但是看起来Django不喜欢这个,或者我在本INSTALLED_APPS节中没有正确引用这个?
我的项目目录如下:
myproject/
??? myproject
? ??? __init__.py
? ??? __pycache__
? ? ??? __init__.cpython-36.pyc
? ? ??? settings.cpython-36.pyc
? ? ??? urls.cpython-36.pyc
? ? ??? wsgi.cpython-36.pyc
? ??? blog
? ? ??? __init__.py
? ? ??? admin.py
? ? ??? apps.py
? ? ??? migrations
? ? ? ??? __init__.py …Run Code Online (Sandbox Code Playgroud)