rejetto forum
Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: bmartino1 on July 07, 2020, 09:48:55 AM
-
my thoughts are interested as I will begin a new test with his js and python:
https://medium.com/swlh/sick-of-javascript-just-use-browser-python-4b9679efe08b
Basically someone coded a python runtime in Javascript
brython.js
No installation is required for Brython. Just import the script inside <head> :
<script type=”text/javascript” src=”https://cdn.jsdelivr.net/npm/brython@3.8.9/brython.min.js">
Running Brython
In order for Brython to convert and evaluate the Python code as if it were normal JS, we need to call brython right when the document’s body loads, like so:
<body onload=”brython()”>
Might be a new way to run php
-
very cool :)
-
For running php or sth else, it's maybe a good start to let macro {.exec.} can return stdout outputs :D
Edit: seems this already works:
{.exec|php\php.exe -r "$str='Hello, PHP!'; echo $str;"|out=x.}
{.^x.}
{.exec|python -c "str='Hello, Python!';print(str)"|out=y.}
{.^y.}
So is HFS already able to run php, python, and many more thing? :D (With an error message corrected)
Needs to make {.exec.} more reliable. Such as this (http://rejetto.com/forum/index.php?topic=13315.msg1066253#msg1066253).
-
bmartino1!! Nice to see you posting! :D (I hope you are well).
Reading about it, you can't run any kind of Python code, it must be "adapted" (slightly modified) to make it work. But it's very interesting. Thanks for sharing it, this seems very cool. 8)
For running php or sth else, it's maybe a good start to let macro {.exec.} can return stdout outputs :D
If I'm not mistaken, raybob (https://rejetto.com/forum/index.php?action=profile;u=9522) used {.exec.} macros in his FHFS (https://rejetto.com/forum/index.php?board=45.0). You can find very interesting macros there. ;)