I am new to Python and have written a code in notepad++. I have used spaces instead of tab and I guess I have used the correct indentation format. But I still get thie error. I dont understand what am I doing wrong. Here is the code,
#!/usr/bin/python
import sys
import shutil
import sys
def Usage() :
print "LabelFile TranscriptionFile PhonemeFile"
def main(argv = None) :
if len(sys.argv) !=3 :
Usage()
else :
LabelFile = sys.argv[1]
TranscriptionFile = sys.argv[2]
PhonemeFile = sys.argv[3]
if (os.path.exists(LabelFile)) :
InFile = open(LabelFile, "r")
TFile = open(TranscriptionFile, "w")
PFile = open(PhonemeFile, "w")
for line in iter(InFile) :
list = line.split()
Tlist = list.pop(3)
Plist = list[2]
TFile.write(" ".join(list) + "\n")
PFile.write("".join(list) + " ")
InFile.close()
TFile.close()
PFile.close()
if __name__ == "__main__" :
sys.exit(main())
Please help. Thank you very much.
There is an indentation too much in front of
Reduce the indentation for that line and the following eight lines, and you should be all set.