https://github.com/likianta/airmise
Execute code in client side and get back results to the server app.
https://github.com/likianta/airmise
Last synced: 4 months ago
JSON representation
Execute code in client side and get back results to the server app.
- Host: GitHub
- URL: https://github.com/likianta/airmise
- Owner: likianta
- Created: 2024-08-07T18:07:23.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-27T09:09:54.000Z (6 months ago)
- Last Synced: 2025-03-27T10:24:18.620Z (6 months ago)
- Language: Python
- Size: 2.24 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
Awesome Lists containing this project
README
# Airmise
Expose local runtime namespace to local network. Others who have access to the
network can call the functions, classes, use the variables, import the modules
in the runtime namespace.## How to use
Server side:
```python
import airmise as airaaa = 123
bbb = []def ccc(*args, **kwargs):
print(args, kwargs)
return 'ok'class DDD:
def eee(self):
return 'eee'air.Server().run(host='0.0.0.0', port=2014, user_namespace=globals())
```Client side:
```python
import airmise as airair.connect(, port=2014)
# the host is the server's ip address, for example '192.168.10.123'.
# you need to get it from the server manager.# run code
result = air.run(
'''
print(aaa)
bbb.append(456)
result = ccc(1, 2, 3, a=4, b=5)
ddd = DDD()
print(ddd.eee())
return result
'''
)
print(result) # -> 'ok'# call function
result = air.call('ccc', 1, 2, 3, a=4, b=5)
print(result) # -> 'ok'
```