2017-09-14 15 views
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的

回答

0

如果這是一個Python腳本比是的,你可以在你的Mac上運行它。

另請參閱Twisted Documentation Page? http://twistedmatrix.com/documents/current/core/howto/index.html

+0

我們真的需要在我們的機器上安裝twis​​td程序嗎?我只是在該tac文件中複製整個代碼並創建了一個test.py文件並運行。我可以訪問我的本地主機:8080頁面 – Ratha

+1

是的,如果你需要Twisted,它應該使用pip安裝在你的機器上,或者創建一個virtualenv並使用pip來安裝它 –

相關問題