Skip to content

Instantly share code, notes, and snippets.

@xtekky
Last active October 30, 2022 12:17
Show Gist options
  • Save xtekky/11655605dbfa5098035e0a48df8d6087 to your computer and use it in GitHub Desktop.
Save xtekky/11655605dbfa5098035e0a48df8d6087 to your computer and use it in GitHub Desktop.
__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