printSoln module problem, ModuleNotFoundError

别来无恙 提交于 2021-01-29 11:04:44

问题


i have the ebook for describe runge-kutta method, and its say i need module printSoln

def printSoln(X,Y,freq):

def printHead(n):
    print("\n        x  ",end=" ")
    for i in range (n):
        print("      y[",i,"] ",end=" ")
    print()

def printLine(x,y,n):
    print("{:13.4e}".format(x),end=" ")
    for i in range (n):
        print("{:13.4e}".format(y[i]),end=" ")
    print()

m = len(Y)
try: n = len(Y[0])
except TypeError: n = 1
if freq == 0: freq = m
printHead(n)
for i in range(0,m,freq):
    printLine(X[i],Y[i],n)
if i != m - 1: printLine(X[m - 1],Y[m - 1],n)

but when i wanna import the module, the module cant define

import numpy as np
from printSoln import *
from run_kt4 import *
import matplotlib.pyplot as plt

its say

ModuleNotFoundError: No module named 'printSoln'

how i fix this? please help

来源:https://stackoverflow.com/questions/65549998/printsoln-module-problem-modulenotfounderror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!