@IsaacB1/

server

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from flask import Flask
import subprocess
app = Flask(__name__)

@app.route("/")
def index():
    return "Syntax - https://server.isaacb1.repl.run/ping/<hostName>/<packetNumber>"

@app.route("/ping/<hostName>/<packetNumber>")
def ping():
  subprocess.call(["ping","-c",str(packetNumber),str(hostName)], stdin=None, stdout=None, stderr=None, shell=False)

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