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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:39:04+00:00 2026-06-05T14:39:04+00:00

Visual Studio has great python support via the Python Tools for Visual Studio: http://pytools.codeplex.com/

  • 0

Visual Studio has great python support via the Python Tools for Visual Studio:
http://pytools.codeplex.com/

Debugging python code in Visual Studio works as expected. I set up a lighttpd server on my local Windows machine, and I have python scripts running as cgi scripts. I would like to be able to debug these in Visual Studio (running on the same PC) when running from lighttpd.

I am able to debug the cgi scripts using:
http://winpdb.org
But I would prefer Visual Studio.

According to this question:
How to debug a remote python application with (Python Tools for) Visual Studio?

It is implied there is almost a way, but I don’t see a specific way to set a breakpoint and have it debugged in VS.

  • 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-05T14:39:06+00:00Added an answer on June 5, 2026 at 2:39 pm

    Figured it out. This does work, and works pretty well, once you get the steps down.

    • Add a delay to the python source file like this:

      time.sleep(10)
      

      This is necessary if you are not using FastCGI, as the python process is probably going to start and finish long before you can attach to it. I assume this would be different with FastCGI, but I haven’t reached that stage yet.

    • Set a breakpoint in your python file that is running in your lighttpd (or apache?) server. I tested lighttpd. Note: If you don’t add the source file to a project in VS, and thus don’t set a breakpoint, you can still debug, but you’ll have to force an error in the file. I added a line ‘debugger’ which worked.
    • Load the page in a browser and allow the delay to be hit
    • In VS: Debug -> Attach to process -> pythonw.exe (complete this before the delay elapses)

    I added a short macro to the Visual Studio IDE that automates the procedure of attaching to pythonw.exe. I’ll share that if anyone is interested.

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

Sidebar

Related Questions

My application works great on all computers here that has Visual Studio installed, but
With the framework that Visual Studio 2008 has, am I missing anything great by
Either I'm going mad or the Code Analysis tab in Visual Studio has disappeared
What are the best code snippets for C#? (using visual studio) VB has a
We have a database project in Visual Studio 2008 that has been working great.
The dev tools for SQL in Visual Studio are great. Is it possible to
The HTML formatting in Visual Studio works great -- especially considering you can pick
MS Visual Studio has a great feature: it automatically suggests the units to add
Visual Studio has ways to automatically create a method. For example, you could double
I realize that Visual Studio has the /P option to generate preprocessed files, but

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.