read_code function

Read code from text file as string