Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8369359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:37:26+00:00 2026-06-09T13:37:26+00:00

With Ruby, a fork block can be used to express that Statements in this

  • 0

With Ruby, a fork block can be used to express that

Statements in this block are only executed in the child process and will be skipped over by the parent process.

Is there something similar in Python?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:37:27+00:00Added an answer on June 9, 2026 at 1:37 pm

    I don’t know Python, but I think you do it just like you do it in C, by checking the return value of fork():

    child_pid = os.fork()
    if child_pid == 0:
        print "This is the child."
        sys.exit(0)
    print "This is the parent."
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can we lock an IO that has been shared by multiple ruby process?
Given a very simple ruby script: child = fork do system 'sleep 10000' end
gettting this error. pid-file for killed process 8600 found (C:/cyncabc/tmp/pids/delayed_job.pid), deleting. c:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/daemonize.rb:103:in `fork': fork()
I am trying to use a Ruby gem called shotgun that requires fork(2) command
I have read some where that ruby fork are COW friendly ok here the
Ruby Motion comes with a lot of pre-built functions that are formatted like this:
I’m writing an application with Ruby on Rails. This application will be delivered to
Ruby-doc has this description: The ObjectSpace module contains a number of routines that interact
What's the difference between Process.fork and the new Process.spawn methods in Ruby 1.9.2 and
Ruby setters—whether created by (c)attr_accessor or manually—seem to be the only methods that need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.