我得到一个错误与下面的代码: from os import getcwd
os.getcwd()
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
os.getcwd()
NameError: name 'os' is not defined
谁知道为什么进口这种方式是不工作?
模块我有一个名为“测试”主文件夹,内部结构为: # folders and files in the main folder 'test'
Desktop\test\use_try.py
Desktop\test\cond\__init__.py # empty file.
Desktop\test\cond\tryme.py
Desktop\test\db\
现在在文件tryme.p
我创建了被splited到2个文件一个简单的Perl脚本模块 - main.pl和content.pm 主要脚本放在Project目录和content.pm(模块)被放置在Project/utils目录。现在我想在main.pl使用content.pm我做出这样的事情来使用这个模块: use Cwd;
use lib Cwd::abs_path(getcwd()."/utils");
use