Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Python Tutorial
  • Interview Questions
  • Python Quiz
  • Python Glossary
  • Python Projects
  • Practice Python
  • Data Science With Python
  • Python Web Dev
  • DSA with Python
  • Python OOPs
Open In App
Next Article:
Python | os.write() method
Next article icon

Python | os.WIFCONTINUED() method

Last Updated : 26 Aug, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report

OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality.

os.WIFCONTINUED() method in Python is used to check whether a process has been continued from a job control stop or not. This method takes process status code as returned by os.wait(), os.system() or os.waitpid() method as a parameter and returns True if the process has been stopped, otherwise returns False.

Syntax: os.WIFCONTINUED(status)

Parameter:
status: This parameter takes process status code (an integer value) as returned by os.system(), os.wait() or os.waitpid() method.

Return type: This method returns a boolean value of class ‘bool’. This method returns True if the process has been continued from a job control stop, otherwise returns False.

Code: Use of os.WIFCONTINUED() method




# Python program to explain os.WIFCONTINUED() method 
  
# importing os and signal module  
import os, signal
  
# Create a child process
# using os.fork() method 
pid = os.fork()
  
  
# pid greater than 0
# indicates the parent process 
if pid :
      
    # Send signal 'SIGSTOP'
    # to child process
    # using os.kill() method
    # signal 'SIGCONT' will cause
    # the child process to stop
    os.kill(pid, signal.SIGSTOP)
  
    # Send signal 'SIGCONT'
    # to child process
    # using os.kill() method
    # SIGCONT signal will cause
    # the child process to continue
    os.kill(pid, signal.SIGCONT)
  
    # Get the child's pid and 
    # status code using
    # os.waitpid() method
    info = os.waitpid(pid, os.WCONTINUED)
  
    # info is a tuple
    # info[0] represents child's pid
    # info[1] represents exit status code
  
    print("\nIn parent process")
      
    # Check whether the child process
    # has been continued 
    # from a job control stop or not    
    # using os.WIFCONTINUED() method
    continued = os.WIFCONTINUED(info[1]) 
  
    print("Has child process been continued from a job control stop?")
    print(continued)
  
  
else :
  
    print("In Child process")
    print("Process ID:", os.getpid())
    print("Hello ! Geeks")
         
 
 
Output:
  In Child process  Process ID: 12371  Hello! Geeks    In parent process  Has child process been continued from a job control stop?  True  

References: https://docs.python.org/3/library/os.html#os.WIFCONTINUED



Next Article
Python | os.write() method

I

ihritik
Improve
Article Tags :
  • Python
  • python-os-module
Practice Tags :
  • python

Similar Reads

  • Python | os.waitid() method
    OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.waitid() method in Python is used by a process to wait for completion of one o
    3 min read
  • Python | os.WIFSIGNALED() method
    OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.WIFSIGNALED() method in Python is used to check whether a process exited due t
    3 min read
  • Python | os.WIFEXITED() method
    OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.WIFEXITED() method in Python is used to check whether the process exited using
    3 min read
  • Python | os.WIFSTOPPED() method
    OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.WIFSTOPPED() method in Python is used to check whether a process has been stop
    2 min read
  • Python | os.write() method
    OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.write() method in Python is used to write a bytestring to the given file descr
    2 min read
  • Python | os.wait() method
    OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.wait() method in Python is used by a process to wait for completion of a child
    2 min read
  • Python | os.WCOREDUMP() method
    OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.WCOREDUMP() method in Python is used to check whether a core dump was generate
    3 min read
  • Python | os.utime() method
    os.utime() method of OS module in Python is used to set the access and modified time of the specified path. os.utime() Method Syntax in PythonSyntax: os.utime(path, times = None, *, [ns, ]dir_fd = None, follow_symlinks = True) Parameter: path: A string or bytes object representing a valid file syste
    4 min read
  • Python | os.unlink() method
    OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. All functions in os module raise OSError in the case of invalid or inaccessible f
    3 min read
  • Python | os.read() method
    OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.read() method in Python is used to read at most n bytes from the file associat
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences