(Jan-26-2018, 09:44 PM)wavic Wrote:the syntax iscommand = "cat /home/norman/khconf/second.txt | sort | uniq > /home/norman/khconf/third.txt".split() subprocess.call(command)
subprocess.call([command])When I run the command from the terminal it works fine without the .split
Quote:When you open a file with 'w' flag for writing it overwrite the previous content. Use 'a' to append.
https://docs.python.org/3/library/functions.html#open
Yes, but it is a file I am creating and it only opens a new file or clears the old contents.
From then on it will automatically append lines until the file is closed. This is what I want it to do.
If you look at my first post I use a python script to read first.txt and create second.txt. First.txt has 46 lines in it and second.txt has 23 lines in it. This is exactly as it should be. I am trying to get this all working as the input file will continue to grow and could end up with hundreds of lines in it