How to run commands from within Visual Studio PTVS?

牧云@^-^@ 提交于 2019-12-31 07:00:52

问题


I'm using Visual Studio 2012 and PTVS to play around with locustio and suds.

I have setup an environment using virtualenv in Visual Studio and installed locustio, suds and all the associated dependencies.

If I was to run locust via the command line in Mac or Linux I'd do something like:

`locust -f theFileToRun.py'

and locust would run and open a locally hosted page where I could control locust.

Django has a similar setup where you type runserver from the command line and your django project is locally hosted.

I've noticed that PTVS has a 'Django Launcher' listed under Launch Mode, which I assume takes care of this.

How can I (neatly!) run locust or other CLI commands from within Visual Studio?


回答1:


Right now, Django is the only Python web framework which we have special support for, and yes, this includes starting the server for you (and also opening the browser and navigating to the local website).

For everything else, you'll need to use the regular console for the time being. This VS extension might be of help there.

Given that running various shell commands in project root is not an uncommon activity when developing Python code, and that we can't special-case all the numerous frameworks out there, it does actually sound like an interesting feature for us to consider. I believe we don't have it in the issue tracker in the moment, so go ahead and add it there.



来源:https://stackoverflow.com/questions/18084028/how-to-run-commands-from-within-visual-studio-ptvs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!