Need some help with PySide

Cancelled Posted 5 years ago Paid on delivery
Cancelled Paid on delivery

I am trying to setup a socket client/server so that I can send command line arguments to an already running app instance using PySide. In the client example in the attached script, the client checks to see if the exe process [login to view URL] "pyinstaller compiled [login to view URL]" is already running and if not it opens the exe and sends the arguments.

Example usage:

python [login to view URL] --data randomtext

The server takes the entered argument "randomtext" and prints it out to self.label.

The code works with PyQt just fine but with PySide when calling self.server.server_close() during the close event it gives this error:

File "C:\python36\lib\[login to view URL]", line 41, in _fileobj_to_fd

raise ValueError("Invalid file descriptor: {}".format(fd))

ValueError: Invalid file descriptor: -1

I know it has to be something real simple to fix it but I just can't seem to figure it out. I think [login to view URL] in the Qthread is being garbage collected or not passing the value to run correctly or something.

I'd just like this code to work properly and stop the server when the app is exited or for you to create a similar simple app that works like my example and use the built in socket methods that PySide offers "QTcpSocket etc" instead of using socketserver.

Also, if you have a better idea of how to check if the app is already open or not when the client script is ran I'd appreciate seeing what you come up with for that too. It works perfectly fine though so no need to really worry about it.

I am using Python 3.6 and regular PySide, not PySide2.

Python Software Architecture Software Development Windows Desktop

Project ID: #17110605

About the project

1 proposal Remote project Active 5 years ago