Jump to content

Getting script error after closing py to exe program

Enderg312

I made an autoclicker turn the py to exe with pyinstaller and I have the program close with pressing p and when I close the program with p, it gives an error saying "failed to execute script autoclicker.

What is going wrong and how do I fix it?

Link to comment
Share on other sites

Link to post
Share on other sites

Can you provide the source code?

Link to comment
Share on other sites

Link to post
Share on other sites

20 hours ago, ChemicalXandco said:

Can you provide the source code?

import pyautogui, time
import keyboard
time.sleep(5)

while True:
	pyautogui.click()
	if keyboard.is_pressed('p'):
		quit()

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Enderg312 said:

import pyautogui, time
import keyboard
time.sleep(5)

while True:
	pyautogui.click()
	if keyboard.is_pressed('p'):
		quit()

 

I used this:

import sys
import time

import keyboard
import pyautogui

time.sleep(5)

while True:
	pyautogui.click()
	if keyboard.is_pressed('p'):
		sys.exit()

and the error is gone.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×