On Oct 8, 2011, at 0:39, "Prasad, Ramit" <ramit.pra...@jpmorgan.com> wrote:

>> open(base+OUTFILEEXT,"w").write(str(summary))
> Unless Python3 is different with respect to files, I would really change this 
> to explicitly close the file. In general, I think explicitly closing 
> resources (database connections, files, etc) are a Good Thing.
> 
> with open(base+OUTFILEEXT,"w") as f:
>    f.write(str(summary))
> 
Btw, I do notice lots of suggestions of closing file. 
Does your above sentence close the file here? Implicitly ?
Sorry, I don't see "close" 
And how do I know it's safely closed already?

I will check further later. Now reading email on phone. 

Thanks with best regards,

> 
> 
> Ramit
> 
> 
> Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
> 712 Main Street | Houston, TX 77002
> work phone: 713 - 216 - 5423
> 
> 
> 
> This email is confidential and subject to important disclaimers and
> conditions including on offers for the purchase or sale of
> securities, accuracy and completeness of information, viruses,
> confidentiality, legal privilege, and legal entity disclaimers,
> available at http://www.jpmorgan.com/pages/disclosures/email.  
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to