小编Rob*_*son的帖子

执行后与程序交互

在PyCharm中,运行脚本后它会自动杀死它:

C:\ Users\Sean.virtualenvs\Stanley\Scripts\python.exe C:/Users/Sean/PycharmProjects/Stanley/Stanley.py

进程以退出代码0结束

如何在脚本启动后与脚本进行交互?由于没有更好的方式来表达它,我怎么能得到它

>>>

脚本运行一次后提示?

  • PyCharm社区版3.0
  • Windows 7的
  • Python 2.7

python windows ide pycharm

22
推荐指数
3
解决办法
1万
查看次数

如何以管理员身份运行终端以使用virtualenv

在PyCharm中,我将终端设置为Windows PowerShell,但是当我尝试在该终端中使用virtualenv时:

Import-Module virtualenvwrapper
Run Code Online (Sandbox Code Playgroud)

(我在启动脚本中有这个命令,但为了简单起见,仅包含命令)

我收到以下错误:

Import-Module : File C:\Users\Sean\Documents\WindowsPowerShell\Modules\virtualenvwrapper\support.psm1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:14
+ Import-Module <<<<  virtualenvwrapper
    + CategoryInfo          : NotSpecified: (:) [Import-Module], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException,Microsoft.PowerShell.Commands.ImportModuleCommand
Run Code Online (Sandbox Code Playgroud)

所以我尝试启用脚本执行(就像我 PyCharm 之外为PowerShell做的那样):

Set-ExecutionPolicy RemoteSigned
Run Code Online (Sandbox Code Playgroud)

但是得到以下错误(我通过以管理员身份运行PowerShell避免了PyCharm之外的这个错误):

Set-ExecutionPolicy : Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' is denied.
At line:1 char:20
+ Set-ExecutionPolicy <<<<  RemoteSigned
    + CategoryInfo          : NotSpecified: (:) [Set-ExecutionPolicy], UnauthorizedAccessException …
Run Code Online (Sandbox Code Playgroud)

python powershell virtualenv windows-7 pycharm

3
推荐指数
1
解决办法
3080
查看次数

标签 统计

pycharm ×2

python ×2

ide ×1

powershell ×1

virtualenv ×1

windows ×1

windows-7 ×1