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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:56:20+00:00 2026-05-14T05:56:20+00:00

httpd = make_server(”, 80, server) webbrowser.open(url) httpd.serve_forever() This works cross platform except when I

  • 0
httpd = make_server('', 80, server)
webbrowser.open(url)
httpd.serve_forever()

This works cross platform except when I launch it on a putty ssh terminal.
How can i trick the console in opening the w3m browser in a separate process so it can continue to launch the server?

Or if it is not possible to skip webbrowser.open when running on a shell without x?

  • 1 1 Answer
  • 1 View
  • 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-14T05:56:21+00:00Added an answer on May 14, 2026 at 5:56 am

    Maybe use threads? Either put the server setup separate from the main thread or the browsweropen instead as in:

    import threading
    import webbrowser
    
    def start_browser(server_ready_event, url):
        print "[Browser Thread] Waiting for server to start"
        server_ready_event.wait()
        print "[Browser Thread] Opening browser"
        webbrowser.open(url)
    
    url = "someurl"
    server_ready = threading.Event()
    browser_thread = threading.Thread(target=start_browser, args=(server_ready, url))
    browser_thread.start()
    
    print "[Main Thread] Starting server"
    httpd = make_server('', 80, server)
    print "[Main Thread] Server started"
    server_ready.set()
    
    httpd.serve_forever()
    browser_thread.join()
    

    (putting the server setup in the main thread lets it catch ctrl+c events i think)

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

Sidebar

Related Questions

I'm trying to restart my apache server using the comand: service httpd restart and
I'm installing Apache on Ubuntu following this install guide http://httpd.apache.org/docs/trunk/install.html but get an error
I have an apache httpd server running python code using django framework and mod_wsgi.
I want to start a simple web server locally, then launch a browser with
I'm trying to use a java.net.HttpURLConnection to make an HTTP request to a server.
How to make from your Custom HTTP Module a stand aloun TCP\HTTP server capable
I want to make a HTTP Post request from C#. This request has a
I'm using OS X Lion's built-in Apache server. I placed a .htaccess file in
I've googled around and only found solution where they suggest putting an apache httpd
I have one simple program of wsgi. from wsgiref.simple_server import make_server import time def

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.