Most Pythonic way to provide global configuration variables in config.py? [closed]

How about just using the built-in types like this: config = { “mysql”: { “user”: “root”, “pass”: “secret”, “tables”: { “users”: “tb_users” } # etc } } You’d access the values as follows: config[“mysql”][“tables”][“users”] If you are willing to sacrifice the potential to compute expressions inside your config tree, you could use YAML and end … Read more

Easy_install cache downloaded files

Update 13 years later: easy_install was removed from Python in January 2021. The python package manager is pip, it caches downloaded packages. pip (http://pypi.python.org/pypi/pip/) is a drop-in replacement for the easy_install tool and can do that. Just run easy_install pip and set an environment variable PIP_DOWNLOAD_CACHE to the path you want pip to store the … Read more

How to create Python egg file

You are reading the wrong documentation. You want this: https://setuptools.readthedocs.io/en/latest/setuptools.html#develop-deploy-the-project-source-in-development-mode Creating setup.py is covered in the distutils documentation in Python’s standard library documentation here. The main difference (for python eggs) is you import setup from setuptools, not distutils. Yep. That should be right. I don’t think so. pyc files can be version and platform dependent. … Read more

What is a Python egg?

Note: Egg packaging has been superseded by Wheel packaging. Same concept as a .jar file in Java, it is a .zip file with some metadata files renamed .egg, for distributing code as bundles. Specifically: The Internal Structure of Python Eggs A “Python egg” is a logical structure embodying the release of a specific version of … Read more