티스토리 뷰


# Python for .NET

import sys
sys.path.append("..\\Frame1\\bin\\Debug")

import clr
clr.AddReference("Frame1")

import Frame1
import System
import System.Windows.Forms


class pyForm1(Frame1.Form1):
def __init__(self):
self.Text = "Python for .NET"
self.button1.Click += self.button1_Click

def button1_Click(self, sender, e):
self.Button1_Click(sender, e)


def main():
myForm1 = pyForm1()
System.Windows.Forms.Application.EnableVisualStyles()
System.Windows.Forms.Application.Run(myForm1)


if __name__ == '__main__':
main()



// C#

using System;
using System.Windows.Forms;

namespace Frame1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

public void Button1_Click(object sender, EventArgs e)
{
this.textBox1.Text = e.ToString();
MessageBox.Show(DateTime.Now.ToString());
}
}
}



Python for .NET Reference

http://pythonnet.github.io/

https://github.com/pythonnet/pythonnet

https://github.com/pythonnet/pythonnet/wiki

http://kozyarchuk.blogspot.com/2015/03/winforms-with-python-by-kozyarchuk.html

http://kozyarchuk.blogspot.com/2015/03/testing-winforms-with-python.html



'Ongoing > PythonNET' 카테고리의 다른 글

Python for .NET : Windows.Forms Example 3  (0) 2019.05.15
Python for .NET : Windows.Forms Example 1  (0) 2019.05.08
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함