Re: indentation error

2010-03-06 Thread Tim Roberts
asit wrote: > >According to me, indentation is ok. but the python interpreter gives >an indentation error > >[asit ~/py] $ python search.py > File "search.py", line 7 >findResults = string.split(commandOutput, "\n") > ^ >IndentationError: unind

Re: indentation error

2010-03-05 Thread Steven D'Aprano
On Fri, 05 Mar 2010 00:04:13 -0800, asit wrote: > Consider the following code [snip] > According to me, indentation is ok. but the python interpreter gives an > indentation error You can trust the interpreter. There *is* an indentation error. Most likely you have mixed spaces and tabs. Try: pyt

Re: indentation error

2010-03-05 Thread Ulrich Eckhardt
asit wrote: > pattern = raw_input("Enter the file pattern to search for :\n") > commandString = "find " + pattern > commandOutput = commands.getoutput(commandString) > findResults = string.split(commandOutput, "\n") > print "Files : " > print commandOutput > print "=