In Python, we use a package that stores a program to perform a particular operation. Packages are a crucial component of programming. Without packages, we waste a lot of time rewriting code that has already been developed.
Imagine if we don't have packages. We'll have to start from the beginning when we need functionality in our program file. We need to import the packages to use them.
The Sultan package is a package that runs command-line interface(CLI) from our Python program. For instance, if we want to create a file through the CLI command, we can easily use touch in our Python program file by utilizing the Sultan package.
# importing sultan packagefrom sultan.api import Sultan
import the Sultan package to use it.Let's look at the code below:
## import sultan package
from sultan.api import Sultan
s = Sultan()
## install the nodejs package
s.apt("install -y nodejs").run()Note: It will take some time because of the
nodejspackage installation. To confirm the installation, we can usenodejs --versioncommand in the terminal as it will reflect the version of the node.
sultan package.node package.Free Resources