So for creating files I use the following:
fileHandle = open(\'fileName\', \'w\')
then write the contents to the file, close the file. In t
If you mean writing to memory instead of a file, you can simply write the text to a buffer and use the following function:
def write(text):
global buffer
buffer += text + '\n' # Add a linefeed as you would if you were writing to a file
buffer = "" # Initialize the buffer
write("My name is Steve Grafton")
At the end, you will have a buffer that will be the same as if you had written your stuff to a file and then open the file and read all its contents to a buffer! Moreover, you can use the buffer during the process (before having finished your writing) and do searches in it, as if you had created a file for both reading and writing, only that in this case your pointer will