I am trying to write a generic code to perform set operation on any number of input files.
normally for any set operation (where I already limit the number of input files), I use something like this.
my_set1 = set(map(str.strip, open('filename1.txt')))
my_set2 = set(map(str.strip, open('filename2.txt')))
common = myset1.intersection(my_set2)
Where each file has only one column.
Now what I am aiming is to put all the set theory functions in it. Something like.
python set.py -i file1,file2,file3,file4 -o inter
These inputs are taken from the user.
Actually user can define the number of input files and the kind of operation he will like.
If anyone of you can show me how it can be done, I can write for the other operations myself like for union and difference