我可以直接使用PTVS()用模块创建一个“”吗?我在使用命令行之前已经这样做了,但没有使用PTVS。如果是,怎么做?谢谢!
发布于 2014-03-19 17:55:19
目前没有。我认为你想要投票的功能是特点:构建包。如果您在过去使用过py2exe或其他包,那么您可以在我们的2.1版本中直接将其连接到PTVS中。这将为您的项目提供一个上下文菜单,它将允许您在IDE中运行命令。
要做到这一点,您可以修改.pyproj文件并添加如下内容:
<PropertyGroup>
<PythonCommands>$(PythonCommands);PythonRunPyLintCommand</PythonCommands>
<PyLintWarningRegex>
<![CDATA[^(?<filename>.+?)\((?<line>\d+),(?<column>\d+)\): warning (?<msg_id>.+?): (?<message>.+?)$]]>
</PyLintWarningRegex>
</PropertyGroup>
<Target Name="PythonRunPyLintCommand"
Label="Run PyLint"
DependsOnTargets="ResolveStartupPath"
Returns="@(Commands)">
<CreatePythonCommandItem Target="pylint.lint"
TargetType="module"
Arguments=""--msg-template={abspath}({line},{column}): warning {msg_id}: {msg}" -r n @(Compile, ' ')"
WorkingDirectory="$(WorkingDirectory)"
ExecuteIn="output"
RequiredPackages="pylint>=1.0.0"
WarningRegex="$(PyLintWarningRegex)">
<Output TaskParameter="Command" ItemName="Commands" />
</CreatePythonCommandItem>
</Target>这个例子是PyLint,但是您可以将TargetType更改为可执行/脚本/代码或pip来执行不同的事情。您可以将ExecuteIn更改为控制台、输出或repl,以便在不同的位置显示输出。
https://stackoverflow.com/questions/22498982
复制相似问题