You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remi enables developers to create platform independent GUI with Python. The entire GUI is converted to HTML and is rendered in your browser. **No HTML** is required, Remi automatically translates your Python code into HTML. When your app starts, it starts a webserver that will be accessible on your network.
72
+
Remi enables developers to create platform independent GUI with Python. The entire GUI is converted to HTML and is rendered in your browser. **No HTML** is required, Remi automatically translates your Python code into HTML. When your app starts, it starts a web server that will be accessible on your network.
73
73
74
74
A basic application appears like this:
75
75
@@ -101,32 +101,32 @@ class MyApp(App):
101
101
self.lbl.set_text('Button pressed!')
102
102
self.bt.set_text('Hi!')
103
103
104
-
# starts the webserver
104
+
# starts the web server
105
105
start(MyApp)
106
106
```
107
107
108
108
In order to see the user interface, open your preferred browser and type "http://127.0.0.1:8081".
109
-
You can change the url address by specific **kwargs at `start` function call. This will be discussed later.
109
+
You can change the URL address by specific **kwargs at `start` function call. This will be discussed later.
110
110
111
111
Tested on Android, Linux, Windows.
112
-
Useful on Raspberry Pi for Python script development. It allows to interact with your Raspberry Pi remotely from your mobile device.
112
+
Useful on Raspberry Pi for Python script development. It allows interacting with your Raspberry Pi remotely from your mobile device.
113
113
114
114
115
115
FAQ
116
116
===
117
117
-**Why another GUI lib?**
118
-
Kivy, PyQT and PyGObject all require native code for the host operating system, which means installing or compiling large dependencies. Remi needs only a web browser to show your GUI.
118
+
Kivy, PyQT, and PyGObject all require native code for the host operating system, which means installing or compiling large dependencies. Remi needs only a web browser to show your GUI.
119
119
120
120
-**Do I need to know HTML?**
121
121
NO, It is not required, you have to code only in Python.
122
122
123
123
-**Which browsers can I use this with?**
124
-
Tested on Chrome Firefox and Edge (on Windows, Linux and Android) and haven't tested it elsewhere. It will probably work fine elsewhere though!
124
+
Tested on Chrome Firefox and Edge (on Windows, Linux, and Android) and haven't tested it elsewhere. It will probably work fine elsewhere though!
125
125
126
126
-**Is it open source?**
127
127
For sure! Remi is released under the Apache License. See the ``LICENSE`` file for more details.
128
128
129
-
-**Do I need some kind of webserver?**
129
+
-**Do I need some kind of web server?**
130
130
No, it's included.
131
131
132
132
@@ -143,24 +143,24 @@ Subclass the `App` class and declare a `main` function that will be the entry po
Outside the main class start the application calling the function `start` passing as parameter the name of the class you declared previously.
157
157
158
158
```py
159
-
#starts the webserver
159
+
#starts the webserver
160
160
start( MyApp )
161
161
```
162
162
163
-
Run the script. If all it's OK the gui will be opened automatically in your browser, otherwise you have to type in the address bar "http://127.0.0.1:8081".
163
+
Run the script. If all it's OK the GUI will be opened automatically in your browser, otherwise, you have to type in the address bar "http://127.0.0.1:8081".
164
164
165
165
You can customize optional parameters in the `start` call like.
- multiple_instance: boolean, if True multiple clients that connects to your script has different App instances (identified by unique cookie session identifier)
174
+
- multiple_instance: boolean, if True multiple clients that connect to your script has different App instances (identified by unique cookie session identifier)
175
175
- enable_file_cache: boolean, if True enable resource caching
176
-
- update_interval: gui update interval in seconds. If zero, the update happens at each change. If zero, the App.idle method is not called.
176
+
- update_interval: GUI update interval in seconds. If zero, the update happens at each change. If zero, the App.idle method is not called.
177
177
- start_browser: boolean that defines if the browser should be opened automatically at startup
178
-
- standalone: boolean, indicates where to run the application as standard Desktop application with its own window. If False, the interface is shown in a browser webpage.
178
+
- standalone: boolean, indicates where to run the application as a standard Desktop application with its own window. If False, the interface is shown in a browser webpage.
179
179
180
180
Additional Parameters:
181
-
- username: for a basic http authentication
182
-
- password: for a basic http authentication
183
-
- certfile: ssl certificate filename
184
-
- keyfile: ssl key file
185
-
- ssl_version: authentication version (i.e. ssl.PROTOCOL_TLSv1_2). If None, disables ssl encription
181
+
- username: for a basic HTTP authentication
182
+
- password: for a basic HTTP authentication
183
+
- certfile: SSL certificate filename
184
+
- keyfile: SSL key file
185
+
- ssl_version: authentication version (i.e. ssl.PROTOCOL_TLSv1_2). If None disables SSL encryption
186
186
187
-
All widgets constructors accepts two standard **kwargs that are:
188
-
- width: can be expressed as int (and is interpreted as pixel) or as str (and you can specify the measure unit like '10%')
189
-
- height: can be expressed as int (and is interpreted as pixel) or as str (and you can specify the measure unit like '10%')
187
+
All widgets constructors accept two standards**kwargs that are:
188
+
- width: can be expressed as int (and is interpreted as a pixel) or as str (and you can specify the measuring unit like '10%')
189
+
- height: can be expressed as int (and is interpreted as a pixel) or as str (and you can specify the measuring unit like '10%')
190
190
191
191
192
192
Events and callbacks
193
193
===
194
-
Widgets exposes a set of events that happens during user interaction.
194
+
Widgets expose a set of events that happen during user interaction.
195
195
Such events are a convenient way to define the application behavior.
196
196
Each widget has its own callbacks, depending on the type of user interaction it allows.
197
197
The specific callbacks for the widgets will be illustrated later.
@@ -227,7 +227,7 @@ class MyApp(App):
227
227
self.lbl.set_text('Button pressed!')
228
228
self.bt.set_text('Hi!')
229
229
230
-
# starts the webserver
230
+
# starts the web server
231
231
start(MyApp)
232
232
```
233
233
@@ -237,7 +237,7 @@ Simple, easy.
237
237
Listener's callbacks will receive the emitter's instance firstly, then all other parameters provided by the specific event.
238
238
239
239
240
-
Beside the standard event registration (as aforementioned), it is possible to pass user parameters to listener functions. This can be achieves appending parameters to the *connect* function call.
240
+
Besides the standard event registration (as aforementioned), it is possible to pass user parameters to listener functions. This can be achieves appending parameters to the *connect* function call.
241
241
242
242
```py
243
243
import remi.gui as gui
@@ -270,26 +270,26 @@ class MyApp(App):
270
270
self.lbl.set_text('Button pressed!')
271
271
widget.set_text('Hello '+ name +''+ surname)
272
272
273
-
# starts the webserver
273
+
# starts the web server
274
274
start(MyApp)
275
275
```
276
276
277
-
This allows great flexibility, getting different behaviours with the same event listener definition.
277
+
This allows great flexibility, getting different behaviors with the same event listener definition.
278
278
279
279
280
280
HTML Attribute accessibility
281
281
===
282
-
Sometimes could be required to access Widget's HTML representation in order to manipulate html attributes.
283
-
The library allows to access these information easily.
282
+
Sometimes could be required to access Widget's HTML representation in order to manipulate HTML attributes.
283
+
The library allows accessing this information easily.
284
284
285
-
A simple example: It is the case where you would like to add an hover text to a widget. This can be achieved by the *title* attribute of an html tag.
285
+
A simple example: It is the case where you would like to add a hover text to a widget. This can be achieved by the *title* attribute of an HTML tag.
286
286
In order to do this:
287
287
288
288
```py
289
289
widget_instance.attributes['title'] ='Your title content'
290
290
```
291
291
292
-
A special case of html attribute is the *style*.
292
+
A special case of HTML attribute is the *style*.
293
293
The style attributes can be altered in this way:
294
294
295
295
```py
@@ -298,9 +298,9 @@ The style attributes can be altered in this way:
298
298
299
299
The assignment of a new attribute automatically creates it.
300
300
301
-
For a reference list of html attributes you can refer to https://www.w3schools.com/tags/ref_attributes.asp
301
+
For a reference list of HTML attributes, you can refer to https://www.w3schools.com/tags/ref_attributes.asp
302
302
303
-
For a reference list of style attributes you can refer to https://www.w3schools.com/cssref/default.asp
303
+
For a reference list of style attributes, you can refer to https://www.w3schools.com/cssref/default.asp
304
304
305
305
Take care about internally used attributes. These are:
306
306
-**class**: It is used to store the Widget class name for styling purpose
@@ -310,7 +310,7 @@ Take care about internally used attributes. These are:
310
310
Remote access
311
311
===
312
312
If you are using your REMI app remotely, with a DNS and behind a firewall, you can specify special parameters in the `start` call:
313
-
-**port**: http server port. Don't forget to NAT this port on your router;
313
+
-**port**: HTTP server port. Don't forget to NAT this port on your router;
I suggest to use the browser as standard interface window.
322
+
I suggest using the browser as a standard interface window.
323
323
324
324
However, you can avoid using the browser.
325
325
This can be simply obtained joining REMI and [PyWebView](https://github.com/r0x0r/pywebview).
326
326
Here is an example about this [standalone_app.py](https://github.com/dddomodossola/remi/blob/development/examples/standalone_app.py).
327
327
328
-
**Be aware that PyWebView uses qt, gtk and so on to create the window. An outdated version of these libraries can cause ui problems. If you experience ui issues, update these libraries, or better avoid standalone execution.**
328
+
**Be aware that PyWebView uses qt, gtk and so on to create the window. An outdated version of these libraries can cause UI problems. If you experience UI issues, update these libraries, or better avoid standalone execution.**
329
329
330
330
331
331
Authentication
332
332
===
333
-
In order to limit the remote access to your interface you can define a username and password. It consists in a simple authentication process.
333
+
In order to limit the remote access to your interface, you can define a username and password. It consists of a simple authentication process.
334
334
Just define the parameters **username** and **password** in the start call:
In order to define a new style for your app you have to do the following.
342
+
In order to define a new style for your app, you have to do the following.
343
343
Create a *res* folder and pass it to your App class constructor:
344
344
```python
345
345
classMyApp(App):
@@ -354,12 +354,12 @@ This way the standard *style.css* file gets overridden by the one you created.
354
354
355
355
Compatibility
356
356
===
357
-
Remi is made to be compatible from Python2.7 to Python3.X. Please notify compatibility issues.
357
+
Remi is made to be compatible from Python2.7 to Python3.X. Please notify compatibility issues.
358
358
359
359
360
360
Security
361
361
===
362
-
Remi should be intended as a standard desktop gui framework.
362
+
Remi should be intended as a standard desktop GUI framework.
363
363
The library itself doesn't implement security strategies, and so it is advised to not expose its access to unsafe public networks.
364
364
365
365
When loading data from external sources, consider protecting the application from potential javascript injection before displaying the content directly.
@@ -374,14 +374,15 @@ That's a brilliant way to support this project.
0 commit comments