title: [python]Writing a data file using numbers 1-10
body: <pre><code>dataFile = open("temp1", "w")
  for line in range(11):
      dataFile.write(line)
  dataFile.close()
  </code></pre>
  
  <p>This is what i have so far, but i keep getting a error when i run this code.</p>
  
  <pre><code>Traceback (most recent call last):
        File "datafile print liines.py", line 3, in &lt;module&gt;
          dataFile.write(line)
      TypeError: expected a character buffer object
      &gt;Exit code: 1 
  </code></pre>
  
  <p>I would like this code to write a dataFile using the number 1-10, so i was thinking using a for loop and range would do this, but im not sure how to write it to a file one number per line. </p>
  
  <p>I know python has a 'w' command that creates a opens a file.</p>
  
  <p>Can anyone give me some suggestion on why im getting this error and how i can write this to a datafile?</p>