Trying to find the PID of a Display object when creating it using Pyvirtualdisplay. The display an Xvfb virtual framebuffer.

We have tried looking at the .pid property, but it is not present. Also, the .process property is non existant. Both raise an AttributeError error when accessed.

Thanks very much! Any help will be appreciated!

有帮助吗?

解决方案

The answer to this situation is to actually use the .pid property on the display object, BUT, it is only present after the display has had the start method called on it. That means, if you need to get the PID for the process, the display has to be started first.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top