diff --git a/app/app.py b/app/app.py index 8ab1a17..cecc5d3 100644 --- a/app/app.py +++ b/app/app.py @@ -19,6 +19,7 @@ # TODO add function to store and retrieve config xpaths. # Import necessary modules. +from sys import platform from selenium import webdriver from tkinter import StringVar, messagebox import tkinter.font as tkFont @@ -34,7 +35,13 @@ # Set formatting for currency. -locale.setlocale(locale.LC_ALL, 'English_United States.1252') +if platform == "win32": + # Windows formatting + locale.setlocale(locale.LC_ALL, 'English_United States.1252') +else: + # Linux/OS X formatting + locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') + # Set variables config.initial_amount = 100000 @@ -42,9 +49,7 @@ is_playing = "▶" # Check if csv file already exists, if not create it. -if os.path.exists("trades.csv"): - pass -else: +if not os.path.exists("trades.csv"): trades_file = open("trades.csv", "w") # Set driver to chromedriver.exe