0
I need to save image obtained by pyautogui.hotkey('Alt','printscreen')
In the example below I used pyautogui.screenshot()
, but I wanted to catch one print of active window only.
time.sleep(2);
foto = pyautogui.screenshot();
nomeArquivo = win32gui.GetWindowText(win32gui.GetForegroundWindow()) + '.jpg';
nomeArquivo = nomeArquivo.replace('Código: ','');
nomeArquivo = nomeArquivo.replace(' - Imagem Ampliada','');
foto.save('C://Tmp//' + nomeArquivo);
Read the Manual on how NOT to ask questions and also read What a mistake I made asking my question?
– Solkarped