It looks like the file is not found. Does the following work?
Code:
directory = r'D:\PhD\Study-I_Part_I\My_Programs\DFI\Participant_Data'
filename = str(id) + '_experiment_data.txt'
filepath = os.path.join(directory, filename)
experiment_data = open(filepath,'a')