I'm a newbie to Python and after much googling to no avail I wanted to see if I could get some help here. I'm trying to come up with a script to take lines from a textfile and insert them into specific places in another file. Here's a simple example:

I want to take lines from here:
#example.txt
apples
oranges
bananas

and end up with something like this:
#output.txt
Name of fruit: apples
Price: blahblah
Name of fruit: oranges
Price: blahblah
Name of fruit: bananas
Price: blahblah

Can anyone help or point me in the right direction? Thanks in advance!

cplusplus, this is Python forum!
See Python tutorials for lists etc basic things. Experiment boldly interactively from Python command prompt. Build list, write it to file, read back in etc.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.