Reading data from 2 different files and writing to a single file

Chris Angelico rosuav at gmail.com
Mon Jan 28 08:43:14 EST 2013


On Tue, Jan 29, 2013 at 12:31 AM, inshu chauhan <insideshoes at gmail.com> wrote:
> I think my code is not so correct , as I am not getting desired results...

Firstly, what results are you getting, and what are you desiring? It
helps to be clear with that.

> import cv

What module is this? Do you need it? Does it affect things? It's not a
Python standard library module, as far as I know.

> for l in f1:
>     else:
>         print ix, iy
>        for s in f2:

This will bomb immediately with an IndentationError. I can't be sure
whether you intended for the loops to be nested or not. One of the
consequences of Python's use of indentation to define blocks is that
you have to be really careful when you copy and paste. (Which bit me
somewhat this weekend; I tried to share some Python code via a
spreadsheet, and it mangled the leading whitespace. Very tiresome.)
Can you try pasting in your actual code, please?

Chris Angelico



More information about the Python-list mailing list