J
J
jatrifikno2021-11-27 03:15:28
Python
jatrifikno, 2021-11-27 03:15:28

Why is Python the way it is used?

For example, to run the written code on another PC, you need to drag the python interpreter there, download all the libraries that are used in my creation and run the script, and all this will spin in the console. Is someone using PyInstaller or is that not accepted? It is written that almost the most popular language is used in large companies. And how they use it, run the code, it "spins" doing something there or calling Python scripts from other languages. How it all looks, I can't imagine it all...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-11-27
@jatrifikno

For example, to run the written code on another PC, you need to drag the python interpreter there, download all the libraries that are used in my creation and run the script, and all this will spin in the console.

1. That's right, if you need a packaged exe, PyInstaller is used, although this is not very optimal.
2. Files with the .pyw extension run without a console window (on Windows). Linux systems have their own means of suppressing the console window.
3. To run a .NET program, the correct version of the .NET Framework must be installed. To run a program compiled in C++ with Visual Studio on Windows, you usually need the correct version of MSVC Redistributable. They may be pre-installed, but this is not a fact. So the issue of dependencies is not only in python. Python at least has a package manager for this sort of thing, and in most cases installing dependencies comes down to pip install foo bar baz.
And how they use it, run the code, it "spins" doing something there or calling Python scripts from other languages.

As a rule, independently, in a virtual environment like venv or docker. If the script does not require specific dependencies, you can use the python interpreter installed directly on the system.
But there are mechanisms that allow a C ++ program to embed a python interpreter in itself - then you can use python to write scripts to automate this program, for example. This is less commonly used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question