0

Is it possible to import from a remote directory? What if this directory is online?

The use case I'm thinking of is to have a single pure python "utilities.py" file hosted on a remote server, and to use it in different python environments without needing to download or install it.

Something in the lines of:

from https://remotegit.com/user/utilities import tool

Or even something like..

import remotegrabber
tool = remotegrabber.from("https://remotegit.com/user/utilities").import("tool")

If this is possible, what would I have to do to enable it? And if it's not possible, what is the recommended alternative when dealing with my use case?

Daniel
  • 11,332
  • 9
  • 44
  • 72
  • I'd suggest [Virtual Environment](http://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/) – Yevhen Kuzmovych May 22 '17 at 18:44
  • https://nvbn.github.io/2016/01/04/import-from-github/ looks like it might allow you to do this from Github; it might be possible to adapt that for other things. I wouldn't advise ever doing it, I admit. :) – bouteillebleu May 22 '17 at 18:44

0 Answers0