title: create a file in the script using python
body: <p>I am new to python. </p>
  
  <p>I wanted to know if I could create a text file in the script itself before writing into.
  I do not want to create a text file using the command prompt.</p>
  
  <p>I have written this script to write the result into the file</p>
  
  <pre><code>with open('1.txt', 'r') as flp:
          data = flp.readlines()
  </code></pre>
  
  <p>however I know that 1.txt has to be created before writing into it.</p>
  
  <p>Any help would be highly appreciated.</p>