The open function to open the file is "test.txt" .
The file is in the same directory as the append mode:
text_file = open("test.txt","a")
If the file is not in the same directory, we have to define the path in the append mode:
text_file = open("/home/…../test.txt","a")