Skip to content

Commit

Permalink
Added support for python2 in Save funtionality
Browse files Browse the repository at this point in the history
  • Loading branch information
realsdx committed Feb 8, 2018
1 parent 6e4957e commit c78c03e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gui_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

try:
from Tkinter import *
import tkFileDialog as fdialog
except ImportError:
from tkinter import *
from tkinter import filedialog
from tkinter import filedialog as fdialog

try:
import ttk
Expand Down Expand Up @@ -67,7 +68,7 @@ def destroy_app():
exit(0)

def save_file():
file=filedialog.asksaveasfile(mode="wb", title="Save Figure", defaultextension=".png", filetypes = (("png files","*.png"),("all files","*.*")))
file=fdialog.asksaveasfile(mode="wb", title="Save Figure", defaultextension=".png", filetypes = (("png files","*.png"),("all files","*.*")))
if file is None:
return None
img_to_save=open(".temp/generated_plot.png","rb").read()
Expand Down

0 comments on commit c78c03e

Please sign in to comment.