title: Create Space Delimited File in Python
body: <p>Using the code below, I'm getting the correct information to the file - kind of.  Here's the code:</p>
  
  <pre><code>filename = raw_input('What would you like to name the file? ')
  
  import csv
  
  data = [frames]
  out = csv.writer(open(filename,"w"), delimiter=' ',quoting=csv.QUOTE_MINIMAL)
  out.writerows(data)
  </code></pre>
  
  <p>This generates something that looks like this in a text file:</p>
  
  <pre><code>"[255   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
     0   0]" "[  0 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171 171
   171 171]" 
  </code></pre>
  
  <p>I would like the information to look like this:</p>
  
  <pre><code>255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 []0 255 255 255 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  </code></pre>
  
  <p>The 2 brackets represents a character that indicates a new row of information.  It's a little rectangle on my text editor and I'm unsure of what the character is.</p>
  
  <p>So, how do I get rid of the quotes and brackets and use this other character?</p>
  
  <p>EDIT:</p>
  
  <p>I tried using the code below and got the following error:</p>
  
  <pre><code>Traceback (most recent call last):   
    File "(stdin)", line 1, in (module)   
    File "backandforth3.py", line 154, in (module)
      out.write(' '.join(frame)) 
  Type Error: sequence item 0: expect string, numpy.int32 found
  </code></pre>