码迷,mamicode.com
首页 > Web开发 > 详细

Http server

时间:2019-06-01 13:51:30      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:port   serve   run   through   custom   follow   quick   python 2   imp   

Using Python to quickly build a local directory as a Http server
   
- Quick way to open CMD command in any folder in Windows system:

    Method 1:
    
        Press shift in the margin of the folder and right-click the mouse button.
        Select ‘Open Command Window Here‘.
        Win10: Select ‘powershell‘,can also enter "start cmd"

    Method 2:
        Enter CMD to return in the path box on this folder
    
- Steps:

    1.Install python, add installation directory to system environment variable PATH
    2.Get the local IP address through the‘ipconfig‘command
    3.Open CMD command in the HttpServer folder
    4.Run the following command
    
        python -m http.server 8010
        # python 3.0
        python -m SimpleHTTPServer 8010
        # python 2.0
        
        --> Serving HTTP on 0.0.0.0 port 8010 ...
    5.Usage:
    
        local:
        http://localhost:8010/
        webs:
        http://192.168.8.112:8010/
        # ‘192.168.8.112‘ is your IP,
        # ‘8010‘:Customizable port number

Http server

标签:port   serve   run   through   custom   follow   quick   python 2   imp   

原文地址:https://www.cnblogs.com/badweather/p/Gloria.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!