Hello,
I am working on a project and I've come pretty far but the last few days I am simply banging my head against the wall with this topic. It is a PIN code system whereby a particular PIN code is assigned to a particular solenoid lock.
The main file has a function in it where it takes the user input (PIN) and checks it against the existing PINs and when a correct PIN is entered, it triggers one of the "if" statements. Along with each "if" statement that is triggered in the main file, I want to execute an external file with say, one out of four possible options (rather than having 4 separate files to execute).
To do this I am using subprocess so: subprocess.Popen(['python', 'NoidCode.py', what_to_put_here?) where "what_to_put_here?" is where I want to instruct "NoidCode.py" to run, with say option 2 (out of possible 4)
I am not passing variable data, I am just asking it to execute the file with that option or another but none at the same time. I know there are fancier ways to do this but I am looking for simplicity so there is less chance of stuff breaking further down the line.
I am working on a project and I've come pretty far but the last few days I am simply banging my head against the wall with this topic. It is a PIN code system whereby a particular PIN code is assigned to a particular solenoid lock.
The main file has a function in it where it takes the user input (PIN) and checks it against the existing PINs and when a correct PIN is entered, it triggers one of the "if" statements. Along with each "if" statement that is triggered in the main file, I want to execute an external file with say, one out of four possible options (rather than having 4 separate files to execute).
To do this I am using subprocess so: subprocess.Popen(['python', 'NoidCode.py', what_to_put_here?) where "what_to_put_here?" is where I want to instruct "NoidCode.py" to run, with say option 2 (out of possible 4)
I am not passing variable data, I am just asking it to execute the file with that option or another but none at the same time. I know there are fancier ways to do this but I am looking for simplicity so there is less chance of stuff breaking further down the line.