Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Python
Hi,
 
I have recently started to learn Python as some structures of the language make it far easier to solve some programming issues that I need to face. However, I want to integrate it with windows forms for user interaction. This mostly is around inputs, which are then passed to the python code. I am using Visual Studio 2012 as my IDE.
 
I have used Google to find examples of how to do this but I haven't found anything particularly useful or well written. Does anyone have suggested links or sample code they can share to do this?
 
Thanks in advance,
John.
Posted 5-Dec-12 10:39am
jgrogan487
Comments
Sergey Alexandrovich Kryukov at 5-Dec-12 22:01pm
   
Do you mean .NET System.Window.Forms?
--SA
jgrogan at 6-Dec-12 3:51am
   
Hi Sergey - yes I do.
Sergey Alexandrovich Kryukov at 6-Dec-12 14:49pm
   
Please add the tag "Forms"; you are the one who is interested the most.
--SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Check out Python for .NET: and Iron Python:
http://sourceforge.net/projects/pythonnet/files/[^],
http://en.wikipedia.org/wiki/Iron_Python[^],
http://ironpython.net/[^].
 
You can also use command-line Python interpreter in you application running it through System.Diagnostics.Process.Start. You will need to redirect the streams StandardInput, StandardOutput and StandardError and work with the Python application through these streams.
 
Please see:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[^],
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardinput.aspx[^],
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardoutput.aspx[^].
 
Two last MSDN articles referenced above show code samples for redirection.
 
—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 6 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100