📜  listdir - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:56.651000             🧑  作者: Mango

代码示例1
while True:
  total_nft = input("\n Enter the number of NFT's you would like to generate. Eg. 1k/3k/5k/10k")

  try:
    total_nft = int(total_nft)
    break

  except ValueError:
    print("\n Please enter a numeric value. The input you entered is not numeric")

bg_files = listdir("/content/project/background")
print("total samples for bg",len(bg_files))

face_files = listdir("/content/project/face")
print("total samples for face",len(face_files))

eyebrows_files = listdir("/content/project/eyebrows")
print("total samples for eyebrows",len(eyebrows_files))

eye_files = listdir("/content/project/eye")
print("total samples for eye",len(eye_files))

forehead_files = listdir("/content/project/forehead")
print("total samples for forehead",len(forehead_files))

mouth_files = listdir("/content/project/mouth")
print("total samples for mouth",len(mouth_files))

crown_files = listdir("/content/project/crown")
print("total samples for crown",len(crown_files))

ornaments_files = listdir("/content/project/ornaments")
print("total samples for ornaments",len(ornaments_files))