Title: why sys.stdout returned null · Issue #370 · pythonnet/pythonnet · GitHub
Open Graph Title: why sys.stdout returned null · Issue #370 · pythonnet/pythonnet
X Title: why sys.stdout returned null · Issue #370 · pythonnet/pythonnet
Description: Environment Pythonnet version: 2.2.2 (.NET 4, x64) Python version: 3.5 Operating System: Windows 10 Details Python is embedded in my .NET application using pythonnet. I found the output of the print statement in a python script is not sh...
Open Graph Description: Environment Pythonnet version: 2.2.2 (.NET 4, x64) Python version: 3.5 Operating System: Windows 10 Details Python is embedded in my .NET application using pythonnet. I found the output of the prin...
X Description: Environment Pythonnet version: 2.2.2 (.NET 4, x64) Python version: 3.5 Operating System: Windows 10 Details Python is embedded in my .NET application using pythonnet. I found the output of the prin...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/370
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":" why sys.stdout returned null","articleBody":"### Environment\r\n\r\n- Pythonnet version: 2.2.2 (.NET 4, x64)\r\n- Python version: 3.5\r\n- Operating System: Windows 10\r\n\r\n### Details\r\nPython is embedded in my .NET application using pythonnet. I found the output of the print statement in a python script is not showing on the screen until a \"sys.stdout.flush()\" called. I don't known how to redirect sys.stdout in .NET.\r\nIn order to call the flush() method directly in .NET, I tried\r\n ```csharp\r\ndynamic sys = PythonEngine.ImportModule(\"sys\");\r\nvar stdout= sys.GetAttr(\"stdout\"); // returns None\r\n```\r\n and both sys.stdout and the variable stdout returned are None here.\r\n\r\nIn python, I tried \r\n```python\r\nimport sys\r\nprint(getattr(sys, 'stdout'))\r\n```\r\nand it outputs a `_io.TextIOWrapper` object. \r\n\r\nWhy sys.stdout returned null here? How to make the output of python print statement show automatically?\r\n\r\nThanks.","author":{"url":"https://github.com/yagweb","@type":"Person","name":"yagweb"},"datePublished":"2017-02-09T03:28:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/370/pythonnet/issues/370"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4030483b-5630-c403-f9e7-b8759569ad6e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 82DA:3DC7AA:224C53D:2E32F6B:697036D0 |
| html-safe-nonce | a435bff265e15d69cf84244bd4420158e7d9cd539dfa1819f64d7f6a9950c5eb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkRBOjNEQzdBQToyMjRDNTNEOjJFMzJGNkI6Njk3MDM2RDAiLCJ2aXNpdG9yX2lkIjoiNDI2ODMxNDA0MDY5NTAxMTAyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6cd1d93dcfc7f394fbd2d16d26efd2530913a32e9216ba603237f44064ddfbee |
| hovercard-subject-tag | issue:206393987 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonnet/pythonnet/370/issue_layout |
| twitter:image | https://opengraph.githubassets.com/56438ad03f53830c38237c285acb9fb7057d5540b6c65233febfd24123644432/pythonnet/pythonnet/issues/370 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/56438ad03f53830c38237c285acb9fb7057d5540b6c65233febfd24123644432/pythonnet/pythonnet/issues/370 |
| og:image:alt | Environment Pythonnet version: 2.2.2 (.NET 4, x64) Python version: 3.5 Operating System: Windows 10 Details Python is embedded in my .NET application using pythonnet. I found the output of the prin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yagweb |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f643964067a552f02067066d6a910b2f90a5721f |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width