Skip to content
Advertisement

Python code works on cmd and VScode but not on powershell or pyinstaller

I have written a python script to save a book. It takes screenshots, turns pages(pyautogui click) and combines the screenshots into a PDF.

This is what happens on executing code in vscode:

JavaScript

This is what happens in cmd

JavaScript

This is what happens on powershell

JavaScript

…and it just stays there(tested for 15 minutes).

The script:

JavaScript

I have tried:

  1. Rebooting
  2. Re-installing all the required pip modules

Advertisement

Answer

Turn out the auto-clicker was the problem with PowerShell. Whenever it used to click on the PowerShell command line, it paused. Fixed using this answer: https://serverfault.com/a/205898

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement