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 9072361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:09:01+00:00 2026-06-16T18:09:01+00:00

I have created a program that creates a web architecture in a local server

  • 0

I have created a program that creates a web architecture in a local server then loads the necessary browser to display the html and php pages on localhost.

The os.system call kills the python process but doesn’t kill the other processes — for example, httpd.exe and mysqld.exe

The subprocess call kills the httpd.exe and mysqld.exe programs but continues to run the python code, and no code executes after the subprocess call.

How would i go about killing or hiding all necessary processes after the python code is executed?

Here is my code.

os.makedirs(dr + x + '/admin' + '/css')
dobj = open(dr + x + '/admin' + '/css' + '/style.css', 'w')
dobj.close()
del dobj
os.makedirs(dr + x + '/admin' + '/js')
os.makedirs(dr + x + '/admin' + '/img')
################################################################################
## THE OS SYSTEM CALLS CLOSE THE APP BUT OPEN THE PROCESSES
## AND THE SUBPROCESS CALLS CLOSE BOTH PROCESSES AND LEAVES THE APP OPEN
## CANT WIN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
os.makedirs(dr + x + '/admin' + '/conf')
#os.system(r'C:\\xampp\\apache\\bin\\httpd.exe')
#os.system(r'C:\\xampp\\mysql\\bin\\mysqld.exe')
subprocess.Popen(['C:\\xampp\\apache\\bin\\httpd.exe'], shell=True, creationflags=subprocess.SW_HIDE)
subprocess.Popen(['C:\\xampp\\mysql\\bin\\mysqld.exe'], shell=True, creationflags=subprocess.SW_HIDE)
webbrowser.open('localhost/' + x)
sys.exit()
################################################################################


else:
    backmaybe = raw_input('Already Exists... Try Again? (Y/N) ')
if backmaybe == 'y':
    start()
else:
    sys.exit()
  • 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-16T18:09:02+00:00Added an answer on June 16, 2026 at 6:09 pm

    The difference between os.system and subprocess.Popen is that Popen actually opens a pipe, and os.system starts a subshell, much like subprocess.call. Windows only half-supports some pipe/shell features of what *nix operating systems will, but the difference should still fundamentally be the same. A subshell doesn’t let you communicate with the standard input and output of another process like a pipe does.

    What you probably want is to use subprocess like you are, but then call the kill() method (from the docs) on the pipe object before your application terminates. That will let you decide when you want the process terminated. You might need to satisfy whatever i/o the process wants to do by calling pipe.communicate() and closing the pipe’s file handles.

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

Sidebar

Related Questions

I have a simple program that creates a thread, loops twenty times and then
I have a Delphi program that creates HTML files. Later when a button is
I have a small C# program that I created that contacts a web service
Question: I have written a console program that uses the SQL server 2005 web
In my program, I have a web application that creates a PNG image. This
I have a caching program that creates static html files of dynamically generated php
I have created a Native Client application for the Google Chrome web browser that
For a peice of work I have created a web server that handles multiple
I have a program that creates multiple text files of rdf triples. I need
I have a program that creates a JFrame and makes it visible. Is there

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.