In a message of Sat, 28 Nov 2015 16:52:07 +0530, "Br. Sayan" writes:
>I am doing the following :
>
>with open('Manwal.txt') as infile, open('Manwal_req.txt','w') as outfile:
>    for line in infile:
>        if line.startswith(('R')):
>            outfile.write(line)
>
>It is executing without error but returns a blank file. Where is the
>problem?

Just try to print the lines, instead of writing them to the file.
If nothing gets printed then your infile name is wrong, or you aren't
running in the directory where that file is, or, the lines don't
really start with R after all.  If things print, then you aren't
creating a new outfile properly, possibly a permissions issue.

Laura


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to