Closed machiavel23 closed 4 years ago
I think you have to escape the brackets of the CSS code (i.e. you should write {{ }} (not { }) ) . Python thinks that they're the inputs of the string format.
Edit: I was wrong. The proper way to escape braces in python string formats is with double braces not a backslash.
makes sense. will try. meanwhile question
why doesn't it raise th eerror at the first var then?
I think there may be a misunderstanding here. You need the double braces for braces that are supposed to be part of the CSS code. NOT for the braces that are referencing the inputs of the format string (like {0}). For instance, you should write
html {{
--font-render: {2};
--font-inputbox: {3};
}}
for the html part of the CSS code. Similarly for the others.
It raised the error at the first improper use of the braces.
hmmm ok. considering 0 and 1 are actual strings, it makes sense. Thanks!
It apparently solved the issue, I managed to go further in the script before next error (an eoferror on the input...)
Thx for the hand mate!
hmmm ok. considering 0 and 1 are actual strings, it makes sense. Thanks!
It has nothing to do with the fact that 0 and 1 are strings. You'd get the same result even if they weren't strings.
So, the Customizator is currently stucked in the dev hell. Most of the ui works (except a tab glitched caused by google not fully supporting widgets but it's irrelevant for now), but there's ONE fucking huge problem I just don't understand
Take a look here https://colab.research.google.com/github/VBPXKSMI/Open-CYOAI-Project/blob/beta/dev_customizator.ipynb
The first cell is not really useful, it's just a paste of the main cell to have the customization code near my hand.
The important cell is the second one, it's where the customizator is.
Actually, clicking on the validate button, bottom left, is supposed to set the variables to what you selected (which apparently work according to some print() ), then call another function ( previewer() ), to show you an output built the same way the drawfag cell is built (drawfag cell works).
However, for some fucking reason, previewer() raise a KeyError.
If anybody is brave enough to lurk at this and help, I'll appreciate.
apparently, KeyError is because it doesn't found the called variable.