您好我是python和编程的新手。我正在尝试制作一个组织应用程序。我收到此错误但不知道这意味着什么
import os, glob, shutil, sys, time
#source is the location of the directory
src = os.listdir("/Users/user/Downloads")
dst = os.listdir("/Users/user/Documents/Media")
for filename in os.listdir(src):
if os.stat(filename).st_mtime < now - 240 * 86400:
if os.path.isfile(filename):
if files.endswith(".mkv"):
shutil.move(source, destination)
这是错误。
Traceback (most recent call last):
File "test.py", line 6, in <module>
for filename in os.listdir(src):
TypeError: coercing to Unicode: need string or buffer, list found