Reputation: 12
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
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