sciter-sdk / pysciter

Python bindings for Sciter
https://sciter.com
MIT License
396 stars 40 forks source link

pysciter specific documentation? #45

Closed MrSassyBritches closed 3 years ago

MrSassyBritches commented 3 years ago

Hello! I am having trouble finding documentation for Pysciter. Is there Py-specific documentation or does the Sciter (C++) docs apply for Pysciter? I have been struggling to make a UI that updates with real time data from python. My python code reads serial data (list of floats), and I can statically plot in ANY framework, but how would one pass that data continuously to a JavaScript front end using Pysciter?

I have looked at the examples and got a little bit of an idea of how Pysciter works in general. But I would love to know/see how something like these examples could be implemented using python.

image

This one is particularly pretty! Just a big continuous graph, exactly what I need to create. :D image

So, any examples or docs or blog posts that you think would point me in the right direction would be very much appreciated!

pravic commented 3 years ago

Hey.

First, most of C++ API applies to pysciter as well. There are some python-specific bits, however.

I believe, almost all pysciter API is covered by documentation which can be viewed with something like pydoc or alternatives.

I've seen some online websites with auto generated documentation for pypi packages (including pysciter), but right now I can't find any.

pravic commented 3 years ago

but how would one pass that data continuously to a JavaScript front end using Pysciter?

Well, there are some ways. The most obvious is calling from Python a JavaScript/TiScript function with some data provided, and that script function would update the UI - aka a "push" method. Another way is to "pull" new data from Python side by calling a Python function from JS/TS.

You can use a chart library for drawing.

Also, on http://sciter.com/forums the author of Sciter provides more detailed and architecture related answers.

MrSassyBritches commented 3 years ago

wonderful! that answers my question, thanks so much! :)