在Powersh中调试Python调用

2024-04-25 11:51:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我目前正在用Python和Powershell开发一个项目。我已经将visualstudio2015设置为开发环境。我已经安装了Powershell和Python的工具。在

问题是很难调试在Python和Powershell之间传递的信息。有没有一种方法可以在调试时在平台之间进行切换?在

目前,当我从Powershell运行python脚本时,没有从python得到反馈。我只能看到什么东西被传回Powershell。在

Powershell代码示例:

Try
{
    $file_fullName = & python $pythonScript $profile_id $report_id $fileOutputPath
}
Catch
{
    $msg = command 2>&1
    Write-Host $_.Exception.Message
    Write-Host $_.Exception.ItemName
    Write-Host $_.Exception.Message
    Write-Host $msg

Tags: 工具项目方法脚本信息idhostmessage