Re: [Python.NET] Getting an open Python file handle into CLR

2015-07-21 Thread Dan Lenski
Jeffrey Bush writes: > > > The problem is the conversion from a Python long to a C# number, not anything to do with the file handle itself. > This worked for me: (after your "print handle") > > > cs_handle = IntPtr.Overloads[Int64](Int64(handle)) > fs = FileStream(cs_handle, True) > Aha, t

Re: [Python.NET] Getting an open Python file handle into CLR

2015-07-21 Thread Jeffrey Bush
As I said in my message, you can using IntPtr.Overloads[Int64](handle). Jeff On Tue, Jul 21, 2015 at 11:12 AM, Dan Lenski wrote: > Ron Harding via PythonDotNet writes: > > > perhaps re-directed command line calls for stdin, stdout, stderr in c# > interacting with python i/o command line calls(

Re: [Python.NET] Getting an open Python file handle into CLR

2015-07-21 Thread Jeffrey Bush
The problem is the conversion from a Python long to a C# number, not anything to do with the file handle itself. This worked for me: (after your "print handle") cs_handle = IntPtr.Overloads[Int64](Int64(handle)) fs = FileStream(cs_handle, True) Jeff On Mon, Jul 20, 2015 at 9:19 PM, Ron Harding

Re: [Python.NET] Getting an open Python file handle into CLR

2015-07-21 Thread Ron Harding via PythonDotNet
>how do I cast a win32 file handle to an IntPtr? i ran into this in the past as well; specifically when i started using FTDI USB devices on DLPdesign development kits.  the library is written in c++ MFC code.  After providing data marshal/platform invoke i applied the intptr in c#.   The USB de

Re: [Python.NET] Getting an open Python file handle into CLR

2015-07-21 Thread Dan Lenski
Ron Harding via PythonDotNet writes: > perhaps re-directed command line calls for stdin, stdout, stderr in c# interacting with python i/o command line calls(although in python it is common practice to daisy chain commands). Unfortunately, I cannot redirect the output of the C# library to a co

Re: [Python.NET] Getting an open Python file handle into CLR

2015-07-21 Thread Ron Harding via PythonDotNet
perhaps re-directed command line calls for stdin, stdout, stderr in c# interacting with python i/o command line calls(although in python it is common practice to daisy chain commands). i have used this many times to get out of scrapes for 3rd party process calls in c#.  good luck! Ron “The desir