Write error while trying to save a int into a text fil, how would I fix this?
<p>Alright, I'm trying to save three raw input variables to a text file. Every thing works fine until it gets to appending (I think that's what it's called) the information to the text file. 
It gets down to the 2nd variable on the list, which is age, and then prints this error:</p>

<pre><code>Traceback (most recent call last):
  File "C:\Users\Owner\Desktop\Management CMS\employee-management.py", line 7, in &lt;module&gt;
    fileObj.write(age)
TypeError: expected a character buffer object
</code></pre>

<p>My code is:</p>

<pre><code>name = raw_input("What is your name?")
age = int(raw_input("How old are you?"))
favcolor = raw_input("What is your favorite color?")

fileObj = open("employee.txt","w")
fileObj.write(name)
fileObj.write(age)
fileObj.write(favcolor)
fileObj.close()
print "The following text has been saved:"
print name
print age
print favcolor
</code></pre>
