#In this tutorial, we write and append to a file.

#,###Appending to a file.
#,## opening the file
#,employeeFile = open("Employee.txt","a")
#,
#,##Appending to the file, ie, we are adding to the end of the file.
#,employeeFile.write("Tobay - HumanResources")
#,#This adds the above to the end of the file.
#,#If we run the above command again or even the code again, then we will get
#,#Tobay - HumanResourcesTobay - HumanResources and not on a new line.
#,#This can be done as follows
#,
#,##Appending to the file, ie, but  on a new line
#,employeeFile.write("\nKelly - Consumer Service")
#,#The \n (new line character) aadd a new line and then appends the requiite text
#,
#,##Closing the file (Good practise)
#,employeeFile.close()


###Writing to a file.
## opening the file
employeeFile = open("Employee.txt","w")

##Writing to the file
employeeFile.write("Kelly - Consumer Service")
#Note that this erases all the old things int he 
#file and writes the above.

##Closing the file (Good practise)
employeeFile.close()


###Writing to a new file.
## Creating a file
employeeFile = open("Employee1.txt","w")

##Writing to the file
employeeFile.write("Kelly - Consumer Service")
#Note that this erases all the old things int he 
#file and writes the above.

##Closing the file (Good practise)
employeeFile.close()
