open a file in python

Piet van Oostrum piet at
Mon Jul 27 13:51:34 CEST 2009

>>>>> jayshree <jayshree06comp at> (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>
URL: [PGP 8DAE142BE17999C4]
Private email: piet at

More information about the Python-list mailing list