From 895bca16ca9f65d46dc540290ef57803dd114bd6 Mon Sep 17 00:00:00 2001 From: Avi Dutta Date: Thu, 2 Jan 2020 09:13:45 +0100 Subject: [PATCH] Initial Commit --- .gitignore | 191 +++++++++++++++++++++++++++++++++++++ README.md | 8 ++ front-end/index.html | 25 +++++ front-end/scripts/main.js | 8 ++ front-end/styles/style.css | 0 main.py | 16 ++++ requirements.txt | 5 + 7 files changed, 253 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 front-end/index.html create mode 100644 front-end/scripts/main.js create mode 100644 front-end/styles/style.css create mode 100644 main.py create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3557e5d --- /dev/null +++ b/.gitignore @@ -0,0 +1,191 @@ +/.vscode/ +*.DS_Store + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +*.iml + +local.properties +.gradle +.cxx +/captures +.externalNativeBuild + +*.class +*.war +*.ear +hs_err_pid* + +## GWT +war/ +html/war/gwt_bree/ +html/gwt-unitCache/ +.apt_generated/ +html/war/WEB-INF/deploy/ +html/war/WEB-INF/classes/ +.gwt/ +gwt-unitCache/ +www-test/ +.gwt-tmp/ + +## Android Studio and Intellij and Android in general +android/libs/armeabi/ +android/libs/armeabi-v7a/ +android/libs/x86/ +android/gen/ +.idea/ +*.ipr +*.iws +out/ +com_crashlytics_export_strings.xml + +## Eclipse +.classpath +.project +.metadata +**/bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +.settings/ +.loadpath +.externalToolBuilders/ +*.launch + +## NetBeans +**/nbproject/private/ +nbbuild/ +nbdist/ +nbactions.xml +nb-configuration.xml + +## Gradle + +gradle-app.setting + +/.vs/ +node_modules/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..b65e37a --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# Install + +```pip install -r requirements.txt ``` + +# Run + +```python main.py``` + diff --git a/front-end/index.html b/front-end/index.html new file mode 100644 index 0000000..3a3ade3 --- /dev/null +++ b/front-end/index.html @@ -0,0 +1,25 @@ + + + + + + + + + Hello World! + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/front-end/scripts/main.js b/front-end/scripts/main.js new file mode 100644 index 0000000..feeebf0 --- /dev/null +++ b/front-end/scripts/main.js @@ -0,0 +1,8 @@ +function operate(operator) { + var num1 = document.querySelector('#num-1').value; + var num2 = document.querySelector('#num-2').value; + resultLambda = operator(num1, num2); + resultLambda(result => { + document.querySelector('#output').innerText = result; + }); +} diff --git a/front-end/styles/style.css b/front-end/styles/style.css new file mode 100644 index 0000000..e69de29 diff --git a/main.py b/main.py new file mode 100644 index 0000000..cedf85d --- /dev/null +++ b/main.py @@ -0,0 +1,16 @@ +import eel + +eel.init('front-end') + + +@eel.expose +def add(num1, num2): + return int(num1) + int(num2) + + +@eel.expose +def subtract(num1, num2): + return int(num1) - int(num2) + + +eel.start('index.html', size=(1000, 600)) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e7c13db --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +eel +pyqrcode +pyinstaller +pypng +autopep8