问题标签 [ptvs]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
644 浏览

python - 如何检查 Python 程序是否已在 Visual Studio 中启动?

我正在使用Visual Studio 12Python Tools for Visual Studio 1.5来开发 Python 程序。这很好用。

现在我想在 Python 代码中检查我们是否在 Visual Studio 中运行。有没有简单的方法来实现这一目标?

0 投票
1 回答
2174 浏览

python - 为 Visual Studio 2010 安装 python 工具的问题

我为 Visual Studio 1.1 安装了Iron python 2.7.3python 工具

但是当我尝试创建一个新的 python 项目时,它只让我创建一个命令行应用程序。我想用 Iron Python 创建一个 GUI,所以我期待创建一个 WPF 项目。该文档指出,如果我安装了 Iron python,它应该可用。我做错什么了吗?我尝试重新安装 Iron python 和 python 工具。

0 投票
1 回答
526 浏览

python - Visual Studio 的 python 工具不接受 //

我正在使用机械化。如果我在 CMD 控制台中运行,我的代码运行良好,但在 Visual Studio IDE 上,我收到此错误“unsupported operand type(s) for +: 'instance' and 'str'” at linebr.open('http://gmail.com')

我的代码是

好像 // 不被接受?

任何想法?

0 投票
1 回答
849 浏览

ironpython - 使用 Visual Studio 的 Python 工具将 Python 代码从 WPF 编译为 exe

我已经尝试过 pyc.py 的方法ipy.exe pyc.py /main:WpfApplication2.py /target:winexe,但这会生成一个绝对没有任何作用的 exe 文件。

那么怎么做呢?我找不到任何关于它的东西。

0 投票
6 回答
111169 浏览

python - pip 可以与 Visual Studio 中的 Python 工具一起使用吗?

我正在与一些同学合作构建一个 python 应用程序,并希望使用 Visual Studio intelli-sense 的“训练轮”。他们在 mac 和 linux 上使用 python,因此理想情况下,我们的源代码控制 repo 将仅包含*.py我们编写的源文件,以及requirements.txtpip 依赖项的导出(使用该pip freeze方法)。

我希望能够创建一个新的 Visual Studio 项目,然后能够在该项目中运行以下命令(例如):

之后,能够编写一些引用这些库的代码,并能够在 Visual Studio 中运行它。

有没有办法做到这一点?Visual Studio 中的 Python 甚至能够以 pip 中可用的格式处理模块,还是 VS 中使用的所有 Python 库都必须针对 Windows 进行预编译?

提前感谢您的帮助!

0 投票
1 回答
834 浏览

python - 用于 Visual Studio 的 OpenERP 和 Python 工具编译错误

我正在尝试使用 Python Tools for Visual Studio 在 Visual Studio 2012 中构建和运行 OpenERP 服务器。

目前我收到超过 2300 条错误消息,主要是:

我已经下载了 openerp-server-6.0.4 源代码,并从 VS 中的现有 Python 代码项目创建了一个新的 Python 项目。我在提示时选择了 OpenERP 源 (C:\OpenERP\Bin) 的路径,按下 F5 时要执行的文件是 openerp-server.py。我选择了 Python 64 位 3.3 解释器。

该项目已创建,但即使在构建之前,我也会收到许多意外的令牌错误。例如,在 account.py 文件中,它在以下代码中抱怨意外的令牌“税”:

在 Python Interactive 中使用 TOOLS > Python Tools > Execute Project 时,我看到以下结果:

Python 交互式窗口。键入 $help 以获取命令列表。

重置执行引擎

交互窗口尚未启动。

运行 C:\temp\openerp-server-6.0.4\bin\openerp-server.py

回溯(最近一次通话最后):

导入工具中的文件“C:\temp\openerp-server-6.0.4\bin\openerp-server.py”,第 64 行

文件“C:\temp\openerp-server-6.0.4\bin\tools__init__.py”,第 23 行,导入 win32

ImportError:没有名为“win32”的模块

谁能指导我让 OpenERP 使用 VS 构建和运行?甚至可能吗?

谢谢!

0 投票
1 回答
184 浏览

python - Visual Studio 的 python 工具中的 rdflib

我想在 Visual Studio 的 python 工具中使用 rdflib。我安装了 python 工具和 rdflib。当我import rdflib在我的项目中写入(在文件* .py 中)并启动它时,它返回一个错误

基数为 10 的 int() 的无效文字:'value'

并指向行import rdflib 虽然我可以在 Python Interactive 中打开 Tools->Python Tools->Execute Project ,并在import rdflib那里执行而没有错误。但是当我关闭该窗口时,我仍然无法使用该库在* .py 文件中进行编码。

如何使用 Visual Studio 中的 rdflib,如何避免该错误?

0 投票
2 回答
3641 浏览

python - PTVS 或 Visual Studio 2012 Express -desktop 中的类似内容

嘿,我有桌面版的 Visual Studio 2012 Express,我尝试安装 PTVS 2.0,它只是说找不到 Visual Studio 11,我的需求没有那么高,但我只想将 Vs 用作 Python 的 IDE,你如何安装它?

0 投票
1 回答
466 浏览

wpf - Cannot install MahApps assembly using IronPython in Visual Studio (with PTVS 2.0)

I am trying to create a MahApps styled WPF application using IronPython 2.7.3 in Visual Studio Ultimate 2012 with PTVS. However I cannot install MahApps.Metro via Nuget using the GUI. Choosing 'Install' in the Manage NuGet Packages console trows the following error by Visual Studio:

'MahApps.Metro' could not be installed because it is not compatible with any project in the solution. The package targets the following frameworks:

.NetFramwork, Verion=v4.0

.NetFramwork, Verion=v4.5

Trying out the other packages from MahApps (MahApps.Metro.Recources (and .StanAlone)) both trough an error as well:

'MahApps.Metro.Recources' could not be installed because it is not compatible with any project in the solution. The package doesn't target any framework.

I have created a new IronPython WPF application using both the .NET 4.0 and 4.5 Framework. In the documentation on MahApps I cannot find anything resembling an exclusion of certain languages even though it seems IronPython is not supported.

Any suggestions into how I could install mahapps.metro assemblies in an IronPython WPF application either using NuGet or an alternative way would be greatly appreciated.

FYI: I made a C# WPF application using the same frameworks. Here I can install the MahApss assemblies as I should and they work perfectly fine there.

0 投票
1 回答
1594 浏览

pydev - 我可以说 Visual Studio 的 Python 工具在调试方面比 Pydev+Eclipse 更好吗?

假设您已经拥有 Visual Studio,那么这个 Python Tools for Visual Studio (PTVS) 似乎是调试的更好选择。

有时,Pydev 的调试永远不会遇到某些断点而只是挂起(python 原生 PDB 仍然有效),而 PTVS 适用于这种情况。

Pydev 由 1 个人维护,而 PYVS 由一个团队(具有商业利益)维护,我可以说后者会得到更好的支持吗?