@@ -30,33 +30,33 @@ public PyCS(bool console)
3030 void CreatePython ( )
3131 {
3232 AllowTLS12 ( ) ;
33- if ( ! File . Exists ( "python-3.12.9 -embed-win32 .zip" ) )
33+ if ( ! File . Exists ( "python-3.13.5 -embed-amd64 .zip" ) )
3434 {
3535 if ( console )
3636 {
37- Console . WriteLine ( "Creating Python 3.12 resources..." ) ;
37+ Console . WriteLine ( "Creating Python 3.13 resources..." ) ;
3838 }
3939 try
4040 {
41- FileStream zip = File . Create ( "python-3.12.9 -embed-win32 .zip" ) ;
42- Assembly . GetExecutingAssembly ( ) . GetManifestResourceStream ( "CSSimpleFunctions.python-3.12.9 -embed-win32 .zip" ) . CopyTo ( zip ) ;
41+ FileStream zip = File . Create ( "python-3.13.5 -embed-amd64 .zip" ) ;
42+ Assembly . GetExecutingAssembly ( ) . GetManifestResourceStream ( "CSSimpleFunctions.python-3.13.5 -embed-amd64 .zip" ) . CopyTo ( zip ) ;
4343 zip . Close ( ) ;
4444 }
4545 catch
4646 {
47- Console . WriteLine ( "Failed to create Python 3.12 resources." ) ;
47+ Console . WriteLine ( "Failed to create Python 3.13 resources." ) ;
4848 }
4949 }
5050 else
5151 {
5252 if ( console )
5353 {
54- Console . WriteLine ( "Python 3.12 resources already created." ) ;
54+ Console . WriteLine ( "Python 3.13 resources already created." ) ;
5555 }
5656 }
5757 try
5858 {
59- using ( File . OpenRead ( "python-3.12.9 -embed-win32 .zip" ) )
59+ using ( File . OpenRead ( "python-3.13.5 -embed-amd64 .zip" ) )
6060 {
6161 exist1 = true ;
6262 }
@@ -66,46 +66,46 @@ void CreatePython()
6666 }
6767 if ( exist1 )
6868 {
69- if ( ! Directory . Exists ( "python3_12 \\ python312 " ) )
69+ if ( ! Directory . Exists ( "python3_13 \\ python313 " ) )
7070 {
7171 if ( console )
7272 {
73- Console . WriteLine ( "Extracting Python 3.12 resources..." ) ;
73+ Console . WriteLine ( "Extracting Python 3.13 resources..." ) ;
7474 }
7575 try
7676 {
77- Directory . CreateDirectory ( "python3_12 " ) ;
78- string zipPath = "python-3.12.9 -embed-win32 .zip" ;
79- string extractPath = "python3_12 " ;
77+ Directory . CreateDirectory ( "python3_13 " ) ;
78+ string zipPath = "python-3.13.5 -embed-amd64 .zip" ;
79+ string extractPath = "python3_13 " ;
8080 ZipFile . ExtractToDirectory ( zipPath , extractPath ) ;
8181
82- using ( FileStream fs = File . OpenWrite ( "python3_12 \\ python312 ._pth" ) )
82+ using ( FileStream fs = File . OpenWrite ( "python3_13 \\ python3_13 ._pth" ) )
8383 {
84- string toWrite = "python312 .zip\r \n .\r \n \r \n # Uncomment to run site.main() automatically\r \n import site\r \n " ;
84+ string toWrite = "python313 .zip\r \n .\r \n \r \n # Uncomment to run site.main() automatically\r \n import site\r \n " ;
8585 fs . Write ( Encoding . UTF8 . GetBytes ( toWrite ) , 0 , Encoding . UTF8 . GetBytes ( toWrite ) . Length ) ;
8686 }
8787
88- string zipPath1 = "python3_12 \\ python312 .zip" ;
89- string extractPath1 = "python3_12 \\ python312 " ;
88+ string zipPath1 = "python3_13 \\ python313 .zip" ;
89+ string extractPath1 = "python3_13 \\ python313 " ;
9090 ZipFile . ExtractToDirectory ( zipPath1 , extractPath1 ) ;
9191
92- FileStream sitecustomize = File . Create ( "python3_12 \\ sitecustomize.py" ) ;
92+ FileStream sitecustomize = File . Create ( "python3_13 \\ sitecustomize.py" ) ;
9393 Assembly . GetExecutingAssembly ( ) . GetManifestResourceStream ( "CSSimpleFunctions.sitecustomize.py" ) . CopyTo ( sitecustomize ) ;
9494 sitecustomize . Close ( ) ;
9595 }
9696 catch
9797 {
9898 if ( console )
9999 {
100- Console . WriteLine ( "Failed to extract Python 3.12 resources." ) ;
100+ Console . WriteLine ( "Failed to extract Python 3.13 resources." ) ;
101101 }
102102 }
103103 }
104104 else
105105 {
106106 if ( console )
107107 {
108- Console . WriteLine ( "Python 3.12 resources already extracted." ) ;
108+ Console . WriteLine ( "Python 3.13 resources already extracted." ) ;
109109 }
110110 }
111111 }
@@ -115,7 +115,7 @@ public void InstallPip()
115115 {
116116 try
117117 {
118- if ( ! File . Exists ( "python3_12 \\ get-pip.py" ) )
118+ if ( ! File . Exists ( "python3_13 \\ get-pip.py" ) )
119119 {
120120 if ( console )
121121 {
@@ -125,7 +125,7 @@ public void InstallPip()
125125 var res = webReq . GetResponse ( ) ;
126126 var content = res . GetResponseStream ( ) ;
127127
128- using ( var fileStream = File . Create ( "python3_12 \\ get-pip.py" ) )
128+ using ( var fileStream = File . Create ( "python3_13 \\ get-pip.py" ) )
129129 {
130130 content . CopyTo ( fileStream ) ;
131131 }
@@ -144,7 +144,7 @@ public void InstallPip()
144144 }
145145 try
146146 {
147- using ( File . OpenRead ( "python3_12 \\ get-pip.py" ) )
147+ using ( File . OpenRead ( "python3_13 \\ get-pip.py" ) )
148148 {
149149 exist2 = true ;
150150 }
@@ -154,7 +154,7 @@ public void InstallPip()
154154 }
155155 try
156156 {
157- using ( File . OpenRead ( "python3_12 \\ sitecustomize.py" ) )
157+ using ( File . OpenRead ( "python3_13 \\ sitecustomize.py" ) )
158158 {
159159 exist3 = true ;
160160 }
@@ -164,8 +164,8 @@ public void InstallPip()
164164 }
165165 if ( exist2 && exist3 )
166166 {
167- if ( ! Directory . Exists ( "python3_12 \\ Lib" ) || ! Directory . Exists ( "python3_12 \\ Scripts" ) ||
168- ! File . Exists ( "python3_12 \\ Scripts\\ pip.exe" ) || ! File . Exists ( "python3_12 \\ Scripts\\ pip3.12 .exe" ) || ! File . Exists ( "python3_12 \\ Scripts\\ pip3.exe" ) )
167+ if ( ! Directory . Exists ( "python3_13 \\ Lib" ) || ! Directory . Exists ( "python3_13 \\ Scripts" ) ||
168+ ! File . Exists ( "python3_13 \\ Scripts\\ pip.exe" ) || ! File . Exists ( "python3_13 \\ Scripts\\ pip3.13 .exe" ) || ! File . Exists ( "python3_13 \\ Scripts\\ pip3.exe" ) )
169169 {
170170 if ( console )
171171 {
@@ -174,8 +174,8 @@ public void InstallPip()
174174 try
175175 {
176176 ProcessStartInfo run0 = new ProcessStartInfo ( ) ;
177- run0 . FileName = "python3_12 \\ python.exe" ;
178- run0 . Arguments = "python3_12 \\ get-pip.py" ;
177+ run0 . FileName = "python3_13 \\ python.exe" ;
178+ run0 . Arguments = "python3_13 \\ get-pip.py" ;
179179 run0 . UseShellExecute = false ;
180180 run0 . RedirectStandardOutput = true ;
181181 run0 . CreateNoWindow = true ;
@@ -213,7 +213,7 @@ public void InstallPip()
213213 public void Pip ( string [ ] args )
214214 {
215215 ProcessStartInfo run0 = new ProcessStartInfo ( ) ;
216- run0 . FileName = "python3_12 \\ Scripts\\ pip.exe" ;
216+ run0 . FileName = "python3_13 \\ Scripts\\ pip.exe" ;
217217 run0 . Arguments = "install " + string . Join ( " " , args ) ;
218218 run0 . UseShellExecute = false ;
219219 run0 . RedirectStandardOutput = true ;
@@ -233,7 +233,7 @@ public void Pip(string[] args)
233233 public void PipUpgrade ( string [ ] args )
234234 {
235235 ProcessStartInfo run0 = new ProcessStartInfo ( ) ;
236- run0 . FileName = "python3_12 \\ Scripts\\ pip.exe" ;
236+ run0 . FileName = "python3_13 \\ Scripts\\ pip.exe" ;
237237 run0 . Arguments = "install --upgrade " + string . Join ( " " , args ) ;
238238 run0 . UseShellExecute = false ;
239239 run0 . RedirectStandardOutput = true ;
@@ -253,7 +253,7 @@ public void PipUpgrade(string[] args)
253253 public void PipLocal ( string [ ] args )
254254 {
255255 ProcessStartInfo run0 = new ProcessStartInfo ( ) ;
256- run0 . FileName = "python3_12 \\ Scripts\\ pip.exe" ;
256+ run0 . FileName = "python3_13 \\ Scripts\\ pip.exe" ;
257257 run0 . Arguments = "install " + string . Join ( " " , args ) + " --no-index --find-links /" ;
258258 run0 . UseShellExecute = false ;
259259 run0 . RedirectStandardOutput = true ;
@@ -272,12 +272,12 @@ public void PipLocal(string[] args)
272272
273273 public void Run ( string script )
274274 {
275- File . Create ( "python3_12 \\ main.py" ) . Close ( ) ;
276- File . WriteAllText ( "python3_12 \\ main.py" , script ) ;
275+ File . Create ( "python3_13 \\ main.py" ) . Close ( ) ;
276+ File . WriteAllText ( "python3_13 \\ main.py" , script ) ;
277277
278278 ProcessStartInfo run0 = new ProcessStartInfo ( ) ;
279- run0 . FileName = "python3_12 \\ python.exe" ;
280- run0 . Arguments = "python3_12 \\ main.py" ;
279+ run0 . FileName = "python3_13 \\ python.exe" ;
280+ run0 . Arguments = "python3_13 \\ main.py" ;
281281 run0 . UseShellExecute = false ;
282282 run0 . RedirectStandardOutput = true ;
283283 using ( Process process = Process . Start ( run0 ) )
@@ -293,7 +293,7 @@ public void Run(string script)
293293 public void RunFile ( string filePath )
294294 {
295295 ProcessStartInfo run0 = new ProcessStartInfo ( ) ;
296- run0 . FileName = "python3_12 \\ python.exe" ;
296+ run0 . FileName = "python3_13 \\ python.exe" ;
297297 run0 . Arguments = filePath ;
298298 run0 . UseShellExecute = false ;
299299 run0 . RedirectStandardOutput = true ;
@@ -309,12 +309,12 @@ public void RunFile(string filePath)
309309
310310 public string GetOutput ( string script )
311311 {
312- File . Create ( "python3_12 \\ main.py" ) . Close ( ) ;
313- File . WriteAllText ( "python3_12 \\ main.py" , script ) ;
312+ File . Create ( "python3_13 \\ main.py" ) . Close ( ) ;
313+ File . WriteAllText ( "python3_13 \\ main.py" , script ) ;
314314
315315 ProcessStartInfo run0 = new ProcessStartInfo ( ) ;
316- run0 . FileName = "python3_12 \\ python.exe" ;
317- run0 . Arguments = "python3_12 \\ main.py" ;
316+ run0 . FileName = "python3_13 \\ python.exe" ;
317+ run0 . Arguments = "python3_13 \\ main.py" ;
318318 run0 . UseShellExecute = false ;
319319 run0 . RedirectStandardOutput = true ;
320320 using ( Process process = Process . Start ( run0 ) )
@@ -330,7 +330,7 @@ public string GetOutput(string script)
330330 public string GetFileOutput ( string filePath )
331331 {
332332 ProcessStartInfo run0 = new ProcessStartInfo ( ) ;
333- run0 . FileName = "python3_12 \\ python.exe" ;
333+ run0 . FileName = "python3_13 \\ python.exe" ;
334334 run0 . Arguments = filePath ;
335335 run0 . UseShellExecute = false ;
336336 run0 . RedirectStandardOutput = true ;
0 commit comments