Python 3.x Python/MVS-调用的标准库模块
我试图在Microsoft Visual Studio(Python 3.6,64位)上运行以下代码,并收到错误消息“标准库模块在导入期间调用了用户代码;已为调用的代码禁用断点” 我真的希望你能帮助我。我没有MVS方面的经验。 谢谢 请在下面找到我的代码:Python 3.x Python/MVS-调用的标准库模块,python-3.x,visual-studio,standard-library,Python 3.x,Visual Studio,Standard Library,我试图在Microsoft Visual Studio(Python 3.6,64位)上运行以下代码,并收到错误消息“标准库模块在导入期间调用了用户代码;已为调用的代码禁用断点” 我真的希望你能帮助我。我没有MVS方面的经验。 谢谢 请在下面找到我的代码: Newton raphson method. from __future__ import division from unittest.test.test_result import __init__ import numpy as np
Newton raphson method.
from __future__ import division
from unittest.test.test_result import __init__
import numpy as np
import matplotlib.pyplot as plt
from cplane_np import ArrayComplexPlane
from math import sqrt
####################################################################
class NewtonRaphson(ArrayComplexPlane):
"""define a class called NewtonRaphson which is a subclass from
ArrayComplexPlane"""
def __init__(self):
ArrayComplexPlane.__init__(self, -2, 2, 401, -2, 2, 401)
self.z= ArrayComplexPlane(-2, 2, 401, -2, 2, 401).plane
om=self.z
om1= om.as_matrix()
self.resu= self.meth2()
###Array of roots and iterations.
self.plo= self.plo_res()
def meth1(self,z0=3):
x0=z0 #The initial value.
n=0 # The initial value of iterations.
dx=0.01
dy=0.01
eps=sqrt(dx**2+dy**2)
while df(x0)!=0: #the derivation of f(x) should be not equal to zero.
n+=1
#x1=self.apply(new_fun(x0))
x1= new_fun(x0)
if abs(x1-x0)< eps: #The condition to stop the iteration
return (x1,n)
else:
x0=x1 #assign new value of x1 to x0
def meth2(self):
ve= np.vectorize(self.meth1 )
return ve(self.z)
def plo_res(self):
res1=self.resu
res_11= np.array(res1[0],dtype='float')
plt.imshow(res_11)
return plt.show()
Newton-raphson方法。
来自未来进口部
从unittest.test.test\u结果导入\u初始化__
将numpy作为np导入
将matplotlib.pyplot作为plt导入
从cplane\U np导入阵列ComplexPlane
从数学导入sqrt
####################################################################
NewtonRaphson类(阵列复合平面):
“”“定义一个名为NewtonRaphson的类,它是
阵列复合平面“”
定义初始化(自):
ArrayComplexPlane.\uuuuu init\uuuuuu(self,-2,2,401,-2,2,401)
self.z=ArrayComplexPlane(-2,2,401,-2,2,401).plane
om=self.z
om1=om.as_矩阵()
self.resu=self.meth2()
###根和迭代的数组。
self.plo=self.plo_res()
def meth1(自身,z0=3):
x0=z0#初始值。
n=0#迭代的初始值。
dx=0.01
dy=0.01
eps=sqrt(dx**2+dy**2)
而df(x0)=0:#f(x)的导数不应等于零。
n+=1
#x1=自我应用(新乐趣(x0))
x1=新的乐趣(x0)
如果abs(x1-x0)
供将来参考:这将在visual studio 2017 15.6中修复 要在发布之前解决此问题,请遵循上面github线程中发布的建议: 如果您想立即尝试,您应该能够覆盖 最新版本为的debugger.py副本位于 (在microsoft visual studio安装下搜索debugger.py。) 目录) 可能是这些警告导致了故障 “调试器操作正在进行”或使其更糟
我也遇到了同样的问题。。