New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breakpoints set in modules running in separate thread are ignored. #1224
Comments
Cannot reproduce here (see below). Which version of PyScripter are you using? |
I'm running version 4.2.5.0 and a minimal script... I'm by far no python expert and I'm dealing with a GUI app built with PyQt6 which I didn't create myself. |
Please try with the preview of the next version. I works here with the following script: from PyQt6.QtCore import *
from PyQt6.QtWidgets import *
from requests import Session
from threading import Thread
from time import sleep
name = "John" #input("Please enter your name: ")
chat_url = "https://build-system.fman.io/chat"
server = Session()
# GUI:
app = QApplication([])
text_area = QPlainTextEdit()
message = QLineEdit()
layout = QVBoxLayout()
layout.addWidget(text_area)
layout.addWidget(message)
window = QWidget()
window.setLayout(layout)
window.show()
# Event handlers:
new_messages = []
def fetch_new_messages():
while True:
response = server.get(chat_url).text
if response:
new_messages.append(response)
sleep(.5)
thread = Thread(target=fetch_new_messages, daemon=True)
thread.start()
def display_new_messages():
while new_messages:
text_area.appendPlainText(new_messages.pop(0))
def send_message():
server.post(chat_url, {"name": name, "message": message.text()})
message.clear()
# Signals:
message.returnPressed.connect(send_message)
timer = QTimer()
timer.timeout.connect(display_new_messages)
timer.start(1000)
app.exec() |
It looks like PyScripter will only debug code in the main thread. Breakpoints set in modules which run in a separate thread are completely ignored.
The text was updated successfully, but these errors were encountered: