Files
linux-kernel-module-cheat/rootfs_overlay/lkmc/python/relative_import/test
Ciro Santilli 六四事件 法轮功 3990333f3d python relative import
2020-10-20 01:00:00 +00:00

21 lines
438 B
Bash
Executable File

#!/usr/bin/env bash
set -eux
# myfile_user works from all directories.
./myfile_user.py
cd ..
relative_import/myfile_user.py
cd relative_import/mydir
../myfile_user.py
cd ..
# TODO any better way to run mydir/myfile_user.py?
# ./mydir/myfile_user.py
#Traceback (most recent call last):
# File "./mydir/myfile_user.py", line 3, in <module>
# import myfile
#ModuleNotFoundError: No module named 'myfile'
python -m mydir.myfile_user