0)

Python 3.3
cx_Freeze 4.3.1
Windows XP.
################################

1)

I have a simple python code to run httpd:

httpd.py:
-----------------------------------------
# -*- coding: utf-8 -*-

import os, sys
import http.server

p = os.path.normpath(os.path.abspath(os.path.join( 
os.path.dirname(sys.argv[0]), '..', 'rootfs' )))
os.chdir(p)

server_address = ('127.0.0.1', 65535)
handler = http.server.CGIHTTPRequestHandler

handler.cgi_directories = ['/cgi-bin', '/cgi-bin/aaa']

httpd = http.server.HTTPServer(server_address, handler)

httpd.serve_forever()
-----------------------------------------

I also have simple cgi script that I put inside /cgi-bin:

cgi-script.py:
-----------------------------------------
# -*- coding: utf-8 -*-

import cgi, cgitb

cgitb.enable()

print("Content-type:text/html")
print("")
print("pypypy<br/>")
print("aaaaaaaaaaaaa")
-----------------------------------------


When I type from comand line:
"python33\python.exe httpd.py"

then in firexof I can browse adress:
http://localhost:65535/

and I can run cgi script:
http://localhost:65535/cgi-bin/cgi-script.py 
which sends me expected results.
################################

2)

I have cxfreeze_setup.py:
-----------------------------------------
# -*- coding: utf-8 -*-

import os, sys
from cx_Freeze import setup, Executable


#--- out program ---
program_in_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
program_out_path = program_in_dir
program_in_path = os.path.join(program_in_dir, "httpd.py")

build_exe_options = {'build_exe':program_out_path,
                              'create_shared_zip':False,
                              'include_in_shared_zip':False',
                              'append_script_to_exe':True }

base = None

setup( name = "httpd",
          version = "0.1",
          description = "simple http server",
          author="My self",
          author_email="m...@email.pl",

          options = {'build_exe': build_exe_options},
          executables = [Executable(program_in_path, base=base)])
-----------------------------------------

I run
"python33\python.exe cxfreeze_setup.py build_exe"

and got:
"Missing modules:
? _posixsubprocess imported from subprocess"

but httpd.exe is created.

I can run it with:
"httpd.exe"

When I type from comand line:
"python33\python.exe httpd.py"

I can browse adress:
http://localhost:65535/

but when I try tu run cgi script:
http://localhost:65535/cgi-bin/cgi-script.py 
I can wait forever.



Please help me if You can.

Best Regards
Tomek.

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
cx-freeze-users mailing list
cx-freeze-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to