How to stop python.exe window from closing when running Fabric
Preface: Using Windows 7, Python 2.7, Fabric 1.2.2
I am trying to run Fabric script on windows, from a simple tutorial. I have my "fabfile.py" with a simple hello world program, and then I execute:
fab hello
However, every time a python.exe window pops up and immediately closes! I have no way of actually seeing what the error is. Is there any way to keep it open?
This is a different question from the others, as I have no way of "holding" the window open - because "fab" is not my scrip开发者_高级运维t, but something that is installed on the system. It fails even BEFORE it gets to my file.
On Windows, you can use python with or without the command shell. This is useful when you are running a GUI program and you do not want a associated terminal to open up.
This is possible if the python executable you are referring to is associated with pythonw.exe which is used to surpress the terminal.
Fab is a python script. It is quite possible that it is associated with this.
- See: http://docs.python.org/using/windows.html
Try running - "path/to/python.exe path/to/fab hello". This if it works, then that is certainly the case.
On a unix machine, fab script looks like this:
#!/path/to/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'Fabric==1.0.0','console_scripts','fab'
__requires__ = 'Fabric==1.0.0'
import sys
from pkg_resources import load_entry_point
sys.exit(
load_entry_point('Fabric==1.0.0', 'console_scripts', 'fab')()
)
精彩评论