Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can find thousands of open-source examples e.g. with a <a href="http://www.google.com/codesearch?hl=en&amp;lr=&amp;q=&quot;imp.find_module&quot;+&quot;imp.load_module&quot;&amp;sbtn=Search" rel="nofollow noreferrer">google code search</a>, here it is:</p> <pre><code>http://www.google.com/codesearch?hl=en&amp;lr=&amp;q="imp.find_module"+"imp.load_module"&amp;sbtn=Search </code></pre> <p>Edit: as the questioner clarified he's looking for example of implementation, not use, a better <a href="http://www.google.com/codesearch?hl=en&amp;sa=N&amp;q=&quot;path_hooks&quot;++lang:python&amp;ct=rr&amp;cs_r=lang:python" rel="nofollow noreferrer">URL</a> for the search is:</p> <pre><code>http://www.google.com/codesearch?hl=en&amp;sa=N&amp;q="path_hooks"++lang:python&amp;ct=rr&amp;cs_r=lang:python </code></pre> <p>One readable example (though NOT suitable for production use, as the <a href="http://www.reddit.com/r/programming/comments/8nl4/a_python_script_for_importing_modules_over_the_net" rel="nofollow noreferrer">reddit</a> discussion points out!) is <a href="http://urlimport.codeshift.net/UrlImport" rel="nofollow noreferrer">urlimport</a>.</p> <p>As for supporting Python 2 and Python 3 at the same time, that sounds ambitious -- I don't know of any existing import hook which claims to. In your shoes, I'd start with offering full support for Python 2.6, then once that's working (and has a good battery of tests and makes nary a peep with the <code>-3</code> switch), I'd <code>2to3</code> the sources and see if anything breaks (if so, find out why, fix the 2.6 sources, iterate).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload