I use some server side Python scripts to compile JavaScript files into a single file, and also add information about these files to the database. To add information about the scripts, I now have a yaml file for each js file with some information inside it that looks like this:
title: Script title
alias: script_alias
I would like to throw away yaml, which seems redundant for me, if I can read these variables directly from JavaScript, which I could place at the very beginning of the file as follows:
var title = "Script title";
var alias = "script_alias";
Is it easy to read these variables using Python?
source
share