https://github.com/kormanowsky/python_js_function
JavaScript-like functions in Python
https://github.com/kormanowsky/python_js_function
Last synced: over 1 year ago
JSON representation
JavaScript-like functions in Python
- Host: GitHub
- URL: https://github.com/kormanowsky/python_js_function
- Owner: kormanowsky
- Created: 2018-10-11T19:12:27.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-11T19:34:39.000Z (almost 8 years ago)
- Last Synced: 2025-01-28T02:23:40.419Z (over 1 year ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JavaScript-like functions in Python
### Mikhail Kormanowsky
### 2018
## Usage:
from function import Function
def [function_name]([params]):
[code]
fn = Function([function_name])
## Methods:
1. fn([params]) - calls function with params (as usual function)
2. fn.set([new_function_name]) - sets new function
3. fn.call([list]) - calls function with list of params
4. fn.call([dict]) - calls function with dict of params
5. fn.print_output(True|False) - enables/disables print() instead of return
6. fn.apply_to([list]) - calls function for each element of the