-2

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?

yrifl
  • 12
  • 2

1 Answers1

3

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

AKX
  • 152,115
  • 15
  • 115
  • 172