title: How to write data in "file versions" instead of writing in a single file in python?
body: <p>I am reading sensor data and saving in file like this:</p>
  
  <pre><code>with open('serial_data.txt','a') as f:
  </code></pre>
  
  <p>Problem is, if I write the code five times, it appends in the same file. I want the data of each test in separate file for example if I run code four times, then it should save as: <em>"serial_data_1.txt"</em>, <em>"serial_data_2.txt"</em>, <em>"serial_data_3.txt"</em>, <em>"serial_data_4.txt"</em>..... Is there any way to do this?</p>