Skip to content

Commit a4c501a

Browse files
MarkKoz64json
authored andcommitted
Remove spaces from JSON separators for compactness
1 parent e8132e3 commit a4c501a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

algorithm_visualizer/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@
1616

1717
@atexit.register
1818
def execute():
19+
commands = json.dumps(Commander.commands, separators=(",", ":"))
1920
if os.getenv("ALGORITHM_VISUALIZER"):
2021
with open("visualization.json", "w", encoding="UTF-8") as file:
21-
json.dump(Commander.commands, file)
22+
file.write(commands)
2223
else:
2324
import requests
2425
import webbrowser
2526

2627
response = requests.post(
2728
"https://algorithm-visualizer.org/api/visualizations",
28-
json=Commander.commands
29+
headers={"Content-type": "application/json"},
30+
data=commands
2931
)
3032

3133
if response.status_code == 200:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy