yrifl
yrifl

Reputation: 12

Run http.server and do stuff at once, python

is there any way to figure this out? I want to run a command invisibly and do stuff at once

import os

def run():
    os.system("python -m http.server C:/Showtape/payload/payload.exe 80")
    print("Server running...")
    print("Serving payload..")

What i wanted is, I want the command running invisibly and print the "Server running...", how im gonna do that?

Upvotes: -2

Views: 161

Answers (1)

AKX
AKX

Reputation: 169338

Use the http.server module directly in your code instead of shelling out to start a new Python process. You could start the server in a thread, for instance.

This source code in http/server.py is exactly what happens when you run python -m http.server

Upvotes: 3

Related Questions