mirror of
https://github.com/norohind/EDMC_SpanshRouter.git
synced 2025-04-19 18:47:36 +03:00
Fixed issue with files containing a BOM code
This commit is contained in:
parent
934c53deb8
commit
fdaafa8948
@ -51,7 +51,6 @@ class SpanshRouter():
|
||||
# -- GUI part --
|
||||
def init_gui(self, parent):
|
||||
self.parent = parent
|
||||
parentwidth = parent.winfo_width()
|
||||
self.frame = tk.Frame(parent, borderwidth=2)
|
||||
self.frame.grid(sticky=tk.NSEW, columnspan=2)
|
||||
|
||||
@ -335,7 +334,7 @@ class SpanshRouter():
|
||||
('CSV files', '*.csv'),
|
||||
('Text files', '*.txt'),
|
||||
]
|
||||
filename = filedialog.askopenfilename(filetypes = ftypes)
|
||||
filename = filedialog.askopenfilename(filetypes = ftypes, initialdir=os.path.expanduser('~'))
|
||||
|
||||
if filename.__len__() > 0:
|
||||
try:
|
||||
@ -364,7 +363,7 @@ class SpanshRouter():
|
||||
self.show_error("An error occured while reading the file.")
|
||||
|
||||
def plot_csv(self, filename, clear_previous_route=True):
|
||||
with open(filename, 'r') as csvfile:
|
||||
with open(filename, 'r', encoding='utf-8-sig') as csvfile:
|
||||
route_reader = csv.DictReader(csvfile)
|
||||
|
||||
if clear_previous_route:
|
||||
|
Loading…
x
Reference in New Issue
Block a user