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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:24:02+00:00 2026-05-24T14:24:02+00:00

The multiprocessing module in Python 3.2.1 on Windows 7 x86 seems to be defeating

  • 0

The multiprocessing module in Python 3.2.1 on Windows 7 x86 seems to be defeating me.

I have two modules: servmain.py and sslserver.py. The idea is to (eventually) code an application which will communicate with clients using SSL. This is the part I already have down. However, I need the server listener to be spun off into its own separate process so the main process can do some other stuff. As a dummy test, I told the child process to print “Hello World” to stdout and write text to a non-existent text file.

Here is the code for my parent process(servmain.py):

from multiprocessing import Process
import logging

if __name__ == "__main__":
    logger = multiprocessing.log_to_stderr()
    logger.setLevel(logging.DEBUG)

    #Fire up the server


    listenerProcess = Process(target = sslserver.startServer)
    listenerProcess.start()
    logger.debug("Starting listener.")
    listenerProcess.join()
    logger.debug("Done.")

And here is the sslserver.py code:

def startServer():
    print("Hello World")
    f= open("testfile.txt", "w")
    f.write("Hello world\n")
    f.close()

When I run servmain.py, I get the following output:

[DEBUG/MainProcess] Starting listener. [DEBUG/MainProcess] Done.

Which is what I would expect. However, testfile.txt has not been created, and there is no output to stdout. Does anyone have an idea about why this might be happening?

  • 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-24T14:24:03+00:00Added an answer on May 24, 2026 at 2:24 pm

    I think I am missing a few libraries here so I had to remove your logger code because it was a problem for me. To me it would seem that you have a naming/pathing conflict. Please be sure the name ‘sslserver’ does not collide with any modules in python path.

    Also, set python path! In my example both of these files are in the same directory.

    pytest.py

    #!/usr/bin/env python
    from multiprocessing import Process
    import sslserver
    import logging
    if __name__ == "__main__":
        #logger = multiprocessing.log_to_stderr()
        #logger.setLevel(logging.DEBUG)
    
        #Fire up the server
    
    
        listenerProcess = Process(target = sslserver.startServer)
        listenerProcess.start()
        #logger.debug("Starting listener.")
        print "Starting Listener\n"
        listenerProcess.join()
        #logger.debug("Done.")
        print "Done\n";
    

    sslserver.py

    #!/usr/bin/env python
    
    def startServer():
        print("Hello World")
        f= open("testfile.txt", "w")
        f.write("Hello world\n")
        f.close()
    

    Output

    nynex@citadel:~/temp$ ./pytest.py 
    Starting Listener
    
    Hello World
    Done
    
    nynex@citadel:~/temp$ cat testfile.txt 
    Hello world
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble with the Python multiprocessing module. I am using the Process
(I'm using the pyprocessing module in this example, but replacing processing with multiprocessing should

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.