rawpython / remi

Python REMote Interface library. Platform independent. In about 100 Kbytes, perfect for your diet.
Apache License 2.0
3.53k stars 403 forks source link

Is there any document about remi? I cannot find it #488

Closed Matt-wzy closed 2 years ago

Matt-wzy commented 2 years ago

As the tittle said, I cannot find any wiki or document about this great project. And auto-fill function is not operate appropriate in my IDE (visualstudio code), it just cannot identify remi and report

Import "remi" could not be resolvedPylance[reportMissingImports](https://github.com/microsoft/pylance-release/blob/main/DIAGNOSTIC_SEVERITY_RULES.md#diagnostic-severity-rules).

I've installed it by using command pip install remi and python widgets_overview_app.py works fine.

I don't know what's wrong with it. And as the beginner of programmer, I think I do need a document to help my write some code using remi.

dddomodossola commented 2 years ago

Hello @Matt-wzy , unfortunately there is still no documentation about remi. You can look at the examples, the remi source code and of course you can ask me. Additionally, you can use the Editor to design your interface easily.

Kind Redards

Matt-wzy commented 2 years ago

@dddomodossola Thank for your kind reply. I do facing a problem here. I'm dealing with the verification code, which I'll save in a specific location such as '/res/a.png' and then show on web. I want when user( only me exactly) click the image on the web the image refreshes (by saving another verification code image to '/res/a.png').

But according to my search, there are two ways to make web browser refresh image rather than refresh whole web page manually to see the changed image: One is change file name (e.g. from '/res/a.png' to '/res/b.png'), and the other is to change suffix of url (e.g. from '/res/a.png' to '/res/a.png?123', 123 is random). I want to use the second way to make image to refresh, but I don't know how to do it. Simply change image by xxx.set_image("/my_res_folder:a.png?" + randomNumber) don't work because there is no such image in '/res/a.png?123' . I know it won't work because I'm not programed it to do so. But I don't know how to make it happen.

dddomodossola commented 2 years ago

Hello @Matt-wzy , Instead of setting up the filename directly, you can use the load_resource function. It will load the content from file and upload it regardless of the filename:

image = gui.Image(gui.load_resource("./res/mine.png"))

Or

Image.set_image(gui.load_resource("./res/mine.png"))

You can find an example at https://github.com/rawpython/remi/blob/master/examples/resources_app.py

;-)