Re: [Tutor] How to interact with the result of subprocess.call()

2017-02-01 Thread Jim
On 12/26/2016 04:48 AM, Peter Otten wrote: Jim Byrnes wrote: Is there a way to terminate subprocess and still keep LO open so pykeyboard can send it keystrokes from the script? In theory you can open Libre Office from another thread, wait a moment and then send it keystrokes from the main thr

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-26 Thread Alan Gauld via Tutor
On 25/12/16 16:33, Jim Byrnes wrote: >> (*)LO remembers its last screen setting and opens with them, >> if those screen settings are different than the ones you >> programmed for then navigation will be different and so on. > > I don't think I need to "know where stuff is" to manipulate LO. It

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-26 Thread Peter Otten
Jim Byrnes wrote: > Is there a way to terminate subprocess and still keep LO open so > pykeyboard can send it keystrokes from the script? In theory you can open Libre Office from another thread, wait a moment and then send it keystrokes from the main thread. I managed to do this with the script

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-25 Thread Alan Gauld via Tutor
On 25/12/16 17:08, boB Stepp wrote: > Then I see that I have a GCE (Gross Conceptual Error) floating around. > I thought that event loops are just intercepting the redirected stdin > from the keyboard. This is not true? If not, then how is this > working? No event loops don't use stdin. They ar

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-25 Thread boB Stepp
On Sun, Dec 25, 2016 at 3:08 AM, Alan Gauld via Tutor wrote: > > On 25/12/16 01:58, boB Stepp wrote: > > > the stdin option of call()might be used to direct the desired > > keystrokes to LO? After looking at > > The problem is that keystrokes in a GUI are not read from > stdin, they are read as e

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-25 Thread Jim Byrnes
On 12/24/2016 07:43 PM, Alan Gauld via Tutor wrote: On 25/12/16 01:21, Jim Byrnes wrote: I am not trying to automate libreoffice using subprocess. No, but you are trying to automate LO from within Python by sending it keystrokes and that's not easy. That's why I previously asked whether you r

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-25 Thread Alan Gauld via Tutor
On 25/12/16 01:58, boB Stepp wrote: > the stdin option of call()might be used to direct the desired > keystrokes to LO? After looking at The problem is that keystrokes in a GUI are not read from stdin, they are read as events from the GUI event loop. So, if LO was a CLI tool (like vim or top, sa

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-24 Thread boB Stepp
On Sat, Dec 24, 2016 at 7:21 PM, Jim Byrnes wrote: > On 12/24/2016 05:10 PM, Danny Yoo wrote: >> >> On Sat, Dec 24, 2016 at 2:40 PM, Jim Byrnes wrote: >>> >>> subprocess.call(['libreoffice', '/home/jfb/test.ods']) >>> k.tap_key(k.enter_key) >>> k.tap_key(k.enter_key) >>> >>> If I run the above co

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-24 Thread Alan Gauld via Tutor
On 25/12/16 01:21, Jim Byrnes wrote: > I am not trying to automate libreoffice using subprocess. No, but you are trying to automate LO from within Python by sending it keystrokes and that's not easy. That's why I previously asked whether you really wanted to open the LO file directly and manipul

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-24 Thread Jim Byrnes
On 12/24/2016 05:10 PM, Danny Yoo wrote: On Sat, Dec 24, 2016 at 2:40 PM, Jim Byrnes wrote: subprocess.call(['libreoffice', '/home/jfb/test.ods']) k.tap_key(k.enter_key) k.tap_key(k.enter_key) If I run the above code, libreoffice opens the test.ods spreadsheet then just sits there. When I clos

Re: [Tutor] How to interact with the result of subprocess.call()

2016-12-24 Thread Danny Yoo
On Sat, Dec 24, 2016 at 2:40 PM, Jim Byrnes wrote: > subprocess.call(['libreoffice', '/home/jfb/test.ods']) > k.tap_key(k.enter_key) > k.tap_key(k.enter_key) > > If I run the above code, libreoffice opens the test.ods spreadsheet then > just sits there. When I close libreoffice the two enter_keys

[Tutor] How to interact with the result of subprocess.call()

2016-12-24 Thread Jim Byrnes
subprocess.call(['libreoffice', '/home/jfb/test.ods']) k.tap_key(k.enter_key) k.tap_key(k.enter_key) If I run the above code, libreoffice opens the test.ods spreadsheet then just sits there. When I close libreoffice the two enter_keys are executed in the terminal that originated the script. H