open a file in python

Piet van Oostrum piet at cs.uu.nl
Mon Jul 27 07:51:34 EDT 2009


>>>>> jayshree <jayshree06comp at gmail.com> (j) wrote:

>j> pk = open('/home/jayshree/my_key.public.pem' , 'rb').read()

By the way, a PEM file is a text file, no reason to open it in binary
mode. Just replace the 'rb' with 'r' or leave it out.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org



More information about the Python-list mailing list