Share code between notebooks + recepies

q666
q666 Registered Posts: 11 ✭✭✭✭

Hi

When i'm using notebooks i have a habit to save some of the scripts via %%writefile utils.py, is it possible to get to the saved scripts from the recipes ? a simple import utils will not see the defined script :(

It would definitely help if we could share the code in a easy way.

Tagged:

Answers

  • kenjil
    kenjil Dataiker, Alpha Tester, Product Ideas Manager Posts: 19 Dataiker

    If you are using magics %%writefile my_file.py in a notebook beware of the location where you are writing that file.

    In order to load that file as module in a recipe, the file you have written should

    • either be in your python path
    • or you should add the directory where it has been written to your python path.

    You can find your python path with


    import sys
    for d in sys.path:
    print d
Setup Info
    Tags
      Help me…