建模程序 多个定时程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
965 B

#!/usr/bin/python
import os, sys
if __name__ == '__main__':
if len(sys.argv) != 3:
print("Usage: split.py number1 number2")
sys.exit(1)
photo1 = sys.argv[1]
photo2 = sys.argv[2]
current_path = os.getcwd()
os.system("mkdir -p " + os.path.join(current_path, "photo1"))
os.system("mkdir -p " + os.path.join(current_path, "photo2"))
for file in os.listdir(current_path):
if file.endswith(".jpg"):
if file.split("_")[-1].split('.')[0] == photo1:
os.system("cp " + os.path.join(current_path, file) + " " + os.path.join(current_path, "photo1" + os.sep + file.split("_")[0] + file[-4:]))
if file.split("_")[-1].split('.')[0] == photo2:
os.system("cp " + os.path.join(current_path, file) + " " + os.path.join(current_path, "photo2" + os.sep + file.split("_")[0] + file[-4:]))
os.system('find_photo.py ' + 'photo1')
os.system('find_photo.py ' + 'photo2')