| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -205,12 +205,13 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true, | |||
| 205 | 205 | Runtime.PyDict_SetItemString(module_globals, "__builtins__", builtins); | |
| 206 | 206 | ||
| 207 | 207 | Assembly assembly = Assembly.GetExecutingAssembly(); | |
| 208 | - //using (Stream stream = assembly.GetManifestResourceStream("clr.py")) | ||
| 209 | - //using (var reader = new StreamReader(stream)) | ||
| 208 | + // use this to check what the correct path to the resource is: | ||
| 209 | + //string[] names = assembly.GetManifestResourceNames(); | ||
| 210 | + using (Stream stream = assembly.GetManifestResourceStream("Python.Runtime.resources.clr.py")) | ||
| 211 | + using (var reader = new StreamReader(stream)) | ||
| 210 | 212 | { | |
| 211 | 213 | // add the contents of clr.py to the module | |
| 212 | - //string clr_py = reader.ReadToEnd(); | ||
| 213 | - string clr_py = File.ReadAllText("clr.py"); | ||
| 214 | + string clr_py = reader.ReadToEnd(); | ||
| 214 | 215 | Exec(clr_py, module_globals, locals.Handle); | |
| 215 | 216 | } | |
| 216 | 217 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments