我最近安装了PTVS,因为我来自C#,我习惯了Visual Studio.我虽然PTVS在C#中有像Windows Forms这样的GUI创建支持,但我很失望,因为我需要编写几个Windows应用程序,我喜欢python.
是否有任何插件可以将此功能添加到PTVS?他们计划在不久的将来对它进行编程吗?
扩大我的问题:它是否在python中存在真正的Windows应用程序IDE,具有像Visual Studio这样的"简单"GUI设计器?
在责备我之前,你必须知道我已经尝试过BOA,Dabo,SPE Python Eclipse和Netbeans插件,但没有成功......我不想要2007年的0.7项目版本......那里有什么东西可靠吗?我找不到它
谢谢
我使用Visual Studio 12和Visual Studio 1.5 的 Python 工具来开发 Python 程序。这非常有效。
现在我想在 Python 代码中检查我们是否在 Visual Studio 中运行。有没有一种简单的方法可以实现这一目标?
只是有关MS Visual Studio Express版本的问题。是否可以安装诸如Jetbrains ReSharper或VS的Python工具之类的扩展程序并将其与Visual Studio的快速版本一起使用?
我正在使用Visual Studio的Python工具,我已经设置了一个带有虚拟环境的项目,并在那里安装了Flask-RESTful.
然后,我只是复制了他们的hello world示例
from flask import Flask
from flask.ext.restful import reqparse, abort, Api, Resource
app = Flask(__name__)
app.debug = True
api = Api(app)
TODOS = {
'todo1': {'task': 'build an API'},
'todo2': {'task': '?????'},
'todo3': {'task': 'profit!'},
}
def abort_if_todo_doesnt_exist(todo_id):
if todo_id not in TODOS:
abort(404, message="Todo {} doesn't exist".format(todo_id))
parser = reqparse.RequestParser()
parser.add_argument('task', type=str)
# Todo
# show a single todo item and lets you delete them
class Todo(Resource):
def get(self, todo_id):
abort_if_todo_doesnt_exist(todo_id)
return TODOS[todo_id]
def delete(self, todo_id): …Run Code Online (Sandbox Code Playgroud) 强大的文字我重新安装了VS 2015 Update 3(来自Web安装)w/Python Tools,但Python工具似乎不再起作用了.从ActivityLog.xml,错误是:
<record>494</record>
<time>2016/07/04 15:59:16.031</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [Python Tools
Package]Source:
'Microsoft.VisualStudio.Composition'
Description: Expected 1 export(s) with contract name
"Microsoft.PythonTools.Interpreter.IInterpreterOptionsService"
but found 0 after applying applicable constraints.
#x000D;

Microsoft.VisualStudio.Composition.CompositionFailedException:
Expected 1 export(s) with contract name
"Microsoft.PythonTools.Interpreter.IInterpreterOptionsService"
but found 0 after applying applicable constraints.

Microsoft.VisualStudio.Composition.ExportProvider.GetExports
(ImportDefinition importDefinition)
 at
Microsoft.VisualStudio.Composition.ExportProvider.GetExports
[T,TMetadataView](String contractName, ImportCardinality
cardinality)
 at
Microsoft.VisualStudio.Composition.ExportProvider.GetExport
[T,TMetadataView] (String contractName)
 at
Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T]
(String contractName)
 at
Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T]
()
 at
Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue
[T] ()
 at
Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService
[T] …Run Code Online (Sandbox Code Playgroud) 所以我在 Docker 中运行了这个 Django 应用程序,并且我尝试将 VS 代码附加到它,这样我就可以调试这里是我的启动文件
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"port": 8800,
"host": "192.168.99.100",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
这是我的泊坞窗文件
FROM registry.gitlab.com/datadrivendiscovery/images/primitives:ubuntu-bionic-python36-v2020.1.9
ENV PYTHONUNBUFFERED 1
RUN mkdir /bbml
WORKDIR /bbml
COPY requirements.txt /bbml/
RUN pip install --upgrade pip
RUN pip …Run Code Online (Sandbox Code Playgroud) 我已经创建了在 C# 中嵌入 IronPython 代码的代码
public ScriptEngine GetEngine() {
if( _engine != null )
return _engine;
_engine = Python.CreateEngine();
var paths = _engine.GetSearchPaths();
paths.Add( _pythonPath );
_engine.SetSearchPaths( paths );
var runtime = _engine.Runtime;
runtime.LoadAssembly( typeof( CharacterCore ).Assembly );
return _engine;
}
public IAbility Movement() {
var engine = GetEngine();
var script = engine.CreateScriptSourceFromFile( Path.Combine( _pythonPath, "movement.py" ) );
var code = script.Compile();
var scope = engine.CreateScope();
code.Execute( scope );
return scope.GetVariable( "result" );
}
Run Code Online (Sandbox Code Playgroud)
在同一解决方案中的单独 Python 项目中使用适当的 Python 代码。代码本身有效,但如果我在 Python …
我是python的新手,刚开始学习它.
我已经为Visual Studio 2010安装了Python Tools并使用VS作为我的编辑器.
我的测试python程序运行正常,但在输出窗口的最后一行我看到以下内容
The thread 'Python Thread' (0x6f4) has exited with code 0 (0x0).
Run Code Online (Sandbox Code Playgroud)
请告诉我这个错误意味着什么,我该如何解决它.提前谢谢!
编辑:此外,每当我尝试通过按F5(开始调试)运行我的程序时,它会打开一个名为c:\ Program Files\Python32\python.exe的命令窗口,它似乎从其位置调用主python文件.它应该打开那个命令窗口一秒钟吗?我怀疑该命令窗口是否是"Python线程".
Edit_2:
对于所有未来的新探险家或蟒蛇:
如果您正在使用Visual Tools的Python工具,您可能希望使用Shift + Alt + F5而不是F5来构建程序.这将在VS内部的Python交互式窗口中输出,它不会显示烦人的命令窗口弹出窗口.
我是python的新手.我从这个网站下载了一个python项目.. native python v.1.3.1
http://alumni.media.mit.edu/~hugo/conceptnet/#download
我也在我的windows系统中安装了PTVS 2.1 VS2012,python-2.7.10.如果我去我下载python的源文件夹,它没有显示解决方案文件(如VS项目).我明白它不是在VS中开发的.但是当我尝试打开现有代码中的Project(File-> New-> Project from Existing code)时,即使安装了python,我也无法看到python IDE.
有没有其他方法可以通过VS 2012从一个解决方案文件打开整个项目?任何帮助将非常感激..