2022-02-25 22:43:37 -06:00
|
|
|
Tools
|
|
|
|
=====
|
|
|
|
|
|
|
|
Remember, always import library first.
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
import easymacro as app
|
|
|
|
|
|
|
|
|
|
|
|
Info from PC
|
|
|
|
------------
|
|
|
|
|
|
|
|
Operate system
|
|
|
|
^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app.msgbox(app.OS)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_01.png
|
|
|
|
|
|
|
|
|
|
|
|
Desktop
|
|
|
|
^^^^^^^
|
|
|
|
|
|
|
|
Name desktop, only GNU/Linux
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app.msgbox(app.DESKTOP)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_02.png
|
|
|
|
|
|
|
|
|
|
|
|
Name PC
|
|
|
|
^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app.msgbox(app.PC)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_03.png
|
|
|
|
|
|
|
|
|
|
|
|
Current user
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app.msgbox(app.USER)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_04.png
|
|
|
|
|
|
|
|
|
|
|
|
Is Windows
|
|
|
|
^^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app.msgbox(app.IS_WIN)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_05.png
|
|
|
|
|
|
|
|
|
|
|
|
Is Mac
|
|
|
|
^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app.msgbox(app.IS_MAC)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_05.png
|
|
|
|
|
|
|
|
|
|
|
|
Info from LibO
|
|
|
|
--------------
|
|
|
|
|
|
|
|
Application name
|
|
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app.msgbox(app.NAME)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_06.png
|
|
|
|
|
|
|
|
|
|
|
|
Version
|
|
|
|
^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app.msgbox(app.VERSION)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_07.png
|
|
|
|
|
|
|
|
|
|
|
|
Language
|
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app.msgbox(app.LANG)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_08.png
|
|
|
|
|
|
|
|
|
|
|
|
Language with variant
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app.msgbox(app.LANGUAGE)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_09.png
|
|
|
|
|
|
|
|
|
|
|
|
Message Box
|
|
|
|
-----------
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app.msgbox('Damed World', 'My Macro')
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_10.png
|
|
|
|
|
|
|
|
|
|
|
|
Show warning box
|
|
|
|
----------------
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
message = 'Caution, this action is dangerous'
|
|
|
|
title = 'My App'
|
|
|
|
app.warning(message, title)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_11.png
|
|
|
|
|
|
|
|
|
|
|
|
Show error box
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
message = 'ERROR: Contact technical support'
|
|
|
|
title = 'My App'
|
|
|
|
app.errorbox(message, title)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_12.png
|
|
|
|
|
|
|
|
|
|
|
|
Make question
|
|
|
|
-------------
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
message = 'Is easy Python?'
|
|
|
|
title = 'My App'
|
|
|
|
result = app.question(message, title)
|
|
|
|
app.msgbox(result)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_13.png
|
|
|
|
|
|
|
|
|
|
|
|
InputBox
|
|
|
|
^^^^^^^^
|
|
|
|
|
|
|
|
* Normal data
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
message = 'Type your name'
|
|
|
|
default = ''
|
|
|
|
title = 'My App'
|
|
|
|
|
|
|
|
result = app.inputbox(message, default, title)
|
|
|
|
app.msgbox(result)
|
|
|
|
|
|
|
|
* Private data
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
message = 'Type your password'
|
|
|
|
default = ''
|
|
|
|
title = 'My App'
|
|
|
|
echochar = "*"
|
|
|
|
|
|
|
|
result = app.inputbox(message, default, title, echochar)
|
|
|
|
app.msgbox(result)
|
|
|
|
|
|
|
|
|
|
|
|
Date and times
|
|
|
|
--------------
|
|
|
|
|
|
|
|
Get today
|
|
|
|
^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
d = app.dates
|
|
|
|
app.msgbox(d.today)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_14.png
|
|
|
|
|
|
|
|
|
|
|
|
Get now
|
|
|
|
^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
d = app.dates
|
|
|
|
app.msgbox(d.now)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_15.png
|
|
|
|
|
|
|
|
|
|
|
|
Get `Unix Time`_
|
|
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
d = app.dates
|
|
|
|
app.msgbox(app.d.epoch)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_16.png
|
|
|
|
|
|
|
|
|
|
|
|
Simple measure time
|
|
|
|
^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
d = app.dates
|
|
|
|
d.start()
|
|
|
|
app.sleep(5)
|
|
|
|
seconds = d.end()
|
|
|
|
app.msgbox(seconds)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_17.png
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_18.png
|
|
|
|
|
|
|
|
|
|
|
|
Make date
|
|
|
|
^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
d = app.dates
|
|
|
|
date = d.date(1974, 1, 15)
|
|
|
|
app.msgbox(date)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_19.png
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
Start date in Python and Calc is diferent.
|
|
|
|
|
|
|
|
|
|
|
|
String to date
|
|
|
|
^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
See `Python strftime cheatsheet <https://strftime.org/>`_
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
d = app.dates
|
|
|
|
str_date = '1974-01-15'
|
|
|
|
template = '%Y-%m-%d'
|
|
|
|
date = d.str_to_date(str_date, template)
|
|
|
|
app.msgbox(type(date))
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_20.png
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For correct date for Calc.
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
d = app.dates
|
|
|
|
str_date = '1974-01-15'
|
|
|
|
template = '%Y-%m-%d'
|
|
|
|
date = d.str_to_date(str_date, template, True)
|
|
|
|
app.msgbox(type(date))
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_21.png
|
|
|
|
|
|
|
|
|
|
|
|
Calc to date
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
|
|
|
Get star date in Calc configuration.
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
d = app.dates
|
|
|
|
cell_value = 1
|
|
|
|
date = d.calc_to_date(cell_value)
|
|
|
|
app.msgbox(date)
|
|
|
|
|
|
|
|
.. image:: _static/images/tools_22.png
|
|
|
|
|
|
|
|
|
|
|
|
Thread
|
2022-02-26 00:11:41 -06:00
|
|
|
------
|
2022-02-25 22:43:37 -06:00
|
|
|
|
|
|
|
You can execute any macro in thread
|
|
|
|
|
2022-02-26 00:11:41 -06:00
|
|
|
Normal execution
|
|
|
|
^^^^^^^^^^^^^^^^
|
2022-02-25 22:43:37 -06:00
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
def show_time(seconds):
|
|
|
|
app.sleep(seconds)
|
|
|
|
app.msgbox(app.NAME)
|
|
|
|
return
|
|
|
|
|
|
|
|
def main(args=None):
|
|
|
|
show_time(5)
|
|
|
|
app.msgbox('Finish...')
|
|
|
|
return
|
|
|
|
|
2022-02-26 00:11:41 -06:00
|
|
|
Run in thread
|
|
|
|
^^^^^^^^^^^^^
|
2022-02-25 22:43:37 -06:00
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
@app.run_in_thread
|
|
|
|
def show_time(seconds):
|
|
|
|
app.sleep(seconds)
|
|
|
|
app.msgbox(app.NAME)
|
|
|
|
return
|
|
|
|
|
|
|
|
def main(args=None):
|
|
|
|
show_time(5)
|
|
|
|
app.msgbox('Finish...')
|
|
|
|
return
|
|
|
|
|
|
|
|
|
2022-02-26 00:11:41 -06:00
|
|
|
Dictionary to/from Properties
|
|
|
|
-----------------------------
|
2022-02-25 22:43:37 -06:00
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
args = {
|
|
|
|
'Hidden': True,
|
|
|
|
'Password': 'letmein',
|
|
|
|
}
|
|
|
|
properties = app.dict_to_property(args)
|
|
|
|
|
|
|
|
app.msgbox(properties)
|
|
|
|
|
|
|
|
data = app.data_to_dict(properties)
|
|
|
|
|
|
|
|
app.msgbox(data)
|
|
|
|
|
|
|
|
|
|
|
|
Tuples or lists to dictionary
|
2022-02-26 00:11:41 -06:00
|
|
|
-----------------------------
|
2022-02-25 22:43:37 -06:00
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
tuple_of_tuples = (
|
|
|
|
('Hidden', True),
|
|
|
|
('Password', 'letmein'),
|
|
|
|
)
|
|
|
|
data = app.data_to_dict(tuple_of_tuples)
|
|
|
|
app.msgbox(data)
|
|
|
|
|
|
|
|
list_of_lists = [
|
|
|
|
['Hidden', True],
|
|
|
|
['Password', 'letmein'],
|
|
|
|
]
|
|
|
|
data = app.data_to_dict(list_of_lists)
|
|
|
|
app.msgbox(data)
|
|
|
|
|
|
|
|
|
|
|
|
Json
|
2022-02-26 00:11:41 -06:00
|
|
|
----
|
|
|
|
|
|
|
|
Dumps data
|
|
|
|
^^^^^^^^^^
|
2022-02-25 22:43:37 -06:00
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
data = {
|
|
|
|
'Hidden': True,
|
|
|
|
'Password': 'letmein',
|
|
|
|
}
|
|
|
|
|
2022-02-26 00:11:41 -06:00
|
|
|
json = app.json.dumps(data)
|
2022-02-25 22:43:37 -06:00
|
|
|
|
|
|
|
app.msgbox(json)
|
|
|
|
|
2022-02-26 00:11:41 -06:00
|
|
|
|
|
|
|
Loads data
|
|
|
|
^^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
data = app.json.loads(json)
|
2022-02-25 22:43:37 -06:00
|
|
|
|
|
|
|
app.msgbox(data)
|
|
|
|
|
|
|
|
|
|
|
|
Call Macros
|
2022-02-26 00:11:41 -06:00
|
|
|
-----------
|
2022-02-25 22:43:37 -06:00
|
|
|
|
2022-02-26 00:11:41 -06:00
|
|
|
You can execute any macro, for default call macros Python.
|
2022-02-25 22:43:37 -06:00
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
def show_message():
|
|
|
|
app.msgbox(app.INFO_DEBUG)
|
|
|
|
return
|
|
|
|
|
|
|
|
def main(args=None):
|
|
|
|
args = {
|
|
|
|
'library': 'test',
|
|
|
|
'name': 'show_message',
|
|
|
|
}
|
|
|
|
app.call_macro(args)
|
|
|
|
return
|
|
|
|
|
|
|
|
Of course is better call directly if both macros are the same languaje, but, you can call macro in Basic too.
|
|
|
|
|
|
|
|
.. code-block:: vbnet
|
|
|
|
|
|
|
|
Sub show_message()
|
|
|
|
MsgBox "Basic from Python"
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
Call from Python with.
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
args = {
|
|
|
|
'language': 'Basic',
|
|
|
|
'library': 'Standard',
|
|
|
|
'module': 'Module1',
|
|
|
|
'name': 'show_message',
|
|
|
|
}
|
|
|
|
app.call_macro(args)
|
|
|
|
|
|
|
|
Execute macro in other thread
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app.call_macro(args, True)
|
|
|
|
|
|
|
|
|
|
|
|
Call external program
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
app_name = 'gnome-calculator'
|
|
|
|
app.run(app_name)
|
|
|
|
app.msgbox('ok')
|
|
|
|
|
|
|
|
Call command line and capture output
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
args = 'ls -lh ~'
|
|
|
|
result = app.run(args, True)
|
|
|
|
app.debug(result)
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
21/06/2021 22:27:22 - DEBUG - total 1.3M
|
|
|
|
drwxr-xr-x 5 mau mau 4.0K Jun 17 13:09 Desktop
|
|
|
|
drwxr-xr-x 6 mau mau 4.0K Jun 15 12:35 Documents
|
|
|
|
drwxr-xr-x 2 mau mau 4.0K Jun 21 20:26 Downloads
|
|
|
|
drwxr-xr-x 2 mau mau 4.0K Jun 21 16:18 Pictures
|
|
|
|
drwxr-xr-x 13 mau mau 4.0K Jun 21 15:34 Projects
|
|
|
|
drwxr-xr-x 2 mau mau 4.0K May 11 18:48 Templates
|
|
|
|
drwxr-xr-x 2 mau mau 4.0K Jun 20 23:27 Videos
|
|
|
|
|
|
|
|
Call command line and capture output line by line.
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
args = 'ls -lh /home/mau'
|
|
|
|
for line in app.popen(args):
|
|
|
|
app.debug(line)
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
21/06/2021 22:34:42 - DEBUG - total 1.3M
|
|
|
|
21/06/2021 22:34:42 - DEBUG - drwxr-xr-x 5 mau mau 4.0K Jun 17 13:09 Desktop
|
|
|
|
21/06/2021 22:34:42 - DEBUG - drwxr-xr-x 6 mau mau 4.0K Jun 15 12:35 Documents
|
|
|
|
21/06/2021 22:34:42 - DEBUG - drwxr-xr-x 2 mau mau 4.0K Jun 21 20:26 Downloads
|
|
|
|
21/06/2021 22:34:42 - DEBUG - -rw-r----- 1 mau mau 1.3M Jun 14 11:53 out.png
|
|
|
|
21/06/2021 22:34:42 - DEBUG - drwxr-xr-x 2 mau mau 4.0K Jun 21 16:18 Pictures
|
|
|
|
21/06/2021 22:34:42 - DEBUG - drwxr-xr-x 13 mau mau 4.0K Jun 21 15:34 Projects
|
|
|
|
21/06/2021 22:34:42 - DEBUG - drwxr-xr-x 2 mau mau 4.0K May 11 18:48 Templates
|
|
|
|
21/06/2021 22:34:42 - DEBUG - drwxr-xr-x 2 mau mau 4.0K Jun 20 23:27 Videos
|
|
|
|
|
|
|
|
|
|
|
|
Timer
|
|
|
|
^^^^^
|
|
|
|
|
|
|
|
Execute any macro every seconds.
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
TIMER_NAME = 'clock'
|
|
|
|
|
|
|
|
def show_time():
|
|
|
|
app.debug(app.now(True))
|
|
|
|
return
|
|
|
|
|
|
|
|
def start_clock():
|
|
|
|
seconds = 1
|
|
|
|
macro = {
|
|
|
|
'library': 'test',
|
|
|
|
'name': 'show_time',
|
|
|
|
}
|
|
|
|
app.start_timer(TIMER_NAME, seconds, macro)
|
|
|
|
return
|
|
|
|
|
|
|
|
def stop_clock():
|
|
|
|
app.stop_timer(TIMER_NAME)
|
|
|
|
return
|
|
|
|
|
|
|
|
def main(args=None):
|
|
|
|
start_clock()
|
|
|
|
return
|
|
|
|
|
|
|
|
Execute `stop_clock` for stop timer.
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
21/06/2021 22:43:17 - INFO - Timer started... show_time
|
|
|
|
21/06/2021 22:43:18 - DEBUG - 22:43:18.080315
|
|
|
|
21/06/2021 22:43:19 - DEBUG - 22:43:19.082211
|
|
|
|
...
|
|
|
|
21/06/2021 22:43:46 - DEBUG - 22:43:46.126446
|
|
|
|
21/06/2021 22:43:47 - DEBUG - 22:43:47.128487
|
|
|
|
21/06/2021 22:43:47 - INFO - Timer stopped... show_time
|
|
|
|
|
|
|
|
|
|
|
|
Get digest
|
|
|
|
^^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
data = 'LibreOffice with Python'
|
|
|
|
|
|
|
|
digest = app.sha256(data)
|
|
|
|
app.msgbox(digest)
|
|
|
|
|
|
|
|
digest = app.sha512(data)
|
|
|
|
app.msgbox(digest)
|
|
|
|
|
|
|
|
|
|
|
|
Save and get configurations
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
You can save any data.
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
my_app = 'my_extension'
|
|
|
|
data = {
|
|
|
|
'path': '/home/mau/work',
|
|
|
|
'save_data': True,
|
|
|
|
}
|
|
|
|
|
|
|
|
app.set_config('config', data, my_app)
|
|
|
|
|
|
|
|
app.msgbox('Save config')
|
|
|
|
|
|
|
|
data = app.get_config('config', my_app)
|
|
|
|
|
|
|
|
app.msgbox(data)
|
|
|
|
|
|
|
|
|
|
|
|
Render string
|
|
|
|
^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
template = """Hello $name
|
|
|
|
|
|
|
|
I send you this $file_name
|
|
|
|
|
|
|
|
Best regards
|
|
|
|
"""
|
|
|
|
|
|
|
|
data = {'name': 'Ingrid Bergman', 'file_name': 'letter_love.odt'}
|
|
|
|
|
|
|
|
render = app.render(template, data)
|
|
|
|
|
|
|
|
app.msgbox(render)
|
|
|
|
|
|
|
|
|
|
|
|
Encrypt decrypt
|
|
|
|
^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
You need install library `cryptography`_
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
import easymacro as app
|
|
|
|
from conf import PASSWORD
|
|
|
|
|
|
|
|
def encrypt_decrypt():
|
|
|
|
|
|
|
|
data = 'My super secret data'
|
|
|
|
token = app.encrypt(data, PASSWORD)
|
|
|
|
app.msgbox(token)
|
|
|
|
|
|
|
|
data = app.decrypt(token, PASSWORD)
|
|
|
|
app.msgbox(data)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
Simple url open
|
|
|
|
^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
* Get text data
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
url = 'https://api.ipify.org'
|
|
|
|
data = app.url_open(url)
|
|
|
|
app.msgbox(data)
|
|
|
|
|
|
|
|
* Get json data
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
url = 'https://api.ipify.org?format=json'
|
|
|
|
data = app.url_open(url, get_json=True)
|
|
|
|
app.msgbox(data)
|
|
|
|
|
|
|
|
For more complex case, you can used `requests`_ or `httpx`_
|
|
|
|
|
|
|
|
|
|
|
|
Color
|
|
|
|
^^^^^
|
|
|
|
|
|
|
|
Look colors that you can used in `web colors`_
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
color_name = 'darkblue'
|
|
|
|
color = app.get_color(color_name)
|
|
|
|
app.msgbox(color)
|
|
|
|
|
|
|
|
color_rgb = (125, 200, 10)
|
|
|
|
color = app.get_color(color_rgb)
|
|
|
|
app.msgbox(color)
|
|
|
|
|
|
|
|
color_html = '#008080'
|
|
|
|
color = app.get_color(color_html)
|
|
|
|
app.msgbox(color)
|
|
|
|
|
|
|
|
|
|
|
|
.. _Unix Time: https://en.wikipedia.org/wiki/Unix_time
|
|
|
|
.. _cryptography: https://github.com/pyca/cryptography
|
|
|
|
.. _requests: https://docs.python-requests.org
|
|
|
|
.. _httpx: https://www.python-httpx.org/
|
|
|
|
.. _web colors: https://en.wikipedia.org/wiki/Web_colors
|