if name == '__main__':
images = []
flag = 0
if len(sys.argv) != 1:
dir = root_path + sys.argv[1]
if os.path.isdir(dir):
files = os.listdir(dir)
print(files)
for file in files:
if file.endswith('jpg') or file.endswith('png') or file.endswith('PNG') or file.endswith('JPG'):
images.append(dir + '/' + file)
else:
images.append(dir)
else:
print('there should be a parameter after .py')
if len(sys.argv) == 3:
flag = 1
请问这段代码为什么不执行,直接跳到 else:
print('there should be a parameter after .py')输出这段话,谢谢!
人脸表情识别代码 if len(sys.argv) != 1:
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-