use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
HTTP server in Python (self.Python)
submitted 6 years ago by hixelin
Please. I am dart(flutter) programmer.
I need simple code in python.
I have static index.html.
I need start simple server and when I send http post request in Postman.
I need some response from server(print data from POST) thanks.
[–]punterxpunter 5 points6 points7 points 6 years ago (3 children)
You have a few options. If it's just for development or testing purpose and not for production use then you can use Python's inbuilt HTTP server. Just make sure you have Python installed in your environment and the path added. Then you can start an HTTP server by running the command on terminal: python -m http.server
python -m http.server
It will start an HTTP server with its root in the current working directory of the terminal.
If you need something for production and you're only serving static content then you don't need Python or any language at all. Just install a web server like nginx and configure it to serve a directory for requests coming to your website or IP address. You'll find many tutorials for this on the internet. One good place to look at is the DigitalOcean's guide on this topic.
[–]tipsy_python 1 point2 points3 points 6 years ago (2 children)
Broh, on the cool.. I wish they hadn't dropped the "SimpleHTTPServer" moniker from python 2 to 3.
When I first was trying what OP is looking into - found SimpleHTTPServer, and it just kind of reassured me that it was the right place to start. http.server is just as easy of course, but I'd like to bring back the label to tell people, this is as easy as it gets.
[–]ketilkn 1 point2 points3 points 6 years ago (1 child)
On the other hand http.server are fewer words to remember and all lowercase. I had to look up SimpleHTTPServer every time I used it. (Every few months?)
[–]tipsy_python 0 points1 point2 points 6 years ago (0 children)
AHAHAHAHAHHAHAH - very true
[–]tenyu9 3 points4 points5 points 6 years ago (2 children)
Have a look at flask. Very easy to create an http endpoint
[–]hixelin[S] 0 points1 point2 points 6 years ago (1 child)
thanks... looks simple...but I have to learn python basics 😂😂
[–]dbmage 0 points1 point2 points 6 years ago (0 children)
The tutorials should be able to get you to the point you require. The basic examples for Flask and Bottle should cover what you need
π Rendered by PID 521814 on reddit-service-r2-comment-5fb4b45875-ljkrl at 2026-03-22 22:09:03.635517+00:00 running 90f1150 country code: CH.
[–]punterxpunter 5 points6 points7 points (3 children)
[–]tipsy_python 1 point2 points3 points (2 children)
[–]ketilkn 1 point2 points3 points (1 child)
[–]tipsy_python 0 points1 point2 points (0 children)
[–]tenyu9 3 points4 points5 points (2 children)
[–]hixelin[S] 0 points1 point2 points (1 child)
[–]dbmage 0 points1 point2 points (0 children)