execfile python3k

O

Odys

Hi there,

Since execfile() is removed in Python 3.0
I have question about using exec.

I know about
exec(open('filename').read())
but from documentation the 1st arg of exec can be 'file object'.
However
exec(open('filename'))
does not work.
Does anybody have idea how to construct 'file object' then?

Thanks,
 
C

Christian Heimes

Odys said:
Hi there,

Since execfile() is removed in Python 3.0
I have question about using exec.

I know about
exec(open('filename').read())
but from documentation the 1st arg of exec can be 'file object'.
However
exec(open('filename'))
does not work.
Does anybody have idea how to construct 'file object' then?

It's a know bug in Python 3.0.

Christian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top