Append To Python Path with sys.path.append() Method

Append To Python Path with sys.path.append() Method

Python provides the sys.path built-in variable in order to manage Python path information. Python path information is used to specify the locations of the Python modules and related libraries. If a module is required to import and loads this path information is used. The specified paths are searched for the specified modules. The interpreter searches … Read more

Python os.getenv() Method Tutorial

Python os.getenv() Method Tutorial

The python os module is used to work with the operating systems and related information. The os.getenv() method is used to get and display environment information about the current operating system. The getenv() method can return information like a current shell, current user, JAVA home path, etc. The getenv() method can be used to display … Read more

Find and Display Hostname In Python

Find and Display Hostname In Python

The hostname is used to set a human-readable name for a system. The hostname is the name of the host which is connected to a network or internet. By using the hostname the host can be easily identified in a human-readable format without using an IP address etc. Python provides different methods to find hostname … Read more

Python os.path.basename() Method Tutorial

Python os.path.basename() Method Tutorial

Python provides different methods for file and directory name manipulation. The basename() method is one of the most popular methods which is used to return the basename of the specified path. The basename means the name of the specified file or directory. The file name or directory name is extracted from the complete path and … Read more

Python String isalnum() Method Tutorial

Python String isalnum() Method Tutorial

Python string type provides the isalnum() method in order to check the current string characters if they are alphanumeric. All characters are tested and if all characters are alphanumeric the isalnum() method returns True. At least one character is not alphanumeric the isalnum() method returns False. isalnum() Method Syntax The isalnum() method has the following … Read more

Install Python Numpy (Linux, Windows, MacOSX)

Install Python Numpy (Linux, Windows, MacOSX)

NumPy is a popular 3rd party Python library used for numerical operations. As a 3rd party module, it is not provided by default with Python. The NumPy can be installed in different ways (pip, package manager, installer) for different operating systems(Windows, Linux, MacOSX). Install NumPy For Linux and MacOSX The NumPy can be installed by … Read more

Get/Display Current Working Directory In Python

Get/Display Current Working Directory In Python

Python provides different ways and methods in order to get or display the current working directory. The current working directory is used to specify the active path which is used if some file is created or read without an absolute path. The current working directory also shortened as cwd. Get/Display Current Working Directory with os.getcwd() … Read more