To check what version of the Python interpreter is using to execute code, you can use the “version_info” command from the “sys” module:
# sys.version_info(major=3, minor=5, micro=2, releaselevel='final', serial=0)
In this example the Python version 3.5.2. is using.
Creating Windows restore points is a good way to help to restore your computer if any troubles such as virus or advertising bots infection occur.
The restore point is a system image in which its current state is recorded (settings, appearance, installed programs). By creating and saving such a point, you can return your system to the recorded state at any time.
If you have opened a suspicious mail attachment accidentally, and now advertising banners appear on your computer screen (an advertising bot has been installed in your system) – with restore points you can return the system “back to the past” before the bot infects. Restore points are not absolutely troubles panacea, but very often, a “rollback” of the system saves the situation and returns the computer to a normal working state.
Continue reading “Automatic creation of Windows restore points”
The list of classes defined in the * .py file can be obtained using the built-in module “inspect”.
For example, for the “test_cls” module:
we can get a list of classes with the following code:
classes = [cls_name for cls_name, cls_obj in inspect.getmembers(sys.modules['test_cls']) if inspect.isclass(cls_obj)]
# ['Test1', 'Test2']
When developing online projects, it is often necessary to save the HTML page as a document that can be used separately, for example, sent by e-mail, viewed and edited offline. A convenient way is to export the HTML page to one of the most commonly used text formats – doc.
The free open-source PHP-module “html_to_doc” can be used to export the HTML page to the DOC document. It can convert the HTML to the DOC document, which will be correctly processed by the text editor MS Word. If the HTML page includes images, they will be embedded in the DOC document.
The PHP module can be downloaded from https://github.com/Korchy/html_to_doc
Continue reading “PHP: How to export HTML to DOC”