thanks for reply
I've change my code like this :
This code could run as well on terminal when I run it using command : python3 cgi.py
but when I run it via apache server (apache2),
it cause 500 internal server error on my browser.
and on error.log apache like this :
Note : I've give permission through sudo chmod 777 on : cgi.py and /root/chat-9
My goal is : I can run cgi.py through browser / url
What should I do?