Sep-22-2020, 02:52 AM
Here's another technique:
I imagine your screenshot line will look something like this:
Mike
import os filelist = os.listdir("/media/Avocet/Python/") for filename in filelist: print(filename)The output (on my computer) is:
Quote:testing.py
CheckTest.py
tkinter.pdf
CounterTest.py
ForTest.py
passweird.py
alarming.py
Colors.odt
PythonNotes.odt
hoot.wav
says.wav
I imagine your screenshot line will look something like this:
pyautogui.screenshot(f'/Users/user/Desktop/screenshots/' + filename)One advantage of this technique is that it works with whatever files exist. Disclaimer, I didn't test the screenshot part.
Mike