Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output files not in Output directory #8

Open
dkegel-fastly opened this issue Feb 20, 2024 · 1 comment
Open

Output files not in Output directory #8

dkegel-fastly opened this issue Feb 20, 2024 · 1 comment

Comments

@dkegel-fastly
Copy link

How to say you're a windows developer without saying you're a windows developer :-)

drwxr-xr-x  2 dkegel  staff          64 Feb 19 23:48 Output
-rw-r--r--  1 dkegel  staff     3606795 Feb 19 23:48 Output\False Positive Rate.html
...
@TuxInvader
Copy link

This patch fixes it for me. It should work on windows too.

diff --git a/analyzer.py b/analyzer.py
index 64acb40..24eb247 100644
--- a/analyzer.py
+++ b/analyzer.py
@@ -1,6 +1,7 @@
 import plotly.express as px
 from pathlib import Path
 import pandas as pd
+import os
 
 from config import engine
 from helper import log, isTableExists
@@ -77,7 +78,7 @@ def create_graph(_df, metric, is_ascending):
     print(_df_sorted[['Position', 'WAF Name', metric]].to_string(index=False))
 
     Path("Output").mkdir(exist_ok=True)
-    fig.write_html(f"Output\\{metric}.html")
+    fig.write_html("Output" + os.sep + f"{metric}.html")
 
 
 def create_2d_graph(_df):
@@ -102,7 +103,7 @@ def create_2d_graph(_df):
     fig.update_traces(textposition="bottom center")
 
     Path("Output").mkdir(exist_ok=True)
-    fig.write_html(f"Output\\2d Graph True Negative Rate & True Positive Rate.html")
+    fig.write_html("Output" + os.sep + "2d Graph True Negative Rate & True Positive Rate.html")
 
 
 def analyze_results():

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants