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

Emmanuel Rutovic <[email protected]> Tue, 3 May 2022 20:55:00 -0400
Newsgroups gmane.comp.python.dotnet
Message-ID <CAJE6Wx3AqVtzfVDgbOjGFHcuEyyHCVC7y+_TMmiuE7aPz0V9jQ@mail.gmail.com>
--===============4172325215184449653==
Content-Type: multipart/alternative; boundary="000000000000d197ff05de25134e"

--000000000000d197ff05de25134e
Content-Type: text/plain; charset="UTF-8"

Hi David,

1. I am personally switching between VS Code (Python) and VS 2022 (C#/WPF).
2. Unfortunately, no.

Hope this helps,
Manu.

On Tue, May 3, 2022 at 2:30 PM David Epstein <[email protected]>
wrote:

> 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
>    the 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). However, please note 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]>
> 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. working 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 functionality like docking).
>
> Here are the details. I'm creating a graphical, desktop, turn-based
> game/simulation based on the logic programming system, Clingo
> <https://potassco.org/>, which is accessible from Python (via import
> clingo <https://pypi.org/project/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 editor, 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 might require me to use C# (not sure).
>
> What do you think?
>
> Thank you,
> -david
> _______________________________________________
> 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]
>
> _______________________________________________
> 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]
>

--000000000000d197ff05de25134e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi David,<div><br></div><div>1. I am personally switching =
between VS Code (Python) and VS 2022 (C#/WPF).</div><div>2. Unfortunately, =
no.=C2=A0</div><div><br></div><div>Hope this helps,</div><div>Manu.</div></=
div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On=
 Tue, May 3, 2022 at 2:30 PM David Epstein &lt;<a href=3D"mailto:davidlepst=
[email protected]">[email protected]</a>&gt; wrote:<br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-wid=
th:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-l=
eft:1ex">




<div 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=
&#39;ve only found the Python.NET tests, which each show how to perform one=
 specific 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"gmail-m_1345345223465513368appendonsend"></div>
<hr style=3D"display:inline-block;width:98%">
<div id=3D"gmail-m_1345345223465513368divRplyFwdMsg" dir=3D"ltr"><font face=
=3D"Calibri, sans-serif" style=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;<a href=3D"mai=
lto:[email protected]" target=3D"_blank">[email protected]</a>&gt;<br=
>
<b>Subject:</b> [Python.NET] Re: WPF or other GUI with PythonNet &amp; Clin=
go</font>
<div>=C2=A0</div>
</div>
<div>
<div dir=3D"ltr">Hi David,
<div><br>
</div>
<div>That&#39;s definitely=C2=A0possible. I am doing something similar with=
 the tool that I am developing=C2=A0(see
<a href=3D"http://www.simba.io" target=3D"_blank">www.simba.io</a>). Howeve=
r, please note that 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=C2=A0a lot of effort=C2=A0on WPF recently, If yo=
u are familiar with=C2=A0XAML/C#, you can also look at .Net MAUI, the Windo=
ws APP Sdk=C2=A0(Project Reunion) or AvaloniaUI.</div>
<div><br>
</div>
<div>I hope this=C2=A0helps.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Emmanuel.=C2=A0</div>
</div>
<br>
<div>
<div dir=3D"ltr">On Tue, May 3, 2022 at 11:39 AM David Epstein &lt;<a href=
=3D"mailto:[email protected]" target=3D"_blank">davidlepstein@outlo=
ok.com</a>&gt; wrote:<br>
</div>
<blockquote style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-=
left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div dir=3D"ltr">
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
Hi folks! <br>
</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)">
This is my first post. In short, I&#39;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&#39;s view models and views (th=
at rely on C# and WPF controls). If it is
 a good idea, I&#39;d welcome advice (e.g. working with PythonNet within a =
Visual Studio C# project). If it is
<i>not</i> a good idea, I&#39;d welcome alternatives (e.g. Python GUIs with=
 desktop functionality like docking).<br>
</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)">
Here are the details. I&#39;m creating a graphical, desktop, turn-based gam=
e/simulation 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;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
However, I&#39;ve only created GUI&#39;s using C# frameworks (WPF &amp; Xam=
arin.Forms). Since I&#39;d like this application to include docking, data g=
rid, rich-text editor, tooltips, and other Windows desktop staples, I&#39;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&#39; WPF controls</a> and technical support, the latter of which=
 might require me to use C# (not sure).</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)">
What do you think?<br>
</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)">
Thank you,</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
: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>
</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>

--000000000000d197ff05de25134e--

--===============4172325215184449653==
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]

--===============4172325215184449653==--