windows - Problems running python program with srvany.exe -


I should present it with a complete disclaimer that I am very quick in my Python development days

I have created a simple dragon program that waits for a socket connection with a local IP address on port 20000. When it receives a connection, it pops up message alerts using win32api.

  # import Tcpintercomserver.py import socket import system win32api ip = socket.gethostbyname (socket.gethostname ()) #socket creation sock = socket.socket (socket.AF_INET, socket.SOCK_STREAM) #binding server_resress = (IP, 20000) sock.bind (Server_address) print server_address #Listen sock.listen (1) While correct: # wait for connection connection, client_address = sock.accept () win32api.MessageBox (0, 'message Text ',' Titeltex ', 0x00001000) # Close the connection connection .coz ()  

I have a mail client program that only connects to the socket that script Trying to which team takes the case to reach you (DNS name or IP address)

  # tcpintercomcli.py import socket import system # Create a TCP / IP socket socket = socket. Socket (socket.AF_INET, socket.SOCK_STREAM) # Connect the socket to the port where the server is listening to server_address = (sys.argv [1], 20000) sock.connect (server_address)  

All of this runs fine as a script, then I used to use CAX_Freeze to convert them into executables. Both were run like they were scripts.

I have now taken the server script and connected it with a service with srvany.exe and used SC command in Windows.

I installed the service using SC "Intercom" binPath = "C: \ dist \ srvany.exe"

In the Registry, under the Intercom Service Key, Key, and set the string value to the application c: \ dist \ tcpintercomserver.exe

Then I execute a "net start intercom" and the service starts successfully, and tcpintercomserver. Exe is listed as running process However, when I run tcpintercomcli.py or tcpintercomcli.exe, a E warning does not come.

I am amazed ... is there something with the CX_Freeze process that can make this mess?

The service process can not show the message box, they do not have access to the UI, they are usually system users If you are running from service, the appropriate way to display debugging and messages is using the eWinLog:


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -