Is it possible to programmatically get any of the YAML parameters at runtime? Are they stored somewhere in the environment?
A good example would be to automatically detect the version of the application and add it as a comment on the landing HTML page.
No, but some data is available from os.environ - for example, os.environ['APPLICATION_ID']and os.environ['CURRENT_VERSION_ID'].
os.environ['APPLICATION_ID']
os.environ['CURRENT_VERSION_ID']
( , CGI WSGI). app.yaml , app.yaml (, my.yaml )
app.yaml
my.yaml
import yaml ... data = yaml.load(open('my.yaml', 'rb'))
data.
data
In PyYAML, the file __init__.pyin the yaml folder has a global variable __version__, so
__init__.py
__version__
#import yaml print yaml.__version__
Source: https://habr.com/ru/post/1767719/More articles:Javascript Global Variables - javascript"there is no such file to download - faster csv" when trying to use quickcsv gem - ruby-on-railsDo powerful IDEs make me lazy? - visual-studioHow to get all available cameras using ActionScript? - actionscriptHow to hone yourself from an IDE to a text editor? - idenew encryption algorithm for ssh - securityI can't figure out my simple homework in Java - javaIs there a ModalPopup equivalent in jQuery user interface? - jquery-uiHow to index a lookup table in MySQL - performanceIE6, IE7: stretch the last value of li to the cumulative width of the previous li - listAll Articles