选择一个文件夹,遍历文件夹内所有png格式图片,输出图片数量
import os def list_image(path): ans = 0 for file in os.listdir(path): if (os.path.splitext(file)[-1] == '.png'): print(file) ans += 1 print(ans) list_image('/Users/AvaterXXX/Desktop/AI_Lab/Assignment3/Images/')
选择一个文件夹,遍历文件夹内所有png格式图片,输出图片数量
import os def list_image(path): ans = 0 for file in os.listdir(path): if (os.path.splitext(file)[-1] == '.png'): print(file) ans += 1 print(ans) list_image('/Users/AvaterXXX/Desktop/AI_Lab/Assignment3/Images/')
Generate
More than just a code generator. A tool that helps you with a wide range of tasks. All in one place.
Function from Description
Text Description to SQL Command
Translate Languages
Generate HTML from Description
Code to Explanation
Fix invalid Code
Get Test for Code
Class from Description
Regex from Description
Regex to Explanation
Git Command from Description
Linux Command
Function from Docstring
Add typing to code
Get Language from Code
Time complexity
CSS from Description
Meta Tags from Description