I want to pass some data to another python script and do something there. But the data i send conflicts if i run script multiple times at the same time with different arguments. How do i separate them?
Example code:
main.py
import otherscript
list_a = [1,2,3] # from arguments
otherscript.append_to_another_list(list_a)
otherscript.py
another_list = []
def append_to_another_list(list):
another_list.append(list)
print(another_list)
if i run main.py twice at the same time with arguments 1,2,3 and 4,5,6 it prints both of them in the same list like [1,2,3,4,5,6]. I hope i made this clear
main.py -l 123and thenmain.py -l 456on another terminal window, and second one prints both of them-lflag ? You should have included that in yourmain.pyexampleotherscript'sanother_listvariable is shared between instances and it should be independent for eachmain.pyfile is running which is a infinite loop in my exampleanother_list.append(list)this code appends newlistinto 'another_list`. Could you let me know more detail what you want to solve?