Reading a string line by line in python

Viewed 23417

I have the following string that is generated using tkinter and then read using textEntry.get():

"
=========New Coffee Order===============
=========Bean Information===============
Type: Ethiopian
Origin: Single

=========Roaster/price==================
Steve's Beans
8.50/lb

Everyday Espresso
10.00/lb

Critical Coffee 
6.00/lb


=========End Coffee Order==============
"

I am trying to use fpdf to generate a pdf file of this information that follows a formatting guide. My question is this:

How can I tell python to read a string in a way that interprets each line and not simply as a list of characters?

My initial idea was to tell python to read this string line by line and assign values to each line. However that seems like it might be inefficient, Is there a better way to do this?

Thank you.

3 Answers
Related