title: How to save .txt file to E3 (AWS) with Pyspark
body: <p>I have no troubles reading a .txt file from S3 with the following line</p>
  
  <pre><code> lines = sc.textFile("s3n://gvdata/ETL_Data/example.txt")
  </code></pre>
  
  <p>but when I want to open a file, write something into it and save it to my bucket in S3</p>
  
  <pre><code>filename = "s3n://gvdata/myLog-%s.txt"%datetime.now().strftime('%d-%m-%y')
  f = open(filename,'w')
  f.write("blabla %s \n" %datetime.now().strftime('%d-%m-%y_%H:%M:%S'))
  f.close()
  </code></pre>
  
  <p>I get <code>"No such file or directory"</code>.</p>
  
  <p>Anyone knows how to change it?</p>
  
  <p>Thanks in advance!</p>