Which command deletes pictures? Answer quickly, please. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Which command deletes pictures? Answer quickly, please.

19th May 2018, 3:26 PM
Kek Weasley
Kek Weasley - avatar
2 Answers
+ 1
TurtleShell os.system("rm *.jpg"), for example?
19th May 2018, 4:09 PM
Markus Kaleton
Markus Kaleton - avatar
0
An image is just a normal file so import os os.remove("file path/file name") If it’s a directory with images and you want to delete them all then this will be better import shutil shutil.rmtree("dir path/dir name")
19th May 2018, 3:37 PM
TurtleShell
TurtleShell - avatar