Sara Khalatbari wrote:
> Dear friends
> In a code, I'm opening a file to read. Like :
>     lines = open(filename).readlines()
> & I'm never closing it.
> I'm not writing in that file, I just read it.
>
> Will it cause any problems if you open a file to read
> & never close it?

AFAIK, only if you try to have too many files open at one time -- many
appears to be approx 512 on recent Windows (2000 and XP at least).

However it's a very good habit whatever the language to close / delete
/ deallocate / ... any resource as soon as you no longer need it.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to