• Article 1 :-File & Directory Related Methods

    Categories: Python ||

    There are three important sources, which provide a wide range of utility methods to handle and manipulate files & directories on Windows and Unix operating systems. They are as follows −File Obj

  • Article 2 :-The rmdir() Method

    Categories: Python ||

    The rmdir() method deletes the directory, which is passed as an argument in the method.Before removing a directory, all the contents in it should be removed.Syntaxos.rmdir('dirname')

  • Article 3 :-The getcwd() Method

    Categories: Python ||

    The getcwd() method displays the current working directory.Syntaxos.getcwd()

  • Article 4 :-The chdir() Method

    Categories: Python ||

    You can use the chdir() method to change the current directory. The chdir() method takes an argument, which is the name of the directory that you want to make the current directory.Syntaxos.chdir("new

  • Article 5 :-Directories in Python

    Categories: Python ||

    All files are contained within various directories, and Python has no problem handling these too. The os module has several methods that help you create, remove, and change directories.The mkdir() Met

  • Article 6 :-The remove() Method

    Categories: Python ||

    You can use the remove() method to delete files by supplying the name of the file to be deleted as the argument.Syntaxos.remove(file_name)

  • Article 7 :-Renaming and Deleting Files

    Categories: Python ||

    Python os module provides methods that help you perform file-processing operations, such as renaming and deleting files.To use this module you need to import it first and then you can call any related

  • Article 8 :-File Positions

    Categories: Python ||

    The tell() method tells you the current position within the file; in other words, the next read or write will occur at that many bytes from the beginning of the file.The seek(offset[, from]) method ch

  • Article 9 :-The read() Method

    Categories: Python ||

    The read() method reads a string from an open file. It is important to note that Python strings can have binary data. apart from text data.SyntaxfileObject.read([count])Here, passed parameter is the n

  • Article 10 :-Reading and Writing Files

    Categories: Python ||

    The file object provides a set of access methods to make our lives easier. We would see how to use read() and write() methods to read and write files.The write() MethodThe write() method writes any st

  • Article 11 :-The close() Method

    Categories: Python ||

    The close() method of a file object flushes any unwritten information and closes the file object, after which no more writing can be done.Python automatically closes a file when the reference object o

  • Article 12 :-The file Object Attributes

    Categories: Python ||

    Once a file is opened and you have one file object, you can get various information related to that file.Here is a list of all attributes related to file object −Sr.No.Attribute & Desc

  • Article 13 :-The open Function

    Categories: Python ||

    Before you can read or write a file, you have to open it using Python's built-in open() function. This function creates a file object, which would be utilized to call other support methods associated

  • Article 14 :-Opening and Closing Files

    Categories: Python ||

    Until now, you have been reading and writing to the standard input and output. Now, we will see how to use actual data files.Python provides basic functions and methods necessary to manipulate files b

  • Article 15 :-The input Function

    Categories: Python ||

    The input([prompt]) function is equivalent to raw_input, except that it assumes the input is a valid Python expression and returns the evaluated result to you.#!/usr/bin/pythonstr = input("Enter your

  • Article 16 :-The raw_input Function

    Categories: Python ||

    The raw_input([prompt]) function reads one line from standard input and returns it as a string (removing the trailing newline).#!/usr/bin/pythonstr = raw_input("Enter your input: ")print "Received inp

  • Article 17 :-Python - Files I O

    Categories: Python ||

    Printing to the ScreenThe simplest way to produce output is using the print statement where you can pass zero or more expressions separated by commas. This function converts the expressions you pass i

  • Article 18 :-Packages in Python

    Categories: Python ||

    A package is a hierarchical file directory structure that defines a single Python application environment that consists of modules and subpackages and sub-subpackages, and so on.Consider a file Pots.p

  • Article 19 :-The reload() Function

    Categories: Python ||

    When the module is imported into a script, the code in the top-level portion of a module is executed only once.Therefore, if you want to reexecute the top-level code in a module, you can use the 

  • Article 20 :-The globals() and locals() Functions

    Categories: Python ||

    The globals() and locals() functions can be used to return the names in the global and local namespaces depending on the location from where they are called.If locals() is called from within a functio

  • Article 21 :-The dir( ) Function

    Categories: Python ||

    The dir() built-in function returns a sorted list of strings containing the names defined by a module.The list contains the names of all the modules, variables and functions that are defined in a modu

  • Article 22 :-Namespaces and Scoping

    Categories: Python ||

    Variables are names (identifiers) that map to objects. A namespace is a dictionary of variable names (keys) and their corresponding objects (values).A Python statement can access variables in a local

  • Article 23 :-The PYTHONPATH Variable

    Categories: Python ||

    The PYTHONPATH is an environment variable, consisting of a list of directories. The syntax of PYTHONPATH is the same as that of the shell variable PATH.Here is a typical PYTHONPATH from a Windows syst

  • Article 24 :-Locating Modules

    Categories: Python ||

    xWhen you import a module, the Python interpreter searches for the module in the following sequences −The current directory.If the module isn't found, Python then searches each directory in the shel

  • Article 25 :-The import Statement

    Categories: Python ||

    You can use any Python source file as a module by executing an import statement in some other Python source file. The import has the following syntax −import module1[, module2[,... moduleN]When the

  • Article 26 :-Python - Modules

    Categories: Python ||

    A module allows you to logically organize your Python code. Grouping related code into a module makes the code easier to understand and use. A module is a Python object with arbitrarily named attribut

  • Article 27 :-The return Statement

    Categories: Python ||

    The statement return [expression] exits a function, optionally passing back an expression to the caller. A return statement with no arguments is the same as return None.All the above examples are not

  • Article 28 :-The Anonymous Functions

    Categories: Python ||

    These functions are called anonymous because they are not declared in the standard manner by using the def keyword. You can use the lambda keyword to create small anonymous functions.1. Lambda forms c

  • Article 29 :-Variable-length arguments

    Categories: Python ||

    You may need to process a function for more arguments than you specified while defining the function. These arguments are called variable-length arguments and are not named in the function definition,

  • Article 30 :-Default arguments

    Categories: Python ||

    A default argument is an argument that assumes a default value if a value is not provided in the function call for that argument. The following example gives an idea on default arguments, it prints de

  • Article 31 :-Global vs. Local variables

    Categories: Python ||

    Variables that are defined inside a function body have a local scope, and those defined outside have a global scope.This means that local variables can be accessed only inside the function in which th

  • Article 32 :-Scope of Variables

    Categories: Python ||

    All variables in a program may not be accessible at all locations in that program. This depends on where you have declared a variable.The scope of a variable determines the portion of the program wher

  • Article 33 :-The return Statement

    Categories: Python ||

    The statement return [expression] exits a function, optionally passing back an expression to the caller. A return statement with no arguments is the same as return None.

  • Article 34 :-The Anonymous Functions

    Categories: Python ||

    These functions are called anonymous because they are not declared in the standard manner by using the def keyword. You can use the lambda keyword to create small anonymous functions.1. Lambda forms c

  • Article 35 :-Variable-length arguments

    Categories: Python ||

    You may need to process a function for more arguments than you specified while defining the function. These arguments are called variable-length arguments and are not named in the function definition,

  • Article 36 :-Default arguments

    Categories: Python ||

    A default argument is an argument that assumes a default value if a value is not provided in the function call for that argument. The following example gives an idea on default arguments, it prints de

  • Article 37 :-Keyword arguments

    Categories: Python ||

    Keyword arguments are related to the function calls. When you use keyword arguments in a function call, the caller identifies the arguments by the parameter name.This allows you to skip arguments or p

  • Article 38 :-Required arguments

    Categories: Python ||

    Required arguments are the arguments passed to a function in correct positional order. Here, the number of arguments in the function call should match exactly with the function definition.To call the

  • Article 39 :-Function Arguments

    Categories: Python ||

    You can call a function by using the following types of formal arguments −Required argumentsKeyword argumentsDefault argumentsVariable-length arguments

  • Article 40 :-Pass by reference vs value

    Categories: PHP ||

    All parameters (arguments) in the Python language are passed by reference. It means if you change what a parameter refers to within a function, the change also reflects back in the calling function. F

  • Article 41 :-Calling a Function

    Categories: Python ||

    Defining a function only gives it a name, specifies the parameters that are to be included in the function and structures the blocks of code.Once the basic structure of a function is finalized, you ca

  • Article 42 :-Example of Python

    Categories: Python ||

    def printme( str ):   "This prints a passed string into this function"   print str   return

  • Article 43 :-Syntax in Python

    Categories: Python ||

    def functionname( parameters ):"function_docstring"function_suitereturn [expression]

  • Article 44 :-Defining a Function

    Categories: Python ||

    You can define functions to provide the required functionality. Here are simple rules to define a function in Python.Function blocks begin with the keyword def followed by the function name and parent

  • Article 45 :-Functions in Python

    Categories: Python ||

    A function is a block of organized, reusable code that is used to perform a single, related action. Functions provide better modularity for your application and a high degree of code reusing.As you al

  • Article 46 :-Single Statement In Python

    Categories: Python ||

    If the suite of an if clause consists only of a single line, it may go on the same line as the header statement.Here is an example of a one-line if clause −Program of Single Statement in python#!/us

  • Article 47 :-Python - Decision Making

    Categories: Python ||

    Decision making is anticipation of conditions occurring while execution of the program and specifying actions taken according to the conditions. Decision structures evaluate multiple expressions which

  • Article 48 :-Highest Precedence in Python Operators

    Categories: Python ||

    The following table lists all operators from highest precedence to lowest.Operator & Description1. ** - Exponentiation (raise to the power)2. ~ + - - Complement, unary plus and minus (method

  • Article 49 :-Python Identity Operators

    Categories: Python ||

    Identity operators compare the memory locations of two objects. There are two Identity operators explained below −OperatorDescriptionExampleisEvaluates to true if the variables on either side of the

  • Article 50 :-Python Membership Operators

    Categories: Python ||

    Python’s membership operators test for membership in a sequence, such as strings, lists, or tuples. There are two membership operators as explained below −OperatorDescriptionExampleinEvaluates to

Top articles
How to Create a Winning Business Plan in 2024 Published at:- Monsoon Bliss: 5 Ways Goa Captivates Travelers in 2024 Published at:- Why Indian Chutneys Deserve Their Spot Among the World's Best Dips Published at:- Impact of Virtual Reality on Sports Viewing in 2024 Published at:- How Jerrycans Are Good Storage Solutions for Business Owners Published at:- Latest Innovations in Korean Skincare for 2024 Published at:- Oily Skin Survival Guide for the Hottest Summer of 2024 Published at:- Boost Your Cybersecurity: Leveraging Microsoft Authenticator App in 2024 Published at:- ZebPay Your Go-To Platform for Instant Bitcoin Purchases in India Published at:- The Impact of Stress on Uterine Problems: Strategies for Management Published at:- Mastering the Art of Resilience: A Guide to Handling Rejection Published at:- Community Colleges Are Navigating the Educational Landscape in 2024 Published at:- Plan Your Dream April Vacation: Top Destinations to Consider Published at:- From Antioxidants to Anti-Inflammatory Compounds: Betel Leaf's Health Secrets Revealed Published at:- Top Smart Glasses of A Buyers Guide Published at:- Key Qualities to Cultivate Becoming a Better Teacher Published at:- Role of Technology in Modern Curriculum Development Published at:- How to Align Curriculum Development with Learning Objectives Published at:- Top 5 Natural Remedies to Shield Your Skin from Holi Colors Published at:- Elevate Your Holi Celebration with this Gujiya Recipe Published at:- Who launched the INSAT 3D satellite and when Published at:- Teaching the Significance of Republic Day to the Next Generation Published at:- Ways to Support the Community on World AIDS Day 2023 of Building Solidarity Published at:- How to Plan the Perfect Winter Wonderland Fest Published at:- Making the Most of Winter Magic Festival Season Published at:- Unleash the Magic: Top Winter Festivals Around the World Published at:- Captivating Moments: Highlights of the Winter Magic Festival Published at:- Embrace the Chill Unforgettable Experiences at the Winter Magic Festival Published at:- Uncovering the Secrets of the Aurora Winter Festival Published at:- 10 Tips for Making the Most of the Winter Festival Published at:- Ultimate Guide to the Aurora Winter Festival Published at:- Ultimate Jack Frost Winterfest Survival Guide Published at:- Complete Guide to Jack Frost Winterfest with Making Memories Published at:- Celebration of Light, Joy, and Togetherness Diwali 2023: Published at:- Experience the Beauty of Diwali 2023 Published at:- Hindu Festival of Lights to Celebrating Diwali 2023 Published at:- Hindu Festival of Lights to Celebrating Diwali 2023 Published at:- Embrace the Festive Vibes Of Diwali 2023 in India Published at:- Achieve Radiant Skin with These Benefits The Power of Skin Toner Published at:- Unveiling the Beauty Benefits of Besan for Your Skin from Dull to Radiant Published at:- Get Glowing with Besan Guide to its Face Transforming Benefits Published at:- Remarkable Benefits of Olive Oil for Skin Whitening Published at:- Unleashing the Power of Platform as a Service in Cloud Computing Published at:- Benefits of Platform as a Service for Cloud Computing Success Published at:- Mastering Cloud Infrastructure Services A Comprehensive Guide Published at:- Choosing the Right Cloud Infrastructure Services for Your Business Published at:- Why Cloud Infrastructure Services Are Essential for Business Success Published at:- Unleashing the Power of Cloud Computing Storage Published at:- Advantages of Cloud Computing Storage Published at:- 10 Creative Ideas for Using Adobe Acrobat Published at:- Unlock the Power of Adobe Acrobat: A Comprehensive Guide Published at:- How to Convert PDFs Easily and Quickly Published at:- When Is the Best Time to Use a PDF Converter Published at:- Advantages of Using a PDF Converter Published at:- Exploring the Benefits of an eLearning Platform Published at:- How to Choose the Right E Learning Platform for Your Needs Published at:- Exploring the Benefits of Vocational Training Published at:- Tips for Choosing the Right Vocational Training Program Published at:- The Pros and Cons of Choosing an AR 15 for Your Next Deer Hunting Rifle Published at:- Why a Universal Basic Income Could be Good Economics for Hard Times Published at:- 7 Reasons Why Every Student Should Own a Personal Computer Published at:- 10 Ways Technology is Revolutionizing Healthcare Published at:- Upcoming Technology In Computer Science Published at:- Capture High Quality Photos and Videos with the VIVO Drone Camera Phone Published at:- PHP and its use Published at:- Why is web application security important for any website Published at:- Technology will be replaced by Android in the future Its correct or not Published at:- Some of the advantages of Angular over other frameworks Published at:- Best E commerce website development services Published at:- Mobile App Security Important in App Development Published at:- Advantages and Disadvantages of Tourism Published at:- What is the best cryptography software Published at:- What are some must read books on economics Published at:- When did Covid start in India Published at:- Which mobile phone has the most sales in India Published at:- Which is the best smartphone under Rs. 8,000 in India Published at:- What are the features of the C language Published at:- Who are the world's top 10 best artists of all time Published at:- What is data binding in AngularJS Published at:- How much do professional gamers earn in India Published at:- What is IT technology Published at:- What's the best mind map software Published at:- What are the service management tools on Linux Published at:- What is cloud computing and its advantages Published at:- How do I raise funds in India for my startup business idea Published at:- What businesses can an electronics and telecommunication engineer start Published at:- What precautions are you taking out of fear of the coronavirus Published at:- Is there a treatment for the Coronavirus Published at:- What is the most popular sport in the world Published at:- What is the key to successful sports betting Published at:- How do I crack Indian Railway Recruitment exams Published at:- What are the top most habits for health, beauty, and fitness of girls aged 14 to 21 Published at:- What is the single best site for homemade health and beauty recipes Published at:- Best Acca Insurance Offers 2022 Published at:- Is Technology Making Leadership More Efficient or Dependent? Published at:- The Value of an International Degree in Business Management Published at:- 5 Startup Lessons They Don't Teach You in College Published at:- Dire Need For A Change Of Syllabus For - 'The Indian Education System' Published at:- Top 10 Reasons Behind the Rise of Aerospace Engineering Career Published at:- What is Component Management in Software Engineering Published at:-
R4RIn Team
The content on R4RIn.com website is created by expert teams.