0

I found this answers on Stackoverflow but nothing works for me

I'm trying to hide console window, on windows at least. But with solutions above still I have window open

The only difference maybe I have to mark, I run python application with process from C# application, but as I understand it can't be a reason of some key different if I write all directives from the python code. Now I'm not sure how to figure out

Community
  • 1
  • 1
  • From .NET you could set `CreateNoWindow` in the [`ProcessStartInfo`](https://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo). I don't understand why the support for `CreateProcess` [flags](https://msdn.microsoft.com/en-us/library/ms684863) is so lacking in .NET. They should support `DETACHED_PROCESS`. – Eryk Sun Dec 07 '16 at 20:31

1 Answers1

4

You need to use the pythonw.exe program as it won't open a terminal when ran.

joebeeson
  • 4,159
  • 1
  • 22
  • 29
  • Yes I'm going to mark it as answer, thanks, one question, I want use it for executable on user computer by exist environment variable path given from C#. So question is if there any different for this case, if `Process.Start("python.exe", pyscrpt);` or as you said `Process.Start("pythonw.exe", pyscrpt);`? –  Dec 07 '16 at 17:54
  • 1
    Assuming both are on your PATH environment variable, it should work fine. – joebeeson Dec 07 '16 at 17:57