Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Python.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@

static void RunHelloWorld(IPythonEnvironment env)
{
var helloWorld = env.HelloWorld();
var helloWorld = env.HelloWorld();
helloWorld.FormatName("Python");
}
4 changes: 4 additions & 0 deletions Python.Console/Python.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
<PackageReference Include="python" Version="3.12.4" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Python.Core\Python.Core.csproj" />
</ItemGroup>

</Project>
10 changes: 8 additions & 2 deletions Python.Core/Python.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
</PropertyGroup>

<ItemGroup>
<AdicionalFiles Include="hello_world.py">
<AdditionalFiles Include="hello_world.py">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</AdicionalFiles>
</AdditionalFiles>
</ItemGroup>

<ItemGroup>
<PackageReference Include="CSnakes.Runtime" Version="1.*-*" />
</ItemGroup>


</Project>
2 changes: 1 addition & 1 deletion Python.Core/hello_world.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def format_name(name, max_length):
def format_name(name: str, max_length: int = 100) -> str:
return "Hello {}".format(name.capitalize())[:max_length]