-
-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da99427
commit 3dc7e75
Showing
9 changed files
with
87 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ build | |
Eel.egg-info | ||
.tmp | ||
.DS_Store | ||
*.pyc | ||
*.pyc | ||
*.swp | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import eel | ||
|
||
eel.init('web/') # Give folder containing web files | ||
|
||
@eel.expose # Expose this function to Javascript | ||
def say_hello_py(x): | ||
print('Hello from %s' % x) | ||
|
||
say_hello_py('Python World!') | ||
eel.say_hello_js('Python World!') # Call a Javascript function | ||
|
||
eel.start('templates/hello.html', size=(300, 200), templates=True) # Start |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>{% block title %}{% endblock %}</title> | ||
<!-- Include eel.js - note this file doesn't exist in the 'web' directory --> | ||
<script type="text/javascript" src="/eel.js"></script> | ||
<script type="text/javascript"> | ||
{% block head_scripts %}{% endblock %} | ||
</script> | ||
</head> | ||
<body> | ||
{% block content %}{% endblock %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{% extends 'base.html' %} | ||
{% block title %}Hello, World!{% endblock %} | ||
{% block head_scripts %} | ||
eel.expose(say_hello_js); // Expose this function to Python | ||
function say_hello_js(x) { | ||
console.log("Hello from " + x); | ||
} | ||
|
||
eel.expose(js_random); | ||
function js_random() { | ||
return Math.random(); | ||
} | ||
|
||
function print_num(n) { | ||
console.log('Got this from Python: ' + n); | ||
} | ||
|
||
eel.py_random()(print_num); | ||
|
||
say_hello_js("Javascript World!"); | ||
eel.say_hello_py("Javascript World!"); // Call a Python function | ||
{% endblock %} | ||
{% block content %} | ||
Hello, World! | ||
<br /> | ||
<a href="page2.html">Page 2</a> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% extends 'base.html' %} | ||
{% block title %}Hello, World!{% endblock %} | ||
{% block content %} | ||
<h1>This is page 2</h1> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
bottle==0.12.13 | ||
bottle-websocket==0.2.9 | ||
gevent==1.3.6 | ||
gevent-websocket==0.10.1 | ||
greenlet==0.4.15 | ||
pkg-resources==0.0.0 | ||
whichcraft==0.4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
setup( | ||
name='Eel', | ||
version='0.9.12', | ||
version='0.9.13', | ||
author='Chris Knott', | ||
author_email='[email protected]', | ||
packages=['eel'], | ||
|