Hello,
I've put the CLR and runtime dll's in my standard windows 2.4.1 installation and
I'm getting the following(see below) crash and error information. It appears the
runtime dll isn't being found. Yet they're both in the python/dll directory. I
did have the binary pythonDotNet installed. But have uninstalled it.
Can anyone shed some light on what's going on?
Regards,
Guy
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" …
[View More]or "license" for more information.
>>> import CLR.System as System
Unhandled Exception: System.IO.FileNotFoundException: File or assembly name Pyth
on.Runtime, or one of its dependencies, was not found.
File name: "Python.Runtime"
at CLRModule.initCLR()
=== Pre-bind state information ===
LOG: DisplayName = Python.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyTo
ken=null
(Fully-specified)
LOG: Appbase = e:\python24\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: Application configuration file does not exist.
LOG: Policy not being applied to reference at this time (private, custom, partia
l, or location-based assembly bind).
LOG: Post-policy reference: Python.Runtime, Version=1.0.0.0, Culture=neutral, Pu
blicKeyToken=null
LOG: Attempting download of new URL file:///e:/python24/Python.Runtime.DLL.
LOG: Attempting download of new URL file:///e:/python24/Python.Runtime/Python.Ru
ntime.DLL.
LOG: Attempting download of new URL file:///e:/python24/Python.Runtime.EXE.
LOG: Attempting download of new URL file:///e:/python24/Python.Runtime/Python.Ru
ntime.EXE.
[View Less]
hello,
It is currently possible to add new attributes using the standard python
notation, to existing C# objects.
like that:
#C is C# class
cInstance = C()
c.NewProperty = "hop" #NewProperty Property is not defined at the C# level.
My questions:
1: is this the desired/expected behaviour?
2: is this usable at C# level (I should test, I suppose, using
introspection ;-)
--> I find it sometimes annoying not to know that I am defining a new
attribute, because such dynamicity is not …
[View More]expected at C# level (well at
python level).
thanks a lot for your help,
Stan.
[View Less]
Hello
I'm trying to use Pythonnet put when I try to start the python.exe I get
an error.(see figure)
I have tried to run the console application from my VS environment. And
tried to debug it.
The exception is comming in this function (see Runtime.cs):
[DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl,
ExactSpelling=true, CharSet=CharSet.Ansi)]
internal unsafe static extern IntPtr
PyTuple_GetItem(IntPtr pointer, int index);
Regards
Steven Cool
Development …
[View More]Engineer
Protronic NV
Rozendaalstraat 53
BE-8900 Ieper
P: + 32 (0)57 22 47 09
E-mail: scl(a)protronic.com
**** DISCLAIMER **** The contents of this e-mail are intended for the named addressee only. It contains information which may be confidential and which may also be privileged. Unless you are the named addressee (or authorised to receive for the addressee) you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it. Further, we make every effort to keep our network free from viruses. However, you do need to verify that this email and any attachments are free of viruses as we can take no responsibility for any computer virus which might be transferred by way of this e-mail.
[View Less]
Hi all -
I'm happy to announce the release of Python for .NET 1.0 RC2.
You can download it from:
http://www.zope.org/Members/Brian/PythonNet
Highlights of this release:
- Changed some uses of Finalize as a static method name that confused
the
Mono compiler and people reading the code. Note that this may be a
breaking change if anyone was calling PythonEngine.Finalize(). If so,
you should now use PythonEngine.Shutdown().
- Tweaked assembly lookup to ensure that …
[View More]assemblies can be found in the
current working directory, even after changing directories using
things
like os.chdir() from Python.
- Fixed some incorrect finalizers (thanks to Greg Chapman for the
report)
that may have caused some threading oddities.
- Tweaked support for out and ref parameters. If a method has a return
type of void and a single ref or out parameter, that parameter will be
returned as the result of the method. This matches the current
behavior
of IronPython and makes it more likely that code can be moved between
Python for .NET and IP in the future.
- Refactored part of the assembly manager to remove a potential case of
thread-deadlock in multi-threaded applications.
- Added a __str__ method to managed exceptions that returns the Message
attribute of the exception and the StackTrace (if available).
Thanks to all who have sent in issue reports, patches and suggestions
for this and past releases.
Enjoy! ;)
Brian Lloyd brian(a)zope.com
V.P. Engineering 540.361.1716
Zope Corporation http://www.zope.com
[View Less]
Python for .NET 1.0 beta 5 is now available - you can download
it from:
http://www.zope.org/Members/Brian/PythonNet/
Python for .NET is a near-seamless integration of Python with the
.NET common language runtime. For more details, see the README:
http://www.zope.org/Members/Brian/PythonNet/README.html
The beta 5 release features a refactoring of thread management
support, making the runtime stable for multi-threaded applications,
as well as several improvements and bug-fixes.
…
[View More]Special thanks to all who sent in thread-related scenarios and test
cases! I have tried to incorporate as many of these as possible into
the unit tests - if you still have problems that you suspect may be
related to threading or interpreter lock issues, please let me know
asap.
There is also now a mailing list for discussion, questions and
issues related to Python for .NET at: pythondotnet(a)python.org.
To subscribe to the mailing list or read the online archives, see:
http://mail.python.org/mailman/listinfo/pythondotnet
Brian Lloyd brian(a)zope.com
V.P. Engineering 540.361.1716
Zope Corporation http://www.zope.com
[View Less]
Find attached script for a windows.Form. Is this a bug? When loading the data
into the listview from a list of tuples:
data = [("one","test one"),("two","test two"), ("three","test three")]
for item in data:
temp = WF.ListViewItem(item[0])
temp.SubItems.Add(item[1])
self.listView.Items.Add(temp)
The rows are filled with the first and second characters of the first string
rather than the relevant tuple strings.
Winforms is pretty cool otherwise.
Guy
import CLR
from CLR …
[View More]import System
import CLR.System.Windows.Forms as WF
from CLR.System.Drawing import Size, Point, Color
class ScriptForm(WF.Form):
"""A simple hello world app that demonstrates the essentials of
WF programming and event-based programming in Python."""
def __init__(self):
self.Text = "Python scripting for the Revit API"
#self.AutoScaleBaseSize = Size(5, 13)
self.ClientSize = Size(500, 300)
h = WF.SystemInformation.CaptionHeight
self.MinimumSize = Size(300, (100 + h))
self.FormBorderStyle = WF.FormBorderStyle.FixedDialog
self.MinimizeBox = False
self.MaximizeBox = False
self.StartPosition = WF.FormStartPosition.CenterScreen
self.components = System.ComponentModel.Container()
# Create the ListView
self.listView = WF.ListView()
self.listView.Location = Point(5,5)
self.listView.Width = 370
self.listView.Height = self.ClientSize.Height-10
self.listView.TabIndex = 0
self.formatLV()
self.loaddata()
# Create the run button
self.runBut = WF.Button()
self.runBut.Location = Point(400, 100)
self.runBut.BackColor = Color.GreenYellow
self.runBut.TabIndex = 1
self.runBut.Text = "Run Script"
# Create the Cancel button
self.CanBut = WF.Button()
self.CanBut.Location = Point(400, 150)
self.CanBut.TabIndex = 2
self.CanBut.Text = "Cancel"
# Register the event handlers
self.runBut.Click += self.runScript_Click
self.CanBut.Click += self.Cancel_Click
# Add the controls to the form
self.Controls.Add(self.listView)
self.Controls.Add(self.runBut)
self.Controls.Add(self.CanBut)
def runScript_Click(self, sender, args):
""" Get and Run the selected script"""
WF.MessageBox.Show("Run script")
#return "script"
def Cancel_Click(self, sender, args):
"""Cancel don't run anything"""
#return "cancel"
self.components.Dispose()
WF.Form.Dispose(self)
self.Close()
def formatLV(self):
self.listView.View = WF.View.Details
self.listView.LabelEdit = False
self.listView.AllowColumnReorder = False
self.listView.GridLines = True
self.listView.FullRowSelect = True
self.listView.Sorting = WF.SortOrder.Ascending
#now do columns
self.listView.Columns.Add("Script Name", 100,WF.HorizontalAlignment.Left)
self.listView.Columns.Add("Description", 266,WF.HorizontalAlignment.Left)
def loaddata(self):
data = [("one","test one"),("two","test two"), ("three","test three")]
for item in data:
temp = WF.ListViewItem(item[0])
temp.SubItems.Add(item[1])
self.listView.Items.Add(temp)
def run(self):
WF.Application.Run(self)
self.components.Dispose()
WF.Form.Dispose(self)
self.Close()
def main():
ScriptForm().run()
if __name__ == '__main__':
main()
[View Less]