Can you access these same functions in C#? Maybe what you have to do is write a wrapper library for your VB.NET library in C#, and have Python access the library through the the wrapper.

- Feihong


Kyle Stevens <kyle.stevens@thenortheastgroup.com> wrote:
We have an application that was developed in Visual Basic, and would
like to use Python for .NET to extend it. I've played around with it a
bit, and everything works fine if it is within a class in the .Net assembly.

However, there are a number of components that exist as public functions
within a module. I cannot seem to access them from Python for .NET.

My latest session is shown below, where I try to import and use the
function, "NonQuery" within the module, "SQL_Module" to no avail.

Thanks for any help, and thanks for this wonderful piece of software. I
can't wait to start programming some things with this instead of Visual
Basic.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

Z:\>\\buffalo02\share\IT\python\python\python.exe
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import Nepco4
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named Nepco4
>>> from NepcoV2 import Order
>>> from NepcoV2 import NonQuery
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name NonQuery
>>> from NepcoV2 import SQL_Module.NonQuery
File "", line 1
from NepcoV2 import SQL_Module.NonQuery
^
SyntaxError: invalid syntax
>>> from NepcoV2.SQL_Module import NonQuery
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named SQL_Module
>>> import Nepco4.NepcoV2
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named Nepco4.NepcoV2
>>> from Nepco4 import NepcoV2
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named Nepco4
>>> from NepcoV2 import SQL_Module
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name SQL_Module
>>> from NepcoV2 import SQL_Module5
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name SQL_Module5
>>> from NepcoV2 import SQL_Modulf
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name SQL_Modulf
>>> from NepcoV2 import Shipping_Detail_Report
>>> from NepcoV2 import *
>>> NonQuery()
Traceback (most recent call last):
File "", line 1, in
NameError: name 'NonQuery' is not defined
>>> NepcoV2.NonQuery()
Traceback (most recent call last):
File "", line 1, in
NameError: name 'NepcoV2' is not defined
>>>
_________________________________________________
Python.NET mailing list - PythonDotNet@python.org
http://mail.python.org/mailman/listinfo/pythondotnet


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.