Uh oh!
There was an error while loading. Please reload this page.
forked from kiwon0319/GFDecompress
- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPython.cs
More file actions
Latest commit
33 lines (30 loc) · 1.09 KB
/
Copy pathPython.cs
File metadata and controls
33 lines (30 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
usingNLog.Targets;
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Diagnostics;
usingSystem.IO;
usingSystem.Linq;
usingSystem.Security.Cryptography;
usingSystem.Text;
usingSystem.Threading.Tasks;
namespaceGFDecompress
{
classPython
{
publicstaticvoidrun(stringcmd,stringargs,refStreamReaderoutput,refStreamReadererror){
ProcessStartInfostart=newProcessStartInfo();
stringenvVar=Environment.GetEnvironmentVariable("LOCALAPPDATA");
start.FileName=$@"{envVar}\\Programs\\Python\\Python38-32\\python.exe";
start.Arguments=string.Format("{0} {1}",cmd,args);
start.UseShellExecute=false;
start.CreateNoWindow=false;
start.WorkingDirectory=Directory.GetCurrentDirectory();
start.RedirectStandardOutput=true;
start.RedirectStandardError=true;
using(Processprocess=Process.Start(start)){
output=process.StandardOutput;
error=process.StandardError;
}
}
}
}