The CGI can't run on EXE which packaged - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: The CGI can't run on EXE which packaged (/thread-10019.html) |
The CGI can't run on EXE which packaged - damai - May-09-2018 Hello guys: I wrote a litter program. It can running on linux and windows. But when I packaged it on Windows and run it, the html file could run normally,but when visit the CGI files, the error was happend . The commandline show: This is the code:def welcome(): print('TIP1!') print('HTTPS://AILS.TOP') print('=='*16) print('TIP2:') print('=='*16) mod_choice=str(input("TIP3:")) if mod_choice=="1": print("TIP4") fullpath=str(input("")) if os.path.isfile(fullpath): add_path(fullpath) qr_url="http://"+ip+":8080/cgi-bin/download.py?filename="+path creatQR(qr_url) else: print(colored("WARNING:TIP5!","yellow")) print() welcome() elif mod_choice=="2": print("TIP6") fullpath=str(input("")) add_path(fullpath) qr_url="http://"+ip+":8080/cgi-bin/main.py" creatQR(qr_url) elif mod_choice=='0': exit() else: print(colored("TIP7!","yellow")) print() welcome() if __name__ == '__main__': try: handler = CGIHTTPRequestHandler handler.cgi_directories = ['/cgi-bin', '/htbin'] port = 8080 server = HTTPServer(('', port), handler) ip=get_host_ip() welcome() webbrowser.open("index.html", new=0, autoraise=True) print(colored("TIP8","yellow")) print() server.serve_forever()Thanks! RE: The CGI can't run on EXE which packaged - Larz60+ - May-09-2018 Use python tags, not quotes for code RE: The CGI can't run on EXE which packaged - damai - May-10-2018 (May-09-2018, 12:40 PM)Larz60+ Wrote: Use python tags, not quotes for codeSorry,I am a beginner. Thanks for your help! |