Run multiple scripts in Codebook

Is there a way to run other scripts in Codebook. For example,

with open('Other Code.py', 'r') as file:

code = file.read()


exec(code)


I have six scripts I'd like to run inside of a new script.

Best Answer

  • aramyan.h
    Answer ✓

    Hi @david.suarez0 ,


    Yes, technically you can, however why not importing the functions/classes from those py files into your entry point (.py or ,ipynb) file and leveraging those from it. See an example under __EXAMPLES__/06. Commodities Research/06.02. Grains/. In that folder we have included _intraday_helper.py functions/classes from which are imported and used in Intraday_Trends_For_Grains.ipynb.


    Best regards,

    Haykaz