On Wed, Nov 10, 1999 at 08:46:42AM +0000, Edward Hasted wrote: > I am completely new to Python. > > We want to use it to alter specific lines in template files, typically > something like changing:- > > Variable = 1234 > > to > > Variable = Company Name > > The text manipulation strings within Python seem to work sequentially > rather than on a line basis. > > 1. Is this correct? Well, you have read line by line. Try something like f = open(..., "r") for s in f.readlines(): s = ...do string substitution using 're' or 'string' module... print s But, if you're running Unix, you can also use 'sed'. > 2. What is the best way to do text searching and manipulation within > Python. > > Many thanks, > > Edward > > > -- > http://www.python.org/mailman/listinfo/python-list
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4