dmibaranov/py_curl
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
About
=====
Python (a)sync modules loader. Based at idea from curl.js
Usage
=====
So, lets try to import anything
$ echo 'def run():\n return 2' > two.py
$ python
>>> from py_curl import curl
>>> curl('two.py')
>>> two.run()
2
Whats about remote file?
$ python
>>> from py_curl import curl
>>> curl('https://raw.github.com/django/django/master/django/utils/tree.py')
>>> tree.Node
<class 'tree.Node'>
And python 3?
$ python3
>>> from py_curl import curl
>>> curl({'my_hello': 'https://raw.github.com/dmibaranov/py_curl/master/hello.py'})
>>> my_hello.hello()
'Hello, World!'
Thanks
======
My kudos to Brett Cannon with `How Import Works` talk at PyCon 2013