Question

I'm looking to be working on a Python app. Does Python Tools for Visual Studio support 3rd-party libraries, such as Twisted?

Was it helpful?

Solution

3rd party libraries will run just fine. To get intellisense against them they'll need to be installed in site-packages or part of your project. If you install them after installing PTVS you'll need to run Tools->Options->Python Tools->Interpreter Options and select the interpreter you have configured and regenerated the completion database. Alternately you can have the libraries as part of your project and they'll be analyzed in real time.

You also seem interested in some specialized app... If that app is a pure Python app that starts up like "python.exe app.py" you'll have no problems at all. You may need to setup a custom interpreter again in Tools->Options->Python Tools->Interpreter Options which points at the specific python.exe that the app is using if it's a special app specific build.

If the app is actually a C++ app which is hosting Python life is a little more difficult. You should have no problems editing the code in PTVS but debugging will probably need to be accomplished by doing Debug->Attach to Process. This should work if the app is hosting a normal Python build and has it dynamically linked. PTVS will discover the Python interpreter and inject it's debugging script into the process. The workflow might be a little cumbersome doing the attach each time after launching but if you're not restarting frequently it shouldn't be too bad

OTHER TIPS

PTVS is just an IDE. So it does not need to "support" any libraries - they just need to be in your PYTHONPATH so your python code can import them.

However, chances are good that PTVS cannot launch a twisted-based daemon using twistd like you would do on the command line...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top