Home > other >  How python bindings. Py to port, let the external users access to trigger and return
How python bindings. Py to port, let the external users access to trigger and return

Time:11-28

The script content
#! The/usr/bin/python
Print "Hello World!"

Run locally
/root @ 192 ~ # python HelloWorld. Py
Hello World!
/root @ 192 ~ #

If I want to pass the server IP: port access need
how to operate?

CodePudding user response:

Before I can use the framework used flask can let you from the outside by means of routing access python method,
Tutorial you can find many online

 the from flask import flask 

App=Flask (__name__)
@ app. The route ('/')

Def first_flask () :
Return "Hello World"

If __name__=="__main__" :
App. The run ()
  • Related