windows下安裝tornado
聽人說在windows下安裝tornado比較困難,,於是乎去Ubuntu下鼓搗了半天,還是有bug,實在不知道哪有問題,於是乎又想試試在windows下怎麼裝,發現就幾步過程即可:
配置前提是需要安裝Python,並且需要是2.x以上的版本,現假設你的windows已經安裝了python 2.x以上的版本了。然後就可以來配置tornado
1.下載tornado包
下載地址:http://www.tornadoweb.cn/
將解壓後的資料夾放到python所在的根目錄下,注意這時候需要將文件名字改變成“tornado”(#add tornado-1.2.1亦可),如下:
裡面有個setup.py:
2.在CMD上,進入tornado目錄,執行命令python setup.py install
出現如上圖,就是安裝成功了。
3.接下來我們執行利用tornado框架寫的程式,如果執行成功,說明tornado配置成功
出現結果:
testTornado.py來源於http://demo.pythoner.com/itt2zh/ch1.html#ch1-2-1-2
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
from tornado.options import define, options
define("port", default=8000, help="run on the given port", type=int)
class IndexHandler(tornado.web.RequestHandler):
def get(self):
greeting = self.get_argument('greeting', 'Hello')
self.write(greeting + ', friendly user!')
if __name__ == "__main__":
tornado.options.parse_command_line()
app = tornado.web.Application(handlers=[(r"/", IndexHandler)])
http_server = tornado.httpserver.HTTPServer(app)
http_server.listen(options.port)
tornado.ioloop.IOLoop.instance().start()
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
相關文章
- windows 下安裝Windows
- Windows下安裝MongoDBWindowsMongoDB
- windows下安裝nodejsWindowsNodeJS
- windows下oracle安裝WindowsOracle
- windows下安裝MySQLWindowsMySql
- windows 下安裝 yarnWindowsYarn
- windows 下安裝 nvmWindows
- 在 windows下安裝rabbitmqWindowsMQ
- windows下Tomcat安裝配置WindowsTomcat
- OpenSSL + Windows 下載安裝Windows
- windows下pytorch的安裝WindowsPyTorch
- 【Redis】Windows下安裝RedisRedisWindows
- windows下安裝部署 hadoopWindowsHadoop
- webpack安裝教程windows下、mac下WebWindowsMac
- windows下編譯安裝thriftWindows編譯
- Windows環境下安裝LinuxWindowsLinux
- Windows環境下安裝NexusWindows
- MySQL下載並安裝(Windows)MySqlWindows
- Windows下安裝ElasticSearch7.6.2WindowsElasticsearch
- Windows 環境下安裝 RedisWindowsRedis
- windows下安裝Tomcat服務WindowsTomcat
- Windows 環境下安裝 LaravelWindowsLaravel
- Windows8下安裝ubuntuWindowsUbuntu
- windows下安裝Node.jsWindowsNode.js
- windows下安裝go語言WindowsGo
- Windows環境下安裝RabbitMQWindowsMQ
- 如何在windows下安裝pythonWindowsPython
- Windows下Oracle的下載與安裝WindowsOracle
- Windows 下JDK綠色免安裝WindowsJDK
- Windows下安裝git伺服器WindowsGit伺服器
- Windows下Scoop安裝、配置與使用WindowsOOP
- Windows下安裝redis客戶端WindowsRedis客戶端
- 【Mysql】Windows下安裝和配置MysqlMySqlWindows
- Windows下dlib庫python安裝(CUDA)WindowsPython
- Windows 10下Hadoop 3.2.2 安裝指南WindowsHadoop
- windows下Redis的安裝和使用WindowsRedis
- Windows下安裝 Apache PHP Mysql RedisWindowsApachePHPMySqlRedis
- Windows下CMake編譯安裝OpenCVWindows編譯OpenCV
- windows下python3.8安裝_01WindowsPython