{ "info": { "author": "Xiangkui Li", "author_email": "1749498702@qq.com", "bugtrack_url": null, "classifiers": [], "description": "# py4js\npy4js is a fast and simple micro-framework for small web applications. Its goal is to enable you to develop\nweb applications in a simple and understandable way. \n\nWith it, you don't need to know the HTTP protocol, or how Python communicates with JavaScript. You can use Python functions in JavaScript just like native JavaScript functions.\n\n## Usage steps\n\n### Step 1\nInstall py4js package: `pip install py4js` or `pip3 install py4js`\n\n### Step 2\nFirst, create a package, named service, and then create a Python file in the package, such as `hello.py`:\n```python\ndef say_hello(name):\n \"\"\"\n say hello test\n\n :param name:\n :return:\n \"\"\"\n return 'Hello %s!' % name\n```\n\n### Step 3\nCreate a Python file that is at the same level as the service package, such as `main.py`:\n```python\nfrom py4js import Server\n\nServer().run()\n```\nThen run it(By default, the server will launch wsgiref server at port `5000`. You can also use other port and wsgi server).\n\n### Step 4\nCreate a HTML file, anywhere, such as `index.html`:\n```html\n\n\n
\n \n