首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python/MVS -调用标准库模块

Python/MVS -调用标准库模块
EN

Stack Overflow用户
提问于 2017-10-22 18:52:35
回答 1查看 1.3K关注 0票数 4

我试图在上运行以下代码(Python3.6,64位),并接收“标准库模块在导入期间调用用户代码;被调用代码禁用断点”的错误消息

我真的希望你能帮我。我没有MVS的经验。谢谢你!!

请在下面找到我的代码:

代码语言:javascript
复制
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()

输出

EN

回答 1

Stack Overflow用户

发布于 2017-12-24 11:39:15

供今后参考:预计将在visual studio 2017中修复15.6

https://github.com/Microsoft/PTVS/issues/3408

要在发布之前修复这个问题,请按照上面github线程中发布的建议:

如果你想现在就试一试,你应该可以用debugger.py的最新版本覆盖你的拷贝。 (在microsoft visual studio安装目录下搜索debugger.py ) 这些警告可能是“正在进行的调试器操作”的原因,或者更糟。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46877938

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档