Skip to content

Commit f02af19

Browse files
update: new function for installing pip wheels locally
1 parent f2f4662 commit f02af19

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

PyCS.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,27 @@ public void Pip(string[] args)
399399
}
400400
}
401401

402+
public void PipLocal(string[] args)
403+
{
404+
ProcessStartInfo run0 = new ProcessStartInfo();
405+
run0.FileName = "python3_12\\Scripts\\pip.exe";
406+
run0.Arguments = "install " + string.Join(" ", args) + " --no-index --find-links /";
407+
run0.UseShellExecute = false;
408+
run0.RedirectStandardOutput = true;
409+
run0.CreateNoWindow = true;
410+
using (Process process = Process.Start(run0))
411+
{
412+
using (StreamReader reader = process.StandardOutput)
413+
{
414+
string result = reader.ReadToEnd();
415+
if (console)
416+
{
417+
Console.WriteLine(result);
418+
}
419+
}
420+
}
421+
}
422+
402423
public void Run(string script)
403424
{
404425
if (RunDone)

0 commit comments

Comments
 (0)