www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - The problem with text output in DDT with PyD

reply "Dennis Ritchie" <dennis.ritchie mail.ru> writes:
In the Eclipse console does not work output version Python. When 
I run the executable through the CMD .\mypyd.exe, then everything 
works fine:
3.4.3 (v3.4.3: 9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 
32 bit (Intel)]

app.d
-----
import std.stdio;
import pyd.pyd, pyd.embedded;

shared static this() {
     py_init();
}

void main() {
	
	auto script = new InterpContext;
	script.py_stmts("import sys");
	
	script.py_stmts("print(sys.version)"); // prints nothing in the 
Eclipse console
}
-----

dub.json
-----
{
	"name" : "myPyD",
	"description" : "Hello World - A minimal DUB bundle.",
	"dependencies" : {
		"pyd": "~>0.9.7",
	},
	"subConfigurations": {
             "pyd": "python34",
     }
}
-----
What could be the problem?
Apr 22 2015
parent reply Bruno Medeiros <bruno.do.medeiros+dng gmail.com> writes:
On 22/04/2015 08:06, Dennis Ritchie wrote:
 In the Eclipse console does not work output version Python. When I run
 the executable through the CMD .\mypyd.exe, then everything works fine:
 3.4.3 (v3.4.3: 9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit
 (Intel)]

 app.d
 -----
 import std.stdio;
 import pyd.pyd, pyd.embedded;

 shared static this() {
      py_init();
 }

 void main() {

      auto script = new InterpContext;
      script.py_stmts("import sys");

      script.py_stmts("print(sys.version)"); // prints nothing in the
 Eclipse console
 }
 -----

 dub.json
 -----
 {
      "name" : "myPyD",
      "description" : "Hello World - A minimal DUB bundle.",
      "dependencies" : {
          "pyd": "~>0.9.7",
      },
      "subConfigurations": {
              "pyd": "python34",
      }
 }
 -----
 What could be the problem?
Isn't this again the problem about stdout not being flushed? -- Bruno Medeiros https://twitter.com/brunodomedeiros
May 01 2015
parent "Dennis Ritchie" <dennis.ritchie mail.ru> writes:
On Friday, 1 May 2015 at 09:02:23 UTC, Bruno Medeiros wrote:
 Isn't this again the problem about stdout not being flushed?
I think not. stdout.flush() does not work.
May 01 2015