rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: bmartino1 on July 07, 2020, 09:48:55 AM

Title: thoughts? python joining the html code side
Post 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
Title: Re: thoughts? python joining the html code side
Post by: rejetto on July 07, 2020, 02:21:11 PM
very cool :)
Title: Re: thoughts? python joining the html code side
Post by: NaitLee on July 08, 2020, 04:07:09 AM
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:
Code: [Select]
{.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).
Title: Re: thoughts? python joining the html code side
Post by: LeoNeeson on July 18, 2020, 07:00:23 AM
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. ;)