0

I have tried to follow the instructions on this node: However, if the file is using the exec command, all I get is this:

/project/cntrl_des_scripts/lior/temp/<string>

<string>

/project/cntrl_des_scripts/lior/temp/<string>

The main script code ran is:

#!/bin/python3.6m
exec( open( "foo/bar.py" ).read() )

The code in foo/bar.py is:

import inspect
from inspect import getsourcefile
from os.path import abspath
print( abspath(getsourcefile(lambda:0)) + "\n" )
print( inspect.getframeinfo(inspect.currentframe()).filename + "\n" )
print( abspath(getsourcefile(lambda:_)) + "\n" )

What I would expect the output to be is:

/project/cntrl_des_scripts/lior/temp/foo/bar.py
Axe319
  • 3,673
  • 2
  • 11
  • 28
user1134991
  • 2,885
  • 2
  • 20
  • 30

0 Answers0