Python script signaling another script to run

Home Forums Software Testing Discussions Python script signaling another script to run

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #25152
    jain
    Participant
    @jainsaniya

    <p style=”margin: 0px 0px 1.4em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Arial, ‘Helvetica Neue’, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; color: #242729;”>So I am trying to create a simple game in Python where a question is generated and you have to answer within a certain time frame. Because I actually can’t think of a way to have the countdown on (basically printing numbers until it reaches zero) and still being able to type your input, after much thought I decided to have the question in one Python script and the countdown in another, basically running them simultaneously.</p>
    <p style=”margin: 0px 0px 1.4em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Arial, ‘Helvetica Neue’, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; color: #242729;”>After the question is generated, I had Python write a certain character in a text file so the countdown script could start automatically after seeing this certain character. That meant the countdown script had to run and constantly check for that certain character. I implemented a simple while loop that reads the file for changes but for some reason it didn’t react to changes. Does anyone have any suggestion on how to do it? Is there another way to signal a script to start running?</p>

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.