How to do code separation when building python applet

Hello, I'm building a python applet, and currently just put everything in my entry_point file, so the file I defined in runSpec. As it's growing, I need a bit of code separation here, so I have a utils.py next to it. But when I build the applet, the utiils.py is not automatically built as well. I did a bit of learning and it seems in a bash applet, you can add your utils in something like resources/user/bin/. Is there a equivalent of that for python applet? Many thanks!

Comments

1 comment

  • Comment author
    Chai Fungtammasan DNAnexus Team

    Welcome to developer world. :) 

     

    Python and Bash applet are pretty much the same except main for how the main script (code.sh vs code.py in src folder) syntax look like and how it got executed.  

     

    Everything that you put in /resources folder of your applet code would show up on root of worker once that code got built into applet and you run the applet. It's quite conventional for people to put binary in /resources/user/bin, so they can have binary in execution path. For script, it's more conventional to put in /resources/home/dnanexus which will show up on home directory of worker (/home/dnanexus is the home directory of worker). This way, your Python script could find the common utils.py stored in home directory.

    0

Please sign in to leave a comment.