I would like to be able to call a C# something from a python script from IDLE
or if better from ironpython. The code I need to call is below. I am fairly
certain that this is VB.net so if easiest I could build this in a vb.net
something. I do not know how to package this into something that could be
called from python (c# or vb -.net). It would be most cool if I could call
from ironpython. Thanks.
Public Sub ListUniqueRecords()
Dim pMyTable As ITable
Dim pCurs As ICursor = Nothing
Dim intFieldIdx As Integer
Dim pDataStatistics As IDataStatistics
Dim pEnumVar As IEnumerator
Dim pWorkspaceFactory As IWorkspaceFactory
Dim pWorkspace As IWorkspace
Dim pFeatWorkSpace As IFeatureWorkspace
Dim strMyField As String = “VAL”
Try
pWorkspaceFactory = New AccessWorkspaceFactory
pWorkspace = pWorkspaceFactory.OpenFromFile(“C:\MyPath\MyGDB.mdb”,
0)
pFeatWorkSpace = CType(pWorkspace, IFeatureWorkspace)
pMyTable = pFeatWorkSpace.OpenTable(“MyTableName”)
intFieldIdx = pMyTable.FindField(strMyField)
pCurs = pMyTable.Search(Nothing, True)
pDataStatistics = New DataStatistics
pDataStatistics.Field = strMyField
pDataStatistics.Cursor = pCurs
pEnumVar = CType(pDataStatistics.UniqueValues, IEnumerator)
Do Until pEnumVar.MoveNext = False
Debug.Print(pEnumVar.Current.ToString)
Loop
Catch ex As Exception
Trace.WriteLine(ex.ToString)
Finally
‘clean up
pCurs = Nothing
pWorkspace = Nothing
End Try
End Sub
________________________________________
From: ironpython-users-bounces+justin.perez=energytransfer....@python.org
[ironpython-users-bounces+justin.perez=energytransfer....@python.org] on behalf
of [email protected] [[email protected]]
Sent: Friday, October 07, 2011 5:00 AM
To: [email protected]
Subject: Ironpython-users Digest, Vol 5, Issue 4
Send Ironpython-users mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.python.org/mailman/listinfo/ironpython-users
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Ironpython-users digest..."
Today's Topics:
1. Re: Help Change Python Engine Options inside Python (Jeff Hardy)
----------------------------------------------------------------------
Message: 1
Date: Thu, 6 Oct 2011 14:08:20 -0700
From: Jeff Hardy <[email protected]>
To: Mark Wilson <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: Re: [Ironpython-users] Help Change Python Engine Options
inside Python
Message-ID:
<caf7axfhv8de+uw+s1+bgsvibyojgc+w-vamyfff_j_1ti2x...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
I'm pretty sure that once the Python Engine has started, the options
cannot be changed.
If you have VS available you could attach to the ipy process and debug
using that. Calling System.Diagnostics.Debugger.Break() in your python
code will trigger a breakpoint.
- Jeff
On Wed, Oct 5, 2011 at 3:19 PM, Mark Wilson <[email protected]> wrote:
> Hi,
> I am writing python scripts in a launched?ironpython console. I cannot use
> the pdb debug module because the FullFrames and Tracing were off. I cannot
> relaunch ipy -X:FullFrames -X:Tracing. Could you advise how to debug the
> scripts within the?existing?python console 2.7?
> Thanks in advance,
> Mike
>
>
>
>
> _______________________________________________
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
>
------------------------------
_______________________________________________
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users
End of Ironpython-users Digest, Vol 5, Issue 4
**********************************************
_______________________________________________
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users