[Lazarus] Tprocess to communicate with applications running

Celâl Emre ÖZ emre.ozz at gmail.com
Sun Oct 16 17:47:28 CEST 2011


Ok. thank u your answer.
I wrote a Python program. It's a xmpp client and it's running like a server.
So it's always run but pascal don't get output or send input  when python
running.

Turkish
"Pythonda yazdığım xmpp client yazılımına, pascaldan girdi göndermiyor ya da
çıktı alamıyorum.
Tprocess çalışan bir programa program  kapanana kadar  erişemiyor"

CODE

procedure TForm1.Button1Click(Sender: TObject);
var python:TProcess;
  cikti:TStringList;
  CharBuffer: array [0..511] of char;
  ReadCount: integer;
  ott:string;
  begin
python:=TProcess.Create(nil);
cikti := TStringList.Create;

python.CommandLine:= 'c:\python27\python.exe  jabber.py';
python.Execute;
ShowMessage('b');
while python.Running do begin
   ShowMessage('c');
  if python.Output.NumBytesAvailable >0 then  ShowMessage('A'); // ERRORR
DON'T SHOW
    begin
  ReadCount := Min(512, python.Output.NumBytesAvailable);
  python.Output.Read(CharBuffer, ReadCount);
  Write(ott, Copy(CharBuffer, 0, ReadCount));
  memo1.Lines.Add(ott);

  end;
end;




On Sun, Oct 16, 2011 at 6:00 PM, Felipe Monteiro de Carvalho <
felipemonteiro.carvalho at gmail.com> wrote:

> Hello,
>
> Please always put some code snipets (a full minimal program would be
> ideal) and mention your FPC version and operating system when asking
> questions.
>
> In your case also adding your question in turkish in addition to
> english (but please not only turkish) might be helpful too, since
> maybe google translate will be able to translate it. I did not
> understand most of your post.
> --
> Felipe Monteiro de Carvalho
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20111016/07da9e8a/attachment-0003.html>


More information about the Lazarus mailing list