简体   繁体   中英

Can .py files be debugged in Visual Studio 2010?

I'm new to Python and am playing around with Python Tools for Visual Studio but I can't seem to find a way to use the VS debugger on .py files. It seems like the files have to be compiled to .pyc of part of a VS Solution to use the debugger.

This is a bummer because I would like to write standalone .py scripts in a text editor and use the VS debugger as needed.

Am I missing something? Is there a way to do this?

Instead of trying to use Visual Studio for debugging, consider the pdb module: http://aymanh.com/python-debugging-techniques

Edit: I spent some time playing around with Attach Process, but couldn't get it to work. My suggestion: have the .py file in a VS solution, edit with your favorite text editor, then switch back to VS, and in the Solution Explorer tab, right click on the file and select Start With Debugging.

Debugging a dynamic language like python is a little different
(I assume you mean you want to debug python code and not the C code in the python interpreter.)

There are some good free tools to use VS2010 with python which I have used in the past - see Python integration for Visual Studio 2010

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM