小编Arc*_*oxx的帖子

Python模块如何工作

我想知道Python模块是如何工作的?假设我想让我的Python程序使用一些自定义模块与它打包,我将它们放在主.py文件中?(如果不使用常规方法,我将如何加载它们?)

python customization location load module

9
推荐指数
1
解决办法
6402
查看次数

syntaxerror:"python中的行继续符后面的意外字符"数学

我遇到了这个Python程序的问题我正在创建数学,工作和解决方案,但我得到语法错误:"python中的行后续字符意外的字符"

这是我的代码

print("Length between sides: "+str((length*length)*2.6)+" \ 1.5 = "+str(((length*length)*2.6)\1.5)+" Units")
Run Code Online (Sandbox Code Playgroud)

我的问题是\ 1.5我试过\ 1.5但它不起作用

使用python 2.7.2

python math syntax continuation

6
推荐指数
3
解决办法
8万
查看次数

Python模块位置

我一直试图找到一个模块的位置,但我不能搜索python文件夹但仍然无法找到它但我知道它在那里

>>> import math
>>> math.__path__
Traceback (most recent call last):
  File "<pyshell#13>", line 1, in <module>
    math.__path__
AttributeError: 'module' object has no attribute '__path__'
>>> math.__file__
Traceback (most recent call last):
  File "<pyshell#14>", line 1, in <module>
    math.__file__
AttributeError: 'module' object has no attribute '__file__'
Run Code Online (Sandbox Code Playgroud)

python math location module

2
推荐指数
1
解决办法
1709
查看次数

标签 统计

python ×3

location ×2

math ×2

module ×2

continuation ×1

customization ×1

load ×1

syntax ×1