title: Writing a list to a txt file with Python and AWS lambda
body: <p>I am developing a lambda function that needs to write each element of a list <code>'my_list'</code>, in a line of my <code>'upload.txt'</code> file.</p>
  <p>I have used the next code :</p>
  <pre><code>my_list=['hello', 'world', 'good', 'morning']
  with open(&quot;upload.txt&quot;, &quot;w+&quot;) as a_file:
     for item in my_list:
         a_file.write(&quot;%s\n&quot; % item)
     file_dict = {&quot;upload.txt&quot;: a_file}
     response = requests.post(url, files=file_dict)
  </code></pre>
  <p>When I try to test my lambda it gave me the next error:</p>
  <pre><code>&quot;errorMessage&quot;: &quot;[Errno 30] Read-only file system: 'upload.txt'&quot;,
  &quot;errorType&quot;: &quot;OSError&quot;,
  </code></pre>
  <p>It is strange because I will create that file now so why it is written read only file</p>