I am very new to Python. I need to run diff.py(a python in built script) from my python script,to compare 2 files. I have used the system command in Perl before to do some stuff similar to this,but I cant seem to get it with python.
I tried os.system and the subprocess module but no luck yet.
Any help will be much appreciated,
Thanks
Mohima C
I am very new to Python. I need to run diff.py(a python in built
Share
Since the script
diff.pysimply calls a single function from thedifflibmodule, it’s much easier and more flexible to call this function yourself. What function exactly you’d need to call depends on the command line options you would pass todiff.py.In conclusion, don’t call a subprocess for this.