Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法在C中的Pythonnet函数中传递布尔值#_C#_Python.net - Fatal编程技术网

C# 无法在C中的Pythonnet函数中传递布尔值#

C# 无法在C中的Pythonnet函数中传递布尔值#,c#,python.net,C#,Python.net,代码如下: dynamic hist = tick.history("max", true); 获取以下错误: Python.Runtime.PythonException HResult=0x80131500 Message=AttributeError : 'bool' object has no attribute 'lower' Source=Python.Runtime StackTrace: [' File "C:\\Python37

代码如下:

dynamic hist = tick.history("max", true);
获取以下错误:

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
请让我知道在C#中使用Pythonnet将bool值传递给函数的方法是什么