You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
Not sure if this is expected or not, but while waiting for user input with the following code, all (global & local) variables disappear:
print("Please enter the Deskpro ID of the article that you want to translate:")
whileTrue:
try:
ifmsvcrt.kbhit(): # Check if a key has been pressedarticle_id=input()
article_processor.process_article(article_id, language_map)
time.sleep(0.1) # Sleep for a short period to prevent high CPU usageexceptKeyboardInterrupt:
graceful_exit(signal.SIGINT, None)
This is a bit annoying because I have a background process running that I'd like to debug, for which I now cannot see the variables throughout the code. Before this point, switching threads reveals the different variables, but after this point none of the threads reveal any variables.
Before waiting for input:
While waiting for input:
The text was updated successfully, but these errors were encountered:
You can't evaluate anything while all the threads are in the running state
I must say I'm a bit confused (possibly because I'm not a developer). Why wouldn't you? Are variable values not reliable when all threads are running?
Given my scenario (one open thread listening for file changes, one for use input, and a main one), isn't it valid to just see the values of my variables, and see them changing as changes happen (as I've seen in other occasions)?
Are variable values not reliable when all threads are running?
No because they are changing continuously. And they are continuously going out of scope and into scope. There's no good way for the debugger to continuously read them. That's why debuggers only report values when all threads are stopped.
There are some tricks you can use though. Like 'log points'. They break in the debugger without you seeing anything and log a value. It slows the process down (well because all threads stop), but only long enough to send a message to VS code with the log output and then it continues.
Hello,
Not sure if this is expected or not, but while waiting for user input with the following code, all (global & local) variables disappear:
This is a bit annoying because I have a background process running that I'd like to debug, for which I now cannot see the variables throughout the code. Before this point, switching threads reveals the different variables, but after this point none of the threads reveal any variables.
Before waiting for input:
While waiting for input:
The text was updated successfully, but these errors were encountered: