Pranathi M has Published 23 Articles

How to pass optional parameters to a function in Python?

Pranathi M

Pranathi M

Updated on 23-Aug-2023 21:54:29

47K+ Views

A type of argument with a default value is a Python optional parameter. A function definition's assignment operator or the Python **kwargs statement can be used to assign an optional argument. Positional and optional arguments are the two sorts of arguments that a Python function can take. Values that are ... Read More

How can I create a directory if it does not exist using Python?

Pranathi M

Pranathi M

Updated on 21-Aug-2023 16:22:10

258K+ Views

Python has built in file creation, writing, and reading capabilities. In Python, there are two sorts of files that can be handled: text files and binary files (written in binary language, 0s, and 1s). While you can create files you may delete them when you no longer need them. It ... Read More

How to read text file into a list or array with Python?

Pranathi M

Pranathi M

Updated on 11-May-2023 15:28:44

8K+ Views

Python has built in file creation, writing, and reading capabilities. In Python, there are two sorts of files that can be handled: text files and binary files (written in binary language, 0s, and 1s). There are 6 modes of accessing files. To read a text file we use read only ... Read More

How to write a single line in text file using Python?

Pranathi M

Pranathi M

Updated on 11-May-2023 15:26:46

4K+ Views

Python has built in file creation, writing, and reading capabilities. In Python, there are two sorts of files that can be handled: text files and binary files (written in binary language, 0s, and 1s). In this article, we'll look at how to write into a file. Firstly, we will have ... Read More

How to read a number of characters from a text file using Python?

Pranathi M

Pranathi M

Updated on 11-May-2023 15:24:18

5K+ Views

Python has a built-in file creation, writing, and reading capabilities. In Python, there are two sorts of files that can be handled: text files and binary files (written in binary language, 0s, and 1s). Let us understand how to open a file in python. Python is a good general purpose ... Read More

How to read complete text file line by line using Python?

Pranathi M

Pranathi M

Updated on 11-May-2023 15:22:47

607 Views

Python has built in file creation, writing, and reading capabilities. In Python, there are two sorts of files that can be handled: text files and binary files (written in binary language, 0s, and 1s). Let us understand how to open a file in python. Python is a good general purpose ... Read More

How can we convert a list of characters into a string in Python?

Pranathi M

Pranathi M

Updated on 11-May-2023 14:55:49

200 Views

A list is a data structure in Python that is a mutable, or changeable, ordered sequence of elements. A list's items are any elements or values that are contained within it. Lists are defined by having values inside square brackets [], just as strings are defined by characters inside quotations. ... Read More

How do I copy a file in python?

Pranathi M

Pranathi M

Updated on 11-May-2023 14:45:28

396 Views

One of the most prevalent activities in modern software development is copying files programmatically. In today's quick tutorial, we'll look at a few different ways to transfer files in Python using the shutil module. Shutil is a Python Standard Library module that provides a wide range of high-level file operations. ... Read More

How I can check a Python module version at runtime?

Pranathi M

Pranathi M

Updated on 11-May-2023 14:42:20

5K+ Views

Python introduces new features with every latest version. Therefore, to check what version is currently being used we need a way to retrieve them. If a user implements features without the correct version, it can generate random issues. We can check the version using few different methods. These methods are ... Read More

What is the simplest way to SSH using Python?

Pranathi M

Pranathi M

Updated on 11-May-2023 14:34:49

4K+ Views

SSH (secure shell) is helpful for remotely managing computers in a secure manner. To connect to a server, you typically use PuTTy, MobaXTerm, or the command-line ssh application. Every Unix, Linux, and Mac server includes SSH as standard equipment, and it is usable in every data centre. SSH connections have ... Read More

Advertisements