We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8132e3 commit a4c501aCopy full SHA for a4c501a
algorithm_visualizer/__init__.py
@@ -16,16 +16,18 @@
16
17
@atexit.register
18
def execute():
19
+ commands = json.dumps(Commander.commands, separators=(",", ":"))
20
if os.getenv("ALGORITHM_VISUALIZER"):
21
with open("visualization.json", "w", encoding="UTF-8") as file:
- json.dump(Commander.commands, file)
22
+ file.write(commands)
23
else:
24
import requests
25
import webbrowser
26
27
response = requests.post(
28
"https://algorithm-visualizer.org/api/visualizations",
- json=Commander.commands
29
+ headers={"Content-type": "application/json"},
30
+ data=commands
31
)
32
33
if response.status_code == 200:
0 commit comments