![]() You can test this immediately by opening the following URL in any web browser on the computer:Īll web server activity, like accessing individual files, folders, directories, etc, will be shown in the active Python terminal window live as it happens, sort of like tailing web logs on an Apache or Nginx server. The rver in Python 3 will run in the terminal, if there is no web file in the directory than the directory index itself will be shown. Hit return and Python 3 will instantly start a simple HTTP server from the directory in which the command was executed. OR (depending on how Python 3.x is installed and named): We’re assuming you have already installed or updated to Python 3.0+ on the Mac, this variation of the command requires Python 3.0 or newer.įrom the command line, enter the following syntax exactly*: How to Start a Web HTTP Server in Python 3.0+ We’ll show you how to start a simple web server with Python 3 by using the new Python 3.0+ equivalent of the python -m SimpleHTTPServer command. Not to worry, the simple web server Python trick still works in Python 3 for Mac (and for Linux and Windows too of course, but we’re obviously covering MacOS), it’s that the command syntax is just slightly different.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |