Last active
October 30, 2022 12:17
-
-
Save xtekky/11655605dbfa5098035e0a48df8d6087 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__json = """{ | |
"test": 123 | |
}""" | |
max_index = 0 | |
for x in __json.split("\n"): | |
index = x.find(":") | |
if index > max_index: | |
max_index = index | |
print(max_index) | |
for x in __json.split("\n"): | |
index = x.find(":") | |
diff = max_index - index | |
try: | |
split = x.split(":") | |
print(split[0] + " " * diff + ":" + split[1]) | |
except IndexError: | |
print(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment