The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by iri]

Hello!
I had a program running properly in Pythonwin (build 125) (I think it is
that; in fact I have this first version installed in the PC from before I
started this job... so I'n not really sure)
The problem has come when I tried to run that program in another PC in
which I installed the Python-2.2.1c2.exe
Is the following (I attach the part of the program that causes the
problem; I make comments "on line"):

## I read from a postscript file
BUFFER=fi.read(k)

## That file contains different documents separated with the string
"SEP_DOCS"
DOCUMENTS=string.split(BUFFER,SEP_DOCS)

## I want to comment the line starting with /SCS / of the postscript
file I'm working with so I separate DOCUMENTS in two parts, the previous of
that line and the next of that line, that is PROLOGPRE and IN MY OLD VERSION
IT HAD 2 COMPONENTS: PROLOGPRE[0] AND PROLOGPRE[1]
PROLOGPRE=string.split(DOCUMENTS[0],'/SCS /')

## Now I make the join of those parts and the commented line
PROLMODIF=PROLOGPRE[0]+'%/SCS /'+PROLOGPRE[1]

and.......... in the new version..... it appears the following error:

PROLMODIF=PROLOGPRE[0]+'%/SCS /'+PROLOGPRE[1]
IndexError: list index out of range

I watched what was inside PROLOGPRE[0] and was the expected part of
DOCUMENTS[0]. Watched PROLOGPRE[1] and...... it wasn't the rest of
DOCUMENTS[0] (excepting the line of /SCS /)!!!!! ¿¿??

Can the changeing of a version make the old program don't work?
Thank you very much for any help,

Irantzu