79589315

Date: 2025-04-23 18:56:21
Score: 5.5
Natty:
Report link

Thank you for your varied and detailed answer. Item #3 was the most intriguing as eventually I want to create a form for a user interface. It also led to a surprising discovery: the DoEvents will make the print statement do what I wanted.

That is, this will work:

import clr
import time

clr.AddReference('System')
import System

for i in range(1, 20):
    print i
    System.Windows.Forms.Application.DoEvents()  # Keep form responsive
    time.sleep(1)

I am I right in guessing that DoEvents will effect all forms currently open in Windows? If so, is there a way to get it to do only RPS's window?

Michelle

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Blacklisted phrase (1): is there a way
  • RegEx Blacklisted phrase (1): I want
  • Contains signature (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Michelle