How to run a http server which serves a specific path?

后端 未结 6 738
萌比男神i
萌比男神i 2020-12-02 12:02

this is my Python3 project hiearchy:

projet
  \\
  script.py
  web
    \\
    index.html

From script.py, I would like to run a

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-02 12:46

    There's a shorter method:

    Handler = functools.partial(http.server.SimpleHTTPRequestHandler, directory='/my/dir/goes/here')
    

提交回复
热议问题