I'm trying to generate a json file preset with variables that are received from the user from input().The only method I found sorta-similar to mine is here, but it doesnt show how to generate a new json file.
An example of inputs:
Enter the name of the json file:
>>>file
Enter the width:
>>>2
Enter the height:
>>>2
Then these inputs are converted into a json file like so:
{
"width": "2",
"height": "2"
"column": [
{
"0": "1255255255"
"1": "1255255255"
},
{
"0": "1255255255"
"1": "1255255255"
}
]
}
Every list of values correspond to a column, and the values within a list are a row. How would I generate enough columns and rows to match the width and height?
i.e. a column:
{
"0": "1255255255"
"1": "1255255255"
}
a row:
"0": "1255255255"
the "1255255255" value doesnt matter, it's just a placeholder.