我们如何编写一个正则表达式来表示“如果中间有破折号,则匹配失败”
我有几行组成为 3958.3r - 5v,有些没有破折号,例如:3958.3v4r。我能够得到带有破折号的那些,但不仅限于那些没有破折号的
我正在尝试将我的代码模块化,但遇到了问题。
我的文件夹是这样构造的:
code
|_main.py
|_test1
|_calcA.py (which contains a method)
|_test2
|_calcB.py (which contains another method)
|_test3
|_calcC.py (which contains another method)
Run Code Online (Sandbox Code Playgroud)
现在我的main.py包含以下行:
import sys; import pprint
pprint.pprint(sys.path)
from test1.calccircle.py import calcA
from test2.calctriangle.py import calcB
from test3.calccarre.py import calcB
Run Code Online (Sandbox Code Playgroud)
出现以下错误:
ImportError:没有名为“ test1.calcA.py”的模块;'test1.calcA'不是一个软件包