Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ConfigParser运行setuptools后,配置文件保存在何处_Python_Setuptools_Egg - Fatal编程技术网

Python ConfigParser运行setuptools后,配置文件保存在何处

Python ConfigParser运行setuptools后,配置文件保存在何处,python,setuptools,egg,Python,Setuptools,Egg,我已将代码作为egg安装在我的系统中 我正在使用ConfigParser保存我的.config文件,但是在将其作为egg安装后运行代码时,在我的项目目录中没有看到.config文件发生更改 它在我的系统中保存在哪里,以便我可以在需要时手动接近它 这是我的save()方法 def _save(): global _config, _config_file_name """ Save the config file to the file """ config

我已将代码作为
egg
安装在我的系统中

我正在使用ConfigParser保存我的
.config
文件,但是在将其作为egg安装后运行代码时,在我的项目目录中没有看到.config文件发生更改

它在我的系统中保存在哪里,以便我可以在需要时手动接近它

这是我的save()方法

def _save():
    global _config, _config_file_name
    """
    Save the config file to the file
    """
    config_file = open(_config_file_name, 'w')
    with config_file as f:
        _config.write(f)
    config_file.close()

\u config\u file\u name
是绝对文件吗?该文件是何时在
setup.py中创建的,还是何时使用您的模块?何时使用我的模块_配置文件名只是“.config”,您希望它存在于哪里?您给它一个相对路径,所以它应该在您当前的工作目录中创建,您的CWD是您的项目目录吗?或者应该在模块安装的目录中创建?应该在模块安装的目录中创建