{"id":6587,"date":"2018-01-12T10:59:15","date_gmt":"2018-01-12T15:59:15","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=6587"},"modified":"2018-01-12T10:59:15","modified_gmt":"2018-01-12T15:59:15","slug":"python-modules","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2018\/01\/12\/python-modules\/","title":{"rendered":"Python modules"},"content":{"rendered":"<p>Create an __init__.py file in each directory that will be in the tree of your import.  For example, if you have the following directory structure&#8230;<\/p>\n<pre>\r\n\/opt\/software\/com\/yourcompany\/yourdivision\/yourfile.py\r\n<\/pre>\n<p>&#8230;you would issue the following commands:<\/p>\n<pre>\r\nexport PYTHONPATH=$PYTHONPATH:\/opt\/software\r\ntouch \/opt\/software\/com\/__init__.py\r\ntouch \/opt\/software\/com\/yourcompany\/__init__.py\r\ntouch \/opt\/software\/com\/yourcompany\/yourdivision\/__init__.py\r\n<\/pre>\n<p>You should be able to run the following successfully&#8230;<\/p>\n<pre>\r\npython -c \"import com.yourcompany.yourdivision.yourfile\"\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Create an __init__.py file in each directory that will be in the tree of your import. For example, if you have the following directory structure&#8230; \/opt\/software\/com\/yourcompany\/yourdivision\/yourfile.py &#8230;you would issue the following commands: export PYTHONPATH=$PYTHONPATH:\/opt\/software touch \/opt\/software\/com\/__init__.py touch \/opt\/software\/com\/yourcompany\/__init__.py touch \/opt\/software\/com\/yourcompany\/yourdivision\/__init__.py&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2018\/01\/12\/python-modules\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[24,26],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/6587"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=6587"}],"version-history":[{"count":3,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/6587\/revisions"}],"predecessor-version":[{"id":6591,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/6587\/revisions\/6591"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=6587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=6587"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=6587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}