File traversing

Nibin V M nibinvm at gmail.com
Tue Apr 17 10:47:54 EDT 2012


thanks for a super fast reply Chris :)



On Tue, Apr 17, 2012 at 8:06 PM, Chris Angelico <rosuav at gmail.com> wrote:

> On Wed, Apr 18, 2012 at 12:31 AM, Nibin V M <nibinvm at gmail.com> wrote:
> > # python test.py
> >   File "test.py", line 1
> >     with open('/etc/trueuserowners') as res_own_file:
> >     ^
> > IndentationError: unexpected indent
>
> Make sure your first code line is flush left. Since indentation
> indicates block structure (and not scoping, as it does in C-like
> languages), Python refuses to allow it anywhere other than inside
> something that can make use of it. If you're copying and pasting a
> huge lot of code from somewhere and it's all indented a minimum of a
> couple of spaces, the simplest solution may be to add a line at the
> top saying "if True:", thus making your whole program into a massive
> block if, which Python will happily accept.
>
> ChrisA
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Regards....

Nibin.

http://TechsWare.in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120417/dc4a8fde/attachment-0001.html>


More information about the Python-list mailing list