Hi!
Can someone tell me how to set PYTHONPATH variable in code when working with Python.Runtime.dll without changing the value in the system variables before.
Thanks
SHARON
________________________________
PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any …
[View More]review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
[View Less]
With Ironpython 2.7 the following code works. Not so with python for .Net
where only a blank Form is displayed.
Used python for .Net is compiled from trunk of May 26, 2012 python 2.6 and
clr4.
Any help is appreciated.
Cheers
Manfred
#-------------------------
import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
import System.Windows.Forms as WinForms
import System
from System.Drawing import Size, Point
SAMPLE_DATA = [
('Joe', 23),
('Bob', 8),
('Thomas', …
[View More]32),
('Patrick', 41),
('Kathy', 19),
('Sue', 77),
]
class Person(System.Object):
def __init__(self, name, age):
self.Name = name
self.Age = age
people = []
for name, age in SAMPLE_DATA:
people.append(Person(name, age))
f=WinForms.Form()
f.Text = u"DataGridView From Python"
h = WinForms.SystemInformation.CaptionHeight
fdgv=WinForms.DataGridView()
fdgv.AutoSize = True
fdgv.Dock = WinForms.DockStyle.Fill
fdgv.DataSource = people
fdgv.Refresh()
f.Controls.Add(fdgv)
WinForms.Application.Run(f)
[View Less]