I am trying to do a script that is hosting my file on my local network, here's my code :
import os
import getpass
os.system('python -m http.server --directory C:/Users/'+getpass.getuser())
But the probleme is that the http console is showing on my Desktop and that's annoying ! so I tried to hide by renaming the file in .pyw but it's not working.
Have you any idea on how to hide this console ? Thank you :D
Assuming you're on Linux (or other unix based OS), you can detach the process from the console after starting the server.
Here is one way to do it with
screencommandAnd then
Where
script.pyis the snippet you have shared.Reference for the flags