0
我在我的MAC中安裝了Twisted。如何在MAC中運行Twisted(python)程序?
$ python
Python 2.7.10 (default, Oct 23 2015, 18:05:06)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import twisted
>>> twisted.__version__
'13.1.0'
>>> import OpenSSL
>>> import twisted.internet.ssl
>>> twisted.internet.ssl.SSL
<module 'OpenSSL.SSL' from '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL/SSL.so'>
>>>
我命名爲test.tac
一個測試程序,我怎麼能運行在MAC?我可以將它作爲python腳本運行嗎?
P.S:IM全新的Python的
我們真的需要在我們的機器上安裝twistd程序嗎?我只是在該tac文件中複製整個代碼並創建了一個test.py文件並運行。我可以訪問我的本地主機:8080頁面 – Ratha
是的,如果你需要Twisted,它應該使用pip安裝在你的機器上,或者創建一個virtualenv並使用pip來安裝它 –