len(foo) doesn't work:
(My first shot at python!)
def change_preamble(lines):
for line in lines:
words = string.split(line)
if len(words) 2:
if [ \\oddsidemargin, \\evensidemargin, \\marginparwidth,
On Wed, Jan 08, 2003 at 12:34:51PM +0100, Andre Poenitz wrote:
len(foo) doesn't work:
(My first shot at python!)
def change_preamble(lines):
for line in lines:
words = string.split(line)
if len(words) 2:
if [ \\oddsidemargin,
On Wed, Jan 08, 2003 at 01:52:04PM +0200, Dekel Tsur wrote:
if [ \\oddsidemargin, \\evensidemargin, \\marginparwidth,
\\textwidth, \\topmargin,
\\textheight].count(words[0]) != 0:
len = words[1] + words[2]
On Wed, Jan 08, 2003 at 01:52:04PM +0200, Dekel Tsur wrote:
However, it is probably better to use searchreplace of regular expressions.
def change_preamble(lines):
for i in xrange(0, len(lines)):
words = string.split(lines[i])
if len(words) 2 and
len(foo) doesn't work:
(My first shot at python!)
def change_preamble(lines):
for line in lines:
words = string.split(line)
if len(words) > 2:
if [ "\\oddsidemargin", "\\evensidemargin", "\\marginparwidth",
On Wed, Jan 08, 2003 at 12:34:51PM +0100, Andre Poenitz wrote:
>
> len(foo) doesn't work:
>
> (My first shot at python!)
>
> def change_preamble(lines):
> for line in lines:
> words = string.split(line)
> if len(words) > 2:
> if [
On Wed, Jan 08, 2003 at 01:52:04PM +0200, Dekel Tsur wrote:
> > if [ "\\oddsidemargin", "\\evensidemargin", "\\marginparwidth",
> > "\\textwidth", "\\topmargin",
>"\\textheight"].count(words[0]) != 0:
> > len = words[1] +
On Wed, Jan 08, 2003 at 01:52:04PM +0200, Dekel Tsur wrote:
> However, it is probably better to use search of regular expressions.
def change_preamble(lines):
for i in xrange(0, len(lines)):
words = string.split(lines[i])
if len(words) > 2 and words[0] in