Skip to content

Instantly share code, notes, and snippets.

@Magnus167
Created June 5, 2022 04:02
Show Gist options
  • Select an option

  • Save Magnus167/0675c857f833be14db3a1c452f8aee06 to your computer and use it in GitHub Desktop.

Select an option

Save Magnus167/0675c857f833be14db3a1c452f8aee06 to your computer and use it in GitHub Desktop.
Import Python Module directly from URL
import urllib.request
a = urllib.request.urlopen(url)
eval(a.read())
# https://stackoverflow.com/a/47341399/4417821 - Xantium, StackOverflow
# ensure that depending url does't import any that may not exist on a system. use this only for simple scripts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment