I am trying to write a python script to generate some code by reading from a file. However it does not work as expected.
Code:
with open('continent.txt') as fp:
for line in fp:
print "text ", line ," here"
Results
$ python ContinentCode.py
text North America
here
text South America
here
text Central America
Desired
text North America here
text South America here
text Central America here