Hi everyone,
if you are on Python 2.7 and Windows you can try to install a nightly
snapshot of Python.Net via pip:
pip install --pre pythonnet
Make sure you have a recent version of pip installed
(http://www.pip-installer.org/en/latest/installing.html).
This is VERY experimental and the version you will get is just a nightly
snapshot of the current source on github. It should work on Windows 8.1,
though.
Please report back any problems or success of this. The current plan …
[View More]is
still to release a stable version 2.0 at some point.
The major thanks for the progress so far goes to Tony, who has contributed
most of the code changes to make this work.
Best,
David
[View Less]
Hi,
Is there an example how to format documentation in classes & methods so
that a python docstring will be produced?
I found the following in a thread a while back but it's not working for me:
### test.cs ##
using System;
using System.Runtime.InteropServices;
using Python.Runtime;
namespace PinvokeTest
{
[DocStringAttribute("Interface class to external functions.")]
public class Invoke {
[DocStringAttribute("External funtion simulation: WriteToFile(char)
will write a char to the …
[View More]terminal.")]
public static void WriteToFile(char arg) {
Console.WriteLine("Writing {0}", arg);
return;
}
}
}
[View Less]
I had the same problem and the following fix in the file
runtime/assemblymanager.cs made things work for me. I believe the problem is
that on Win 8.1 there seem to be generic types that aren't in a namespace.
My patch just skips those and thus prevents a crash. I am not sure whether
that is the right way to handle it, but it does fix the crash.
Best,
David
diff --git a/pythonnet/src/runtime/assemblymanager.cs
b/pythonnet/src/runtime/assemblymanager.cs
index 80c838d..2d369b5 100644
--- a/…
[View More]pythonnet/src/runtime/assemblymanager.cs
+++ b/pythonnet/src/runtime/assemblymanager.cs
@@ -283,7 +283,7 @@ internal class AssemblyManager {
namespaces[ns].Add(assembly, String.Empty);
}
- if (t.IsGenericTypeDefinition) {
+ if (ns !=null && t.IsGenericTypeDefinition) {
GenericUtil.Register(t);
}
}
From: PythonDotNet [mailto:pythondotnet-bounces+btribble=ea.com at
python.org] On Behalf Of Mihhail Maslakov
Sent: Wed Nov 6 11:27:45 CET 2013
To: pythondotnet at python.org
Subject: [Python.NET] Python .NET on Windows 8.1
I have been using python.net for about 5 years for my project at work.
Usually everything worked or at least there was a way to fix it. Right now,
there is a situation, that I cannot understand.
Since my PC got upgraded from W7 to W8.1 imports stopped working. It seems
that something happens on clr module initialization stage, because when I
try clr.AddReference("...") python answers: "AttributeError: 'module'
object has no attribute 'AddReference'"
When debugging with freshly built clr.pyd/Python.Runtime.dll I see that
Runtime.Initialize() finishes without exception and clr module methods are
added via InitializeModuleMembers(). Yet still, when I run my program clr
doesn't work properly and seems like import hooks are not there
(breakpoints at AddReference and other methods are not fired).
Do you have any pointers for me in this situation?
Thank you,
Mihhail Maslakov
[View Less]