python怎么打开新窗口_python包打开新窗口

I installed python27 64-bit on windows 7. I also have setuptools and pip installed. Now when I execute command in windows console new console window appear, message is printed in it and close before i can read something from it. e. g. I installed yolk and when type yolk -l in cmd it shows me all packages in new cmd window and close immediately. What should I do if I want all messages in main command window?

解决方案

When you run pip or easy_install from the command-line, your system will be starting easy_install.exe or pip.exe. As of Python 2.7 x64 these executables have a manifest file to satisfy Windows 7's UAC requirements. You can read a little more about this here, but in short, because the applications could be running with different permissions, a new window is opened.

I don't believe there's a proper fix to get around this, short of downgrading. However, you can bypass the problem by not using the executable files.

Back up and then remove pip.exe, easy_install.exe, and fab.exe (if you have Fabric).

Create a bunch of batch files matching the original binaries' names, and put them in the same folder that had the binaries (default C:\Python27\Scripts).

easy_install.bat

@echo off

easy_install-script.py %*

pip.bat

@echo off

pip-script.py %*

fab.bat

@echo off

fab-script.py %*

With these in place, you should find your command-line use of these tools doesn't spawn a new window. Happy hacking.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值