title: python write() function automatically creates newline in file
body: <p>I am using the write() to print arrays to a file which will be read by another script, like this:</p>
  
  <pre><code>file2write=open("arrays.txt",'w')
  file2write.write(str(array1)+'\n')
  file2write.write(str(array2))
  file2write.close()
  </code></pre>
  
  <p>I want each array occupying only one line to be read by the other script, however i am getting this when the array grows larger:</p>
  
  <pre><code>1 [ 0.   0.   0.  -0.4  0.6  0.   0.   0.   0.  -0.4  0.6 -0.4  0.6  0.2
  2   0. ]
  3 [0.1 0.3 0.3 0.1 0.1 0.5 0.5 0.7 0.7 0.3 0.3 0.5 0.5 0.7 0.7]
  </code></pre>
  
  <p>How to get this, despite the size of the array:</p>
  
  <pre><code>1 [ 0.   0.   0.  -0.4  0.6  0.   0.   0.   0.  -0.4  0.6 -0.4  0.6  0.2   0. ]
  2 [0.1 0.3 0.3 0.1 0.1 0.5 0.5 0.7 0.7 0.3 0.3 0.5 0.5 0.7 0.7]
  </code></pre>