combining a C# GUI with Python code?

J

John Salerno

Is it possible to construct a C# form (using Visual Studio) but write
only Python code for the events? Is there some way to tell your program
to run Python whenever code is run, since it will be all Python code
(e.g. for button presses, etc.)?

I know it's sort of silly, and it makes your program depend on .NET, but
it would be a nice and easy way to create a GUI while still writing in
Python, if it's possible.
 
?

=?iso-8859-1?q?Luis_M._Gonz=E1lez?=

Now that I think about it, I'm not sure if Visual Studio can create
GUIs with ironpython already. I guess that at this moment, its
integration is as a text editor only (I may be wrong though).

I almost forgot it, but someone was working in a little tool that
converts C# forms into python classes (for being used with ironpython).

Check it out: http://www.digitalfanatics.org/e8johan/projects/cs2py/
 
J

John Salerno

Luis said:
Now that I think about it, I'm not sure if Visual Studio can create
GUIs with ironpython already. I guess that at this moment, its
integration is as a text editor only (I may be wrong though).

I almost forgot it, but someone was working in a little tool that
converts C# forms into python classes (for being used with ironpython).

Check it out: http://www.digitalfanatics.org/e8johan/projects/cs2py/

Thanks for the information!
 
R

Rony Steelandt

Isn't it a bit overkill to implement the whole .net framework 'Just'
for a GUI ??

If you want to build quickly nice GUI's for your python program, have a
look at wxpython & wxdesigner

Rony

Is it possible to construct a C# form (using Visual Studio) but write only
Python code for the events? Is there some way to tell your program to run
Python whenever code is run, since it will be all Python code (e.g. for
button presses, etc.)?

I know it's sort of silly, and it makes your program depend on .NET, but it
would be a nice and easy way to create a GUI while still writing in Python,
if it's possible.


--
---
Rony Steelandt
BuCodi
rony dot steelandt (at) bucodi dot com

Visit the python blog at http://360.yahoo.com/bucodi
 
G

Gerard Flanagan

John said:
Is it possible to construct a C# form (using Visual Studio) but write
only Python code for the events? Is there some way to tell your program
to run Python whenever code is run, since it will be all Python code
(e.g. for button presses, etc.)?

I know it's sort of silly, and it makes your program depend on .NET, but
it would be a nice and easy way to create a GUI while still writing in
Python, if it's possible.

code here any use:

http://gflanagan.net/site/dotnet/05/RunPythonScriptFromWord.html

?

Gerard
 
J

John Salerno

Rony said:
Isn't it a bit overkill to implement the whole .net framework 'Just'
for a GUI ??

If you want to build quickly nice GUI's for your python program, have a
look at wxpython & wxdesigner

wxdesigner looked good until I had to pay. :(
 
J

James

Yes! It is. Just make your GUI in C# and assign event handlers using
Python for .NET
http://www.zope.org/Members/Brian/PythonNet/

Python for .NET is a great tool and has a minimal learning curve.
Unfortunately, it hasn't attracted enough attention from the Python
community. It does not have a .NET 2.0 release yet but it is in the
works.

Or you could use Boo with SharpDevelop. You will get Visual form design
with a very Pythonic language. But you won't get to use Python
libraries.

IronPython is getting IDE integration in the CTP releases for Visual
Studio. Maybe it will support form design in the future. I have not
tried it yet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,298
Messages
2,571,540
Members
48,275
Latest member
tetedenuit01

Latest Threads

Top