Execute commands from file

i3dmaster i3dmaster at gmail.com
Thu May 17 16:12:10 EDT 2007


On May 17, 3:02 am, Douglas Woodrow <newsgro... at nospam.demon.co.uk>
wrote:
> On Thu, 17 May 2007 00:30:23, i3dmaster <i3dmas... at gmail.com> wrote
>
> >f = open(file,'rb')
> >for i in f:
> >        exec i
>
> Why are you opening the file in binary mode?
>
> --
> Doug Woodrow

'b' is generally useful on systems that don't treat binary and text
files differently. It will improve portability.




More information about the Python-list mailing list