I have my script written in Python and GUI for it in C#. That is why I'd like to run Python from C# (I have to use the original Python version because of various modules which i.e. IronPython does not support). To secure the script I embedded it into the .exe file. Now, how can I get the script path? My previous code:
string python = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\python\python.exe";
// NOW it obviously does not work
string scriptPath = @"C:\..\script.py";
ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(python);
myProcessStartInfo.UseShellExecute = false;
myProcessStartInfo.RedirectStandardOutput = true;
myProcessStartInfo.Arguments = scriptPath;
Process myProcess = new Process();
myProcess.StartInfo = myProcessStartInfo;
myProcess.Start();
Assembly.GetExecutingAssembly().GetManifestResourceStream(...) won't be useful here because I don't want stream (or do I?), just the path.