5

I found a way how to run a command in Windows 10 asynchronously and now I am trying to communicate with it via its stdin, stdout. I did it from Python - I ran python.exe process, sent it a string like "print(1+9)" and got a result - "10". So, now I am trying to repeat this simple task in Pharo or Squeak:

p := WindowsProcess command: 'c:\python38\python.exe'.

a := p accessor.

in := a getStdIn.
out := a getStdOut.

inHnd := a getStdInHandle.
outHnd := a getStdOutHandle.

So, the next question is - what to do with in, out, inHnd, outHnd? My feeling is that I can read/write from/to them, but I get exceptions that in, inHnd - they are ByteArray, so no way to call something like nextPutAll: or next: on them. How to communicate with this process?

kleite
  • 195
  • 1
  • 16
RandomB
  • 3,367
  • 19
  • 30

0 Answers0