Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

using python for rest api

Try using Flask or FastAPI
# ---------------------------------------------------
# Flask
# Installation: "pip install flask" 
# basic app:
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'

if __name__ == '__main__':
    app.run()

# ---------------------------------------------------    
# FastAPI
# Installation: "pip install fastapi" 
# basic app:
    
from fastapi import FastAPI

app = FastAPI()

@app.get("/")
def root():
    return {"message": "Hello World"}
Comment

PREVIOUS NEXT
Code Example
Python :: a softmax function 
Python :: new print on the same line substitution python 3 
Python :: inverse of a matrix with determinant 0 python linalg 
Python :: plot multiple columns in different colors plotly 
Python :: pandas append sheet to workbook 
Python :: store command in discord.py 
Python :: python download chromebook 
Python :: foreign key django createview 
Python :: flask blueprints 
Python :: Python Tkinter CheckButton Widget 
Python :: state capitals python 
Python :: float error python 
Python :: rolling std dev of a pandas series 
Python :: python subtract between list 
Python :: install python to linux 
Python :: python normalized correlation 
Python :: list in python 3 
Python :: how to get the end of a item in a python array 
Python :: numpy shape 
Python :: python re.findall() 
Python :: int to float python 
Python :: dataframe rolling window 
Python :: if-else Conditional Statement in Python 
Python :: generative art python 
Python :: python trim zero off end of list 
Python :: get hours from datetime.timedelta in python (Django) 
Python :: pandas set one column equal to another 
Python :: stemmer nltk 
Python :: change every element of list python with map 
Python :: python how to iterate through a list of lists 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =