i think you might have downloaded the zip. next, you have to build from source with nodejs.
use nvm to install nodejs, then run “nvm install 16; nvm use 16”
cd into the dir with the “package.json” file and run “npm install”
then run “npm run dev”
Got it working, thanks
are these warnings normal?
i didnt get below message but got the server running fine
Your application is ready~! 🚀 - Local: http://localhost:8080 - Network: Add `--host` to expose
also does it really run fully in the browser through webassembly? or is there any backend processing in the nodejs server?
pyscript does not use backend processing in nodejs or any other backend tech. once you build from source you can host in aws s3 or netlify or any other static content hosting system
The latest LTS version didn’t work. google suggested using 16.13.2 as it used older version of npm. That managed to get past ‘npm install’, however the next command ‘npm run dev’ introduced a new error:
(thank you for earlier reply)
let me look into this.
can you make an issue over at Issues · pyscript/pyscript · GitHub ?
I wrote a simple example but I’m not able to make it work.
I’d really appreciate some help, thank you!
To get JS variables into Python
We have to import the variable it self
<py-script> from js import js_string <!-- Should import the variable --> console.log(js_string) </py-script>
Thank you that worked, how can I get Python variables into JS?
Pretty much here is explained:
Until pyscript documentation is published read this for now:
Reading through this forum a lot of people seem to be misunderstanding the limitations of PyScript. Trying to use libraries that require access to system sockets, calls, or start processes.
While education is going to always be challenging with a library like this I wonder if it would make sense to highlight some common limitations on the front of the site itself? Like instead of using
pyfetch (or whatever library ends up being standardized, and a link to some documentation), and examples of things which can’t be done such as scanning user processes, or launching a new process, or connecting directly to sockets, etc…
the million dollar question.
on pyscript.net it claims:
I Love this!!! Can’t wait to start using it and contributing!
How to decrease runtime process in pyscript?
I’m trying to connect to pinotdb using connect(host=url,port=80, path=query/sql, scheme=‘http’)
but it gives error.
Is there any possible way to connect to remote databases?
pintodb relies on
requests which can not be run in PyScript as it relies on access to OS APIs / sockets and you can not do that in a web browser.
Maybe some day in the future someone will develop a drop in replacement to requests and you can monkey patch libraries like this, but for now the only way to connect to external APIs is to use something like
pyfetch and code the logic of the interaction yourself.