- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 27104 Articles for Server Side Programming
5K+ Views
Python uses quotes to represent string objects. They can either be a single quote or double quotes. Both ways are correct and work the same way; however, the difference occurs when these quotes are used together. In this article, we will learn the difference between single quotes and double quotes. Single Quotes in Python Single quotes should be used to wrap small and short strings in Python, such as string literals or identifiers. You must remember that using single quotes as a character of a string, while representing the string with single quotes, will raise an error. In such cases, ... Read More
9K+ Views
A statement is a logical instruction in Python that the Python interpreter can read and execute. It could be an expression or an assignment statement in Python. Python's assignment statement is fundamental. It specifies how an expression generates and stores objects. In a simple assignment, we create new variables, assign them values, and alter them. To maintain the value of the expression, this statement supplies an expression and a variable name as a label. Syntax variable = expression Creating Multi-Line Statements in Python Statements in Python are often written on a single line. The statement is concluded by the ... Read More
2K+ Views
To run a python file in a directory, we generally use the python or python3 command. However, it only runs a single file at a time. But executing one file each on a shell script seems cumbersome. Therefore, we must come up with a way to execute all files present in a directory simultaneously. There are two ways to do this in a shell program − Using loops in bash Using xargs Using Loops The fastest and easiest way to run all Python files in a directory is to use loops. You can use bash to do this ... Read More
315 Views
In the vast realm of Python programming, possessing the knowledge of the present directory where program execution occurs stands as a foundational skill. Comprehending the current directory facilitates access to files, data organization, and precise code execution. As we set forth on this journey, we shall unravel various methods to find the current directory in Python. Each of these methods exhibits distinct functionalities and adaptability, empowering you to traverse your Python projects with unwavering confidence. As a Python coding expert, I would like to serve as your guide, offering you a few code examples, coupled with lucid explanations, that will ... Read More
1K+ Views
As seasoned practitioners in the programming domain, we grasp the significance of a seamless coding experience. Configuring VIM auto-indentation for editing Python files can notably boost productivity, readability, and maintainability of your code. Within this article, we will explore a few indispensable techniques to tailor VIM for auto-indentation, personalized to your coding style. As a Python coding enthusiast, you will be escorted through each technique, accompanied by lucid explanations and real-world code examples. By the culmination of this article, you shall possess the knowledge to optimize VIM for a seamless and efficient Python coding experience. Let us get started on ... Read More
1K+ Views
In the realm of developers, staying alert to file alterations is of utmost importance for streamlining debugging, automation, and real-time updates in our Python projects. The act of monitoring Python files for changes equips us with the ability to remain in sync and act promptly when modifications arise. In this article, we shall navigate a few different methodologies to monitor Python files for changes, guaranteeing that not a single beat goes unnoticed. Each approach comes fortified with distinctive functionalities, empowering you to implement efficient monitoring solutions in your Python scripts. As a Python enthusiast, you will be escorted through each ... Read More
2K+ Views
Sometimes we need to write data into files from the command line in Python. This is not an infrequent task that can greatly add to the versatility of your Python scripts. For diverse tasks like creating new files, appending data to existing ones, or overwriting content, Python offers powerful tools to undertake these tasks effortlessly. In this article, we'll use multiple ways to explore different methods to write into files from the command line using Python. Each method, it will be seen, offers unique functionalities; this enables you to effectively manage file operations in your Python projects. You will find ... Read More
10K+ Views
For Python developers, acquiring the ability to extract information from files through the command line is a fundamental skill. Python arms us with potent tools to seamlessly read data from files via the command line, be it for data analysis, information extraction, or file processing. In this article, we embark on a journey through a few distinct methods to achieve file reading through Python's command line interface. Each method bestows its unique functionalities, empowering you to proficiently manage file operations in your Python projects. As a Python coder, you will be guided through each method with clear explanations and real-world ... Read More
23K+ Views
It is a recurrent and routine task of file handling in Python where there are solutions for different tasks of file processing. One such scenario is where you are required to import a module from a certain location on your system. Python's has appropriate tools to provide for dynamically importing modules where their full path is accessible. Such provisions make Python coding exhibit the power of flexibility and modularity. In this article, we explore various different methods to import Python modules when given their full path; each method offering unique advantages for various use cases. Here, an attempt is being ... Read More
9K+ Views
To call a Python file from within a PHP file, you need to call it using the shell_exec function.For exampleThis will call the script. But in your script at the top, you'll need to specify the interpreter as well. So in your py file, add the following line at the top:#!/usr/bin/env pythonAlternatively you can also provide the interpreter when executing the command.For example