138 lines
1.8 KiB
ReStructuredText
138 lines
1.8 KiB
ReStructuredText
|
|
1.2) Tools
|
|
^^^^^^^^^^
|
|
|
|
Remember, always import library.
|
|
|
|
.. code-block:: python
|
|
|
|
import easymacro as app
|
|
|
|
|
|
**Info from PC**
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
* Operate system
|
|
|
|
.. code-block:: python
|
|
|
|
app.msgbox(app.OS)
|
|
|
|
* Current user
|
|
|
|
.. code-block:: python
|
|
|
|
app.msgbox(app.USER)
|
|
|
|
* Name PC
|
|
|
|
.. code-block:: python
|
|
|
|
app.msgbox(app.PC)
|
|
|
|
* Name desktop, only GNU/Linux
|
|
|
|
.. code-block:: python
|
|
|
|
app.msgbox(app.DESKTOP)
|
|
|
|
* Language
|
|
|
|
.. code-block:: python
|
|
|
|
app.msgbox(app.LANG)
|
|
|
|
* Language with variant
|
|
|
|
.. code-block:: python
|
|
|
|
app.msgbox(app.LANGUAGE)
|
|
|
|
* Application name
|
|
|
|
.. code-block:: python
|
|
|
|
app.msgbox(app.NAME)
|
|
|
|
* Application version
|
|
|
|
.. code-block:: python
|
|
|
|
app.msgbox(app.VERSION)
|
|
|
|
* In Windows
|
|
|
|
.. code-block:: python
|
|
|
|
app.msgbox(app.IS_WIN)
|
|
|
|
|
|
**Message box**
|
|
^^^^^^^^^^^^^^^
|
|
|
|
.. code-block:: python
|
|
|
|
app.msgbox(app.IS_WIN, 'My Macro')
|
|
|
|
|
|
**Show warning**
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
.. code-block:: python
|
|
|
|
message = 'Caution, this action is dangerous'
|
|
title = 'My App'
|
|
app.warning(message, title)
|
|
|
|
|
|
**Show error box**
|
|
^^^^^^^^^^^^^^^^^^
|
|
|
|
.. code-block:: python
|
|
|
|
message = 'ERROR: Contact technical support'
|
|
title = 'My App'
|
|
app.errorbox(message, title)
|
|
|
|
|
|
**Make question**
|
|
^^^^^^^^^^^^^^^^^
|
|
|
|
.. code-block:: python
|
|
|
|
message = 'Is easy Python?'
|
|
title = 'My App'
|
|
result = app.question(message, title)
|
|
app.msgbox(result)
|
|
|
|
|
|
**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)
|
|
|
|
|
|
|
|
.. _MRI: https://github.com/hanya/MRI
|