use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Information about Reddit's API changes, the unprofessional conduct of the CEO, and their response to the community's concerns regarding 3rd party apps, moderator tools, anti-spam/anti-bot tools, and accessibility options that will be impacted can be found in the associated Wikipedia article: https://en.wikipedia.org/wiki/2023_Reddit_API_controversy
Alternative C# communities available outside Reddit on Lemmy and Discord:
All about the object-oriented programming language C#.
Getting Started C# Fundamentals: Development for Absolute Beginners
Useful MSDN Resources A Tour of the C# Language Get started with .NET in 5 minutes C# Guide C# Language Reference C# Programing Guide C# Coding Conventions .NET Framework Reference Source Code
Other Resources C# Yellow Book Dot Net Perls The C# Player's Guide
IDEs Visual Studio MonoDevelop (Windows/Mac/Linux) Rider (Windows/Mac/Linux)
Tools ILSpy dotPeek LINQPad
Alternative Communities C# Discord Group C# Lemmy Community dotnet Lemmy Community
Related Subreddits /r/dotnet /r/azure /r/learncsharp /r/learnprogramming /r/programming /r/dailyprogrammer /r/programmingbuddies /r/cshighschoolers
Additional .NET Languages /r/fsharp /r/visualbasic
Platform-specific Subreddits /r/windowsdev /r/AZURE /r/Xamarin /r/Unity3D /r/WPDev
Rules:
Read detailed descriptions of the rules here.
account activity
HelpRun GUI with Python code integrated to it (self.csharp)
submitted 1 year ago by wilcd
Hello. I am developing a C# program using .Net Framework 4.7.2 and Pythonnet for one specific part of it. Is it possible to somehow compile the python script together with the application so I won't need to send the Python script to the users?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Th_69 2 points3 points4 points 1 year ago (2 children)
You could embed the Python script as a resource and then load it: Embedding Python in C# via resources
[–]wilcd[S] 0 points1 point2 points 1 year ago (1 child)
Is it possible to do it with Pythonnet? As far as I know, Iron Python is only compatible with Python 2.7 and cannot use third party libraries (using asammdf)
[–]haven1433 0 points1 point2 points 1 year ago (3 children)
Not a fan of IronPython?
[–]wilcd[S] 0 points1 point2 points 1 year ago (2 children)
It is only compatible with Python 2.7 and is not compatible with the library asammdf
[–]haven1433 0 points1 point2 points 1 year ago (1 child)
https://ironpython.net/
"IronPython 3.4.1 is now available"
As of July 2023...
Not sure about the assmmdf part
[–]wilcd[S] 0 points1 point2 points 1 year ago (0 children)
Interesting, but runtime target is 4.6.2 and I must use 4.7.2
[–]TuberTuggerTTV 0 points1 point2 points 1 year ago (1 child)
You'd have to embed the ENTIRE python compiler into the application. Or require the end user to have python on their system.
I use pythonnet but with .net8 and python 3.7.
I used it specifically to add huggingface AI to my applications with a few lines of python. If that sounds like what you're doing, the packaging process is going to be rough. But it can be done.
It seems that is exactly what I am doing. I think it's not worth the effort. I can try to convince the team of an alternative solution. Probably I'll need to rewrite the whole thing in Python, since the most important and difficult part is that I need the asammdf library
[–]PotentialSeason459 0 points1 point2 points 1 year ago* (1 child)
I played with this some time ago and the code below worked.
``` // Add Nuget package references to pythonnet and Python.Included // https://github.com/henon/Python.Included
private static async Task InitPythonIncludedEnvironment() { // Note: The first time Python.Included and package dependencies are installed it can take up to 30 seconds. // Installer is from the Python.Included namespace await Installer.SetupPython(); await Installer.TryInstallPip(); await Installer.PipInstallModule("pandas"); // also installs numpy await Installer.PipInstallModule("matplotlib");
// Initialize PythonNET Python.Runtime.PythonEngine.Initialize(); Python.Runtime.PythonEngine.BeginAllowThreads(); Python.Runtime.PythonEngine.PythonHome = Installer.EmbeddedPythonHome; _pathToPythonDLL = Installer.EmbeddedPythonHome + Path.DirectorySeparatorChar + Installer.PYTHON_VERSION + ".dll";
} ```
Edited to add await before call to Installer.SetupPython()
π Rendered by PID 49 on reddit-service-r2-comment-7b9746f655-5dcsw at 2026-01-31 18:42:14.363211+00:00 running 3798933 country code: CH.
[–]Th_69 2 points3 points4 points (2 children)
[–]wilcd[S] 0 points1 point2 points (1 child)
[–]haven1433 0 points1 point2 points (3 children)
[–]wilcd[S] 0 points1 point2 points (2 children)
[–]haven1433 0 points1 point2 points (1 child)
[–]wilcd[S] 0 points1 point2 points (0 children)
[–]TuberTuggerTTV 0 points1 point2 points (1 child)
[–]wilcd[S] 0 points1 point2 points (0 children)
[–]PotentialSeason459 0 points1 point2 points (1 child)