Not able to pass bool value in function Pythonnet in C#

0

Here is the code:

dynamic hist = tick.history("max", true);

Getting the following error:

Python.Runtime.PythonException
  HResult=0x80131500
  Message=AttributeError : 'bool' object has no attribute 'lower'
  Source=Python.Runtime
  StackTrace:
['  File "C:\\Python37\\lib\\site-packages\\yfinance\\base.py", line 135, in history\n    params["interval"] = interval.lower()\n']   at Python.Runtime.PyObject.Invoke(PyTuple args, PyDict kw)
   at Python.Runtime.PyObject.InvokeMethod(String name, PyTuple args, PyDict kw)
   at Python.Runtime.PyObject.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at testapplication.Form1.button1_Click(Object sender, EventArgs e) in C:\Users\test\Desktop\C#\testapplication\testapplication\Form1.cs:line 27
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at testapplication.Program.Main() in C:\Users\test\Desktop\C#\testapplication\testapplication\Program.cs:line 19

Please let me know what is the way I can pass bool value to the function using Pythonnet in C#.

c#
python.net
asked on Stack Overflow Nov 25, 2020 by Jaffer Wilson

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0