Single line Webserver in Python

0 votes
Is there any single line implementation of a webserver? I know about SimpleHTTPServer and how it works but it was something different which was also using Socket and select().

I thought it was on the Python Tutor mailing list, but an archive search hasn't revealed anything, nor has a google search. Can anyone help me with the original link?
Dec 3, 2018 in Python by ana1504.k
• 6,110 points

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
It is pretty difficult to have a webserver using sockets and select() on one line of code. Not even using semicolons, you'd have to have some loops and control structures.

This is the nearest I could find. Is this something similar to what you are looking for?

$ python -m SimpleHTTPServer
Serving HTTP on port 8000 ...
Python 3 version: python -m http.server 8000
answered Dec 3, 2018 by SDeb
• 9,660 points

Related Questions In Python

0 votes
1 answer

How to add a new line in Python?

You can use '\n' for a next ...READ MORE

answered May 2, 2018 in Python by aayushi
• 750 points
0 votes
1 answer

Multiple line comment in Python

Try this ''' This is a multiline comment. I can ...READ MORE

answered May 30, 2018 in Python by charlie_brown
• 7,710 points
0 votes
1 answer

Multiple line comment in python

No, you can simply use triple codes ...READ MORE

answered Jun 27, 2018 in Python by v.liyyah
• 1,290 points
+1 vote
2 answers

Multiple line comment in Python

Try this ''' This is a multiline comment. ...READ MORE

answered Jul 31, 2018 in Python by Priyaj
• 56,120 points
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
0 votes
1 answer

In Python, how do I read a file line-by-line into a list?

with open(fname) as f:     content = f.readlines() # you ...READ MORE

answered Oct 9, 2018 in Python by SDeb
• 9,660 points
0 votes
1 answer

Indentation of Python in Notepad++

To indent the block, select the entire ...READ MORE

answered Sep 18, 2018 in Python by SDeb
• 9,660 points

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.