[Python.NET] Re: WPF or other GUI with PythonNet & Clingo

David Epstein <[email protected]> Tue, 3 May 2022 18:29:28 +0000
Newsgroups gmane.comp.python.dotnet
Message-ID <DM5PR1201MB018756871A10D4A7863D118FBEC09@DM5PR1201MB0187.namprd12.prod.outlook.com>
--===============2684507045961341361==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_DM5PR1201MB018756871A10D4A7863D118FBEC09DM5PR1201MB0187_"

--_000_DM5PR1201MB018756871A10D4A7863D118FBEC09DM5PR1201MB0187_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Thanks Emmanuel. Two quick questions:


  1.  What IDE do you recommend for working with Python.NET embedded in C#-=
-Visual Studio?
  2.
  3.  Have you found any complete embedding example apps? I've only found t=
he Python.NET tests, which each show how to perform one specific thing, but=
 not how to structure a full app.


________________________________
From: Emmanuel Rutovic <[email protected]>
Sent: Tuesday, May 3, 2022 8:32 PM
To: A list for users and developers of Python.NET <[email protected]>
Subject: [Python.NET] Re: WPF or other GUI with PythonNet & Clingo

Hi David,

That's definitely possible. I am doing something similar with the tool that=
 I am developing (see www.simba.io<http://www.simba.io>). However, please n=
ote that if you base your UI on WPF:
- Your app will be only compatible with Windows
- The size of the Python module might be quite large

Microsoft did not put a lot of effort on WPF recently, If you are familiar =
with XAML/C#, you can also look at .Net MAUI, the Windows APP Sdk (Project =
Reunion) or AvaloniaUI.

I hope this helps.

Regards,
Emmanuel.

On Tue, May 3, 2022 at 11:39 AM David Epstein <[email protected]<ma=
ilto:[email protected]>> wrote:
Hi folks!

This is my first post. In short, I'd like to know whether it is a good idea=
 to use PythonNet within a MVVM framework to glue the models (that rely on =
a Python package) to the user interface's view models and views (that rely =
on C# and WPF controls). If it is a good idea, I'd welcome advice (e.g. wor=
king with PythonNet within a Visual Studio C# project). If it is not a good=
 idea, I'd welcome alternatives (e.g. Python GUIs with desktop functionalit=
y like docking).

Here are the details. I'm creating a graphical, desktop, turn-based game/si=
mulation based on the logic programming system, Clingo<https://potassco.org=
/>, which is accessible from Python (via import clingo<https://pypi.org/pro=
ject/clingo/>). While other language bindings exist for Clingo (including a=
 nascent C# one<https://github.com/NEKERAFA/clingo-cs>), the Python binding=
 appears to be the most complete and most popular.

However, I've only created GUI's using C# frameworks (WPF & Xamarin.Forms).=
 Since I'd like this application to include docking, data grid, rich-text e=
ditor, tooltips, and other Windows desktop staples, I'm inclined to use WPF=
. I may have access to DevExpress' WPF controls<https://www.devexpress.com/=
products/net/controls/wpf/> and technical support, the latter of which migh=
t require me to use C# (not sure).

What do you think?

Thank you,
-david
_______________________________________________
PythonNet mailing list -- [email protected]<mailto:[email protected]>
To unsubscribe send an email to [email protected]<mailto:pythonnet=
[email protected]>
https://mail.python.org/mailman3/lists/pythonnet.python.org/
Member address: [email protected]

--_000_DM5PR1201MB018756871A10D4A7863D118FBEC09DM5PR1201MB0187_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
Thanks Emmanuel. Two quick questions:</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<ol>
<li><span>What IDE do you recommend for working with Python.NET embedded in=
 C#--Visual Studio?</span></li><li style=3D"display:block"><span><br>
</span></li><li><span>Have you found any complete embedding example apps? I=
've only found the Python.NET tests, which each show how to perform one spe=
cific thing, but not how to structure a full app.<br>
</span></li></ol>
</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<br>
</div>
<br>
<div id=3D"appendonsend"></div>
<hr style=3D"display:inline-block;width:98%" tabindex=3D"-1">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st=
yle=3D"font-size:11pt" color=3D"#000000"><b>From:</b> Emmanuel Rutovic &lt;=
[email protected]&gt;<br>
<b>Sent:</b> Tuesday, May 3, 2022 8:32 PM<br>
<b>To:</b> A list for users and developers of Python.NET &lt;pythonnet@pyth=
on.org&gt;<br>
<b>Subject:</b> [Python.NET] Re: WPF or other GUI with PythonNet &amp; Clin=
go</font>
<div>&nbsp;</div>
</div>
<div>
<div dir=3D"ltr">Hi David,
<div><br>
</div>
<div>That's definitely&nbsp;possible. I am doing something similar with the=
 tool that I am developing&nbsp;(see
<a href=3D"http://www.simba.io">www.simba.io</a>). However, please note tha=
t if you base your UI on WPF:</div>
<div>- Your app will be only compatible with Windows</div>
<div>- The size of the Python module might be quite large</div>
<div><br>
</div>
<div>Microsoft did not put&nbsp;a lot of effort&nbsp;on WPF recently, If yo=
u are familiar with&nbsp;XAML/C#, you can also look at .Net MAUI, the Windo=
ws APP Sdk&nbsp;(Project Reunion) or AvaloniaUI.</div>
<div><br>
</div>
<div>I hope this&nbsp;helps.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Emmanuel.&nbsp;</div>
</div>
<br>
<div class=3D"x_gmail_quote">
<div dir=3D"ltr" class=3D"x_gmail_attr">On Tue, May 3, 2022 at 11:39 AM Dav=
id Epstein &lt;<a href=3D"mailto:[email protected]">davidlepstein@o=
utlook.com</a>&gt; wrote:<br>
</div>
<blockquote class=3D"x_gmail_quote" style=3D"margin:0px 0px 0px 0.8ex; bord=
er-left-width:1px; border-left-style:solid; border-left-color:rgb(204,204,2=
04); padding-left:1ex">
<div dir=3D"ltr">
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
Hi folks! <br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
This is my first post. In short, I'd like to know whether it is a good idea=
 to use PythonNet within a MVVM framework to glue the models (that rely on =
a Python package) to the user interface's view models and views (that rely =
on C# and WPF controls). If it is
 a good idea, I'd welcome advice (e.g. working with PythonNet within a Visu=
al Studio C# project). If it is
<i>not</i> a good idea, I'd welcome alternatives (e.g. Python GUIs with des=
ktop functionality like docking).<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
Here are the details. I'm creating a graphical, desktop, turn-based game/si=
mulation based on the logic programming system,
<a href=3D"https://potassco.org/" title=3D"https://potassco.org/" target=3D=
"_blank">Clingo</a>, which is accessible from Python (via
<a href=3D"https://pypi.org/project/clingo/" title=3D"https://pypi.org/proj=
ect/clingo/" target=3D"_blank">
import clingo</a>). While other language bindings exist for Clingo (includi=
ng a <a href=3D"https://github.com/NEKERAFA/clingo-cs" title=3D"https://git=
hub.com/NEKERAFA/clingo-cs" target=3D"_blank">
nascent C# one</a>), the Python binding appears to be the most complete and=
 most popular.<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
However, I've only created GUI's using C# frameworks (WPF &amp; Xamarin.For=
ms). Since I'd like this application to include docking, data grid, rich-te=
xt editor, tooltips, and other Windows desktop staples, I'm inclined to use=
 WPF. I may have access to
<a href=3D"https://www.devexpress.com/products/net/controls/wpf/" title=3D"=
https://www.devexpress.com/products/net/controls/wpf/" target=3D"_blank">
DevExpress' WPF controls</a> and technical support, the latter of which mig=
ht require me to use C# (not sure).</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
What do you think?<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
Thank you,</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif; font-size:12pt; col=
or:rgb(0,0,0)">
-david<br>
</div>
</div>
_______________________________________________<br>
PythonNet mailing list -- <a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a><br>
To unsubscribe send an email to <a href=3D"mailto:[email protected]=
g" target=3D"_blank">
[email protected]</a><br>
<a href=3D"https://mail.python.org/mailman3/lists/pythonnet.python.org/" re=
l=3D"noreferrer" target=3D"_blank">https://mail.python.org/mailman3/lists/p=
ythonnet.python.org/</a><br>
Member address: [email protected]<br>
</blockquote>
</div>
</div>
</body>
</html>

--_000_DM5PR1201MB018756871A10D4A7863D118FBEC09DM5PR1201MB0187_--

--===============2684507045961341361==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
PythonNet mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/pythonnet.python.org/
Member address: [email protected]

--===============2684507045961341361==--