Jul-31-2023, 03:58 PM
(Jul-31-2023, 03:17 PM)deanhystad Wrote: You are using global wrong. Validator needs to declare loop_valve as global so "loop_valve =+1" doesn't create a local variable named "loop_valve" and assign it the value "loop_valve + 1". You do not need to use "global loop_valve" in the for loop. The for loop is running in the global context, and any variables created in the for loop are global.
Why does Validator open a file every time? Does input.txt change? If input.txt changes, why does it change? Are you using a file to communicate between the generator and the validator? Why? Are they different processes?
Thanks for your reply.
- Input.txt changes.. Once I am able to workaround this issue, if the generated token/number isn't in the input.txt, another function will append the number into the input.txt.
- Input.txt is the only file. The idea is to generate an unique token on each run.
- The 100 times loop is meant to be the number of unique generated tokens written in the input.txt (from function generator)