Home
Sign Up
Sign In
推荐学习书目
›
Learn Python the Hard Way
Python Sites
›
PyPI
- Python Package Index
›
http://diveintopython.org/toc/index.html
›
Pocoo
值得关注的项目
›
PyPy
›
Celery
›
Jinja2
›
Read the Docs
›
gevent
›
pyenv
›
virtualenv
›
Stackless Python
›
Beautiful Soup
›
结巴中文分词
›
Green Unicorn
›
Sentry
›
Shovel
›
Pyflakes
›
pytest
Python 编程
›
pep8 Checker
Styles
›
PEP 8
›
Google Python Style Guide
›
Code Style from The Hitchhiker's Guide
V2EX
›
Python
Python 模块导入问题
yxy2829
·
Jul 20, 2017
· 3170 views
This topic created in 3399 days ago, the information mentioned may be changed or developed.
.
├── aaa
│ ├── a.py
│ └── __init__.py
└── bbb
├── b.py
└── __init__.py
目录结构如上,如何在 b.py 中调用 a.py 的方法?
python2.7
Python
BBB
aaa
调用
4 replies
•
2017-07-21 21:51:27 +08:00
lazydao
Jul 20, 2017 via iPhone
1
from aaa import a
yxy2829
OP
Jul 20, 2017
2
import sys
sys.path.append('../')
from aaa import a
Jblue
Jul 21, 2017
3
2#+1,
https://stackoverflow.com/questions/7587457/importerror-no-module-named-python
julyclyde
Jul 21, 2017
4
没看明白。为什么要..上层目录?
b 和 aaa 不是平级吗?应该可以 from aaa 啊
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
4496 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 29ms ·
UTC 06:10
·
PVG 14:10
·
LAX 22:10
·
JFK 01:10
♥ Do have faith in what you're doing.
❯