
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10489 Articles for Python

11K+ Views
There are times when you want to organize your files or update the directory names to better reflect their contents. In such scenarios, the operation of renaming directories becomes helpful and it is a common task that we often encounter in Python file management. There is provision of several modules and methods in Python that makes renaming directories an easy task. In this article, we explore different ways how you can rename directories using Python code. You will learn this skill by practicing the code examples and explanations discussed in this article. Making Use of the OS Module ... Read More

915 Views
In the realm of Python programming, a filesystem node holds significant prominence as it encompasses the essence of file and directory representation within the intricate file system. This construct acts as a means to interact with files and directories programmatically. Each node bears multiple attributes like names, sizes, permissions, and timestamps. The widely used Python modules, such as "os" and "pathlib, " serve as the conduits through which one may interact with these entities, the filestystem nodes and even modify them when required. Filesystem nodes can be created, renamed, deleted, and navigated to access their contents. These nodes make ... Read More

1K+ Views
Python is one of the most used object-oriented programming languages which is very easy to code and understand.In order to use Python with SAP, we need to install Python SAP RFC module which is known as PyRFC. One of its available methods is RFC_READ_TABLE which can be called to read data from a table in SAP database.Also, the PyRFC package provides various bindings which can be utilized to make calls either way. We can use to make calls either from ABAP modules to Python modules or the other way round. One can define equivalent SAP data types which are used ... Read More

15K+ Views
Consider a pipeline that allows for seamless data flow and communication between various components of a complex system. Named pipes are similar conduits in Python programming, making it easier for programs to communicate with each other and other processes. Named pipes, which are also referred to as FIFOs (First-In, First-Out), are a powerful way to exchange data between processes on the same system or even between systems. In this article, we will take a journey into Python to learn how to create and use named pipes. We'll unwind the step by step process of making a named pipe, writing and ... Read More

270 Views
In identifying and interacting with hardware devices, device numbers have a significant role in the domain of low-level systems programming. Every device or peripheral that is connected to a computer system is given or assigned a unique pair of numbers called the major and minor device numbers. You have to comprehend how to compose a raw device number from these components and this is essential when interacting with device drivers or working with devices at a low level. In this article, we will set out on a journey to explore the procedure of composing a raw device number in Python. ... Read More

323 Views
Have you ever anytime wondered how the complex world of low-level system programming deals with the issue of device identification in Python? One essential item of data is the device major number; this plays a crucial role in identifying different devices in a system. In this article, we will set out on a journey to demystify the process of extracting the device major number from a raw device number using the power of Python. By the end of this article, you'll be equipped with the knowledge to navigate the realm of device identification with confidence. Understanding Device Major Numbers Before ... Read More

1K+ Views
Creating symbolic links (or soft links) in Python can be done using the OS module. A symbolic link is a special type of file that points to another file or directory, allowing you to access it under a different pathname. This can be useful for various reasons, such as creating shortcuts or managing different versions of files. The following methods provide different ways to create symbolic links. Using os.symlink() Function Using pathlib.Path.symlink_to() Function Using Command Line with subprocess Module Using 'os.symlink()' Function The most straightforward way to ... Read More

4K+ Views
Hard links in Python can be created using several methods. Hard links allow you to create multiple names for the same file on the filesystem, meaning changes made to one will reflect in the other. Below are three methods to create hard links. Using os.link() Using os.system() with Shell Command Using subprocess.run() Using 'os.link()' Method The most straightforward way to create a hard link in Python is by using the os.link() method, which is built into the OS module. This method takes two arguments: the source file (`src`) ... Read More

349 Views
You have to use the fdatasync(fd) function to force write of file with filedescriptor fd to disk. It does not force update of metadata. Also note that this is only available on Unix.A more cross platform solution would be to use fsync(fd) as it force write of file with filedescriptor fd to disk. On Unix, this calls the native fsync() function; on Windows, the MS _commit() function.Exampleimport os, sys # Open a file fd = os.open( "foo.txt", os.O_RDWR|os.O_CREAT ) os.write(fd, "This is test") # Now you can use fsync() method. os.fsync(fd) # Now read this file from the beginning os.lseek(fd, ... Read More

2K+ Views
Filesystem information, in Python, is defined as the attributes and metadata linked with a file or directory, such as its name, size, timestamps, permissions, ownership, and type. There are various modules in Python like os and os.path to work with the file system and fetch this information. Obtaining access to filesystem information allows developers to work with files and directories, carry out operations like creation and deletion, and take informed decisions within their code. To fetch file system information using Python, you can utilize the os module; it provides several functions for interacting with the operating system. In particular, the ... Read More