I am quite new to Python, I am trying to develop some sort of bot that can record the inputs you enter through keyboard and mouse, into a json file, and the play it back. That works fine, but I am trying to add another feature to record on video the playback, I have found on github a class that do that already and modified it slightly. The thing is that I import the file(test_recorder) where I have the App class, so I can create an instance of the class to use its functions, but as soon as I add the import line importinf the file(test_recorder.py), I get this error when running the script:
Process finished with exit code -1073740791 (0xC0000409)
This is the class to record the screen in video(test_recorder.py):
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton
from PyQt5.QtCore import pyqtSlot
from pyautogui import screenshot
import cv2
import glob
from threading import Thread
import shutil
import os
import time
def main():
app = QApplication(sys.argv)
ex = App()
sys.exit(app.exec_())
class App(QWidget, Thread):
"""Inherit the class Thread"""
def __init__(self):
"""Initialize init"""
super().__init__()
self.title = 'Screen Recorder'
self.left = 10
self.top = 10
self.width = 500
self.height = 50
self.count = 0
self.status = True
Thread.__init__(self)
self.daemon = Thread(target=self.start_recording, name="start_recording")
self.daemon.setDaemon(True)
self.initUI()
it has some other functions such as record, stop record and take screenshot. Then I have the main file (playback.py) which look like this:
import pyautogui
from time import sleep, time
import os
import json
import test_recorder
def main():
initializePyAutoGUI()
countdownTimer()
playActions("actions_test_08-10-2020_11-00-48.json")
print("Done")
As soon as the import test_recorder is added I get the error mentioned above. I have no clue what to check or where to start looking. Any hint / clue is much appreciated
User contributions licensed under CC BY-SA 3.0