Skip to content

Commit a1b9136

Browse files
committed
Document nPython/Console usage
Closes #358
1 parent 4fe44c4 commit a1b9136

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/console/pythonconsole.cs

+9-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55

66
namespace Python.Runtime
77
{
8+
/// <summary>
9+
/// Example of Embedding Python inside of a .NET program.
10+
/// </summary>
11+
/// <remarks>
12+
/// It has similar functionality to doing `import clr` from within Python, but this does it
13+
/// the other way around; That is, it loads Python inside of .NET program.
14+
/// See https://github.com/pythonnet/pythonnet/issues/358 for more info.
15+
/// </remarks>
816
public sealed class PythonConsole
917
{
1018
private static AssemblyLoader assemblyLoader = new AssemblyLoader();
@@ -41,7 +49,7 @@ public AssemblyLoader()
4149
AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
4250
{
4351
string shortName = args.Name.Split(',')[0];
44-
string resourceName = string.Format("{0}.dll", shortName);
52+
string resourceName = $"{shortName}.dll";
4553

4654
if (loadedAssemblies.ContainsKey(resourceName))
4755
{
@@ -60,7 +68,6 @@ public AssemblyLoader()
6068
return assembly;
6169
}
6270
}
63-
6471
return null;
6572
};
6673
}

0 commit comments

Comments
 (0)