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

  • Home
  • SEARCH
  • 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 6804073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:25:18+00:00 2026-05-26T19:25:18+00:00

Please go through the python code snippet below import subprocess child = subprocess.Popen(python ./myprog.py

  • 0

Please go through the python code snippet below

import subprocess  
child = subprocess.Popen("python ./myprog.py ", shell=True)  
print "Hello"

Where myprog.py is simply :
print "Hello,myprog"

The output I get is :

Hello
Hello,myprog

My question is whether the child process starts running parallel to the parent process or does the child waits for the parent process to finish off,as the above output suggests?

  • 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-05-26T19:25:18+00:00Added an answer on May 26, 2026 at 7:25 pm

    To my understanding, it is launched as another process in the same fashion as a Unix fork() or whatever the Windows equivalent is.

    And then there’s this: http://docs.python.org/library/subprocess.html#subprocess.Popen.wait

    Observe:

    >>> p = Popen(["ls", "-hal"]);sleep (5);print "Word"
    total 12M
    drwxr-xr-x 51 ishpeck users   4.0K Nov 14 19:58 .
    drwxr-xr-x  7 root    root    4.0K Jun 25 04:30 ..
    drwxr-xr-x  2 ishpeck users   4.0K Jun  6 00:46 abcde.b00b030d
    drwx------  2 ishpeck users   4.0K Nov 13 13:57 .AbiSuite
    drwx------  3 ishpeck users   4.0K May 29 20:14 .adobe
    -rw-r--r--  1 ishpeck archive   55 Jun 29 07:18 .apvlvinfo
    drwxr-xr-x  2 ishpeck archive 4.0K Jul 28 23:16 .archive
    -rw-r--r--  1 ishpeck archive  180 Nov 14 18:23 .aspell.en.prepl
    -rw-r--r--  1 ishpeck archive  250 Nov 14 18:23 .aspell.en.pws
    -rw-r--r--  1 ishpeck users    152 Jun  6 00:45 .asunder
    -rw-------  1 ishpeck users   9.0K Nov 14 20:06 .bash_history
    -rw-r--r--  1 ishpeck users   2.2K Oct 22 08:54 .bashrc
    drwx------  3 ishpeck users   4.0K Sep 28 08:23 .bitcoin
    drwx------  3 ishpeck archive 4.0K Jul 30 22:44 .Broken Rules
    drwx------ 10 ishpeck users   4.0K Aug 16 16:37 .cache
    drwx------  2 ishpeck users   4.0K May 30 03:42 .cmus
    drwxr-xr-x 11 ishpeck users   4.0K Nov  6 16:42 .codelite
    drwx------ 23 ishpeck users   4.0K Sep 22 00:18 .config
    -rw-r--r--  1 ishpeck users   2.6K Jun  5 17:21 .conkyrc
    drwx------  3 ishpeck users   4.0K May 28 08:29 .dbus
    drwx------ 13 ishpeck users   4.0K Sep 27 21:25 dl
    drwxr-xr-x 29 ishpeck users   4.0K Nov 12 00:00 docs
    -rw-r--r--  1 ishpeck archive 1000 Nov 11 06:26 .emacs
    -rw-r--r--  1 ishpeck archive 1000 Nov 11 06:25 .emacs~
    -rw-r--r--  1 ishpeck archive  511 Nov 10 11:14 .emacs-backup
    drwx------  6 ishpeck users   4.0K Nov 10 11:22 .emacs.d
    drwxr-xr-x  3 ishpeck archive 4.0K Jun 17 04:26 .Eterm
    -rw-r--r--  1 ishpeck users    105 Nov 14 20:00 .fehbg
    -rw-------  1 ishpeck archive    9 Nov 13 22:10 .fetchmail.pid
    -rw-------  1 ishpeck archive  323 Oct 30 08:10 .fetchmailrc
    drwxr-xr-x  2 ishpeck users   4.0K Nov  2 00:43 .fontconfig
    drwx------  4 ishpeck users   4.0K Nov 13 22:10 .gconf
    drwx------  2 ishpeck users   4.0K Oct  1 20:50 .gconfd
    -rw-r--r--  1 ishpeck archive 127K Nov  7 10:19 geany-colors.tar.gz
    drwxr-xr-x  2 ishpeck users   4.0K May 31 05:43 .ghc
    drwxr-xr-x 22 ishpeck archive 4.0K Nov 14 18:24 .gimp-2.6
    -rw-r--r--  1 ishpeck users     75 May 31 12:59 .gitconfig
    -rw-r--r--  1 ishpeck archive  893 Oct 12 20:03 .gitk
    drwx------  3 ishpeck archive 4.0K Jul 30 19:46 .gnome
    drwx------  3 ishpeck users   4.0K Jul  1 13:37 .gnome2
    drwx------  2 ishpeck archive 4.0K Jul  1 13:37 .gnome2_private
    drwxr-xr-x  2 ishpeck users   4.0K Nov  2 19:05 .gstreamer-0.10
    -rw-------  1 ishpeck users    234 Nov  7 20:36 .gtk-bookmarks
    -rw-r--r--  1 ishpeck users    164 Jun  1 04:10 .gtkrc-2.0
    drwx------  2 ishpeck users   4.0K May 30 03:35 .gvfs
    drwxr-xr-x  3 ishpeck users   4.0K May 28 15:51 .icons
    drwxr-xr-x  2 ishpeck archive 4.0K Aug 11 06:59 .idlerc
    drwx------  2 ishpeck archive 4.0K Jul 16 19:36 .irssi
    -rw-------  1 ishpeck users    846 Nov 11 20:09 .lesshst
    drwx------  3 ishpeck users   4.0K Nov 11 22:35 .liferea_1.6
    drwx------  3 ishpeck users   4.0K May 28 06:12 .local
    -rw-r--r--  1 ishpeck users    842 Jun  5 16:34 lynx_bookmarks.html
    -rw-------  1 ishpeck users   3.3K Jun 11 04:14 Lynx.trace
    drwx------  3 ishpeck users   4.0K May 29 20:14 .macromedia
    drwx------  2 ishpeck users   4.0K Sep  2 19:42 Mail
    drwxr-xr-x  5 ishpeck users   4.0K Nov  7 07:47 media
    -rw-r--r--  1 ishpeck archive 3.8K Jul 16 22:56 .mrxvtrc
    drwxr-xr-x  2 ishpeck archive 4.0K Sep 14 08:12 .mutt
    -rw-r--r--  1 ishpeck archive 3.3K Oct 14 06:32 .muttrc
    -rw-r--r--  1 ishpeck archive 1.3K Jul 27 22:36 .nvidia-settings-rc
    drwx------  3 ishpeck users   4.0K May 28 08:35 .pki
    -rw-------  1 ishpeck archive    0 Nov  9 07:24 postponed
    drwxr-xr-x 12 ishpeck users   4.0K Sep 28 08:08 project
    drwx------  2 ishpeck archive 4.0K Nov 14 18:07 .pulse
    -rw-------  1 ishpeck users    256 May 31 03:52 .pulse-cookie
    drwx------  6 ishpeck users   4.0K Nov 14 20:15 .purple
    -rw-r--r--  1 ishpeck users    12K Nov  2 07:06 .pypanelrc
    drwxr-xr-x  3 ishpeck users   4.0K Jun 11 02:29 .q3a
    -rw-r--r--  1 ishpeck archive 1.9K Aug 23 17:11 .recently-used
    drwxr-xr-x  2 ishpeck users   4.0K Nov  2 07:55 .sbin
    -    rw-------  1 ishpeck archive  11M Nov 14 19:52 sent
    -rw-r--r--  1 ishpeck archive   61 Jul  2 21:44 .signature
    drwxr-xr-x  3 ishpeck archive 4.0K Nov  5 07:43 .slime
    drwx------  2 ishpeck users   4.0K Oct 31 22:46 .ssh
    drwxr-xr-x  3 ishpeck archive 4.0K Aug  6 16:49 .steelstorm
    drwxr-xr-x  3 ishpeck archive 4.0K Jul 28 23:16 .subversion
    -rw-r--r--  1 ishpeck archive  273 Jun 18 02:47 .synergy.conf
    drwxr-xr-x  9 ishpeck users   4.0K Jun  1 04:10 .themes
    drwx------  3 ishpeck users   4.0K May 28 09:39 .thumbnails
    drwxr-xr-x  2 ishpeck users   4.0K Oct 25 06:36 .vim
    -rw-------  1 ishpeck archive  19K Nov 14 19:52 .viminfo
    -rw-r--r--  1 ishpeck users     65 Jun 17 22:30 .vimrc
    drwxr-xr-x  2 ishpeck archive 4.0K Nov 13 23:26 .VirtualBox
    drwxr-xr-x  3 ishpeck archive 4.0K Jul 30 19:52 .vvvvvv
    -rw-------  1 ishpeck archive  101 Aug 17 05:51 .Xauthority
    -rw-r--r--  1 ishpeck archive  134 Aug 19 06:32 .Xdefaults
    -rw-r--r--  1 ishpeck users    120 Sep 26 21:19 .xinitrc
    -rw-r--r--  1 ishpeck archive 7.6K Oct 13 07:23 .xscreensaver
    Word
    

    So, in essence, yes, it’s running in parallel.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started learning Python through some books and online tutorials. I understand the basic
Can you someone please point in me in a direction, sample code or an
I've been going through a beginning Python book, and I've been trying to write
I have a python client which pushes a great deal of data through the
I need to import a very large dictionary into python and I'm running into
I have my python code in a folder called project, so my code files
I had the tskill operation working fine through a python script when using Python
I have this code: Words = ['python','candy', 'banana', 'chicken', 'pizza', 'calculus', 'cheeseburger', 'binder', 'computer',
Python noob... please be gentle. In my current program, I have a list of
I have a python question that I'm sure is pretty simple - please feel

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.