question

Upvotes
Accepted
3 0 0 1

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.

#technologycodebook
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
7k 18 2 8

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

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.