Skip to content

Update pvsystem.py #112

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

Merged
merged 2 commits into from
Jan 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions pvlib/pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,17 @@ def retrieve_sam(name=None, samfile=None):
response = urlopen(url)
csvdata = io.StringIO(response.read().decode(errors='ignore'))
elif samfile == 'select':
import Tkinter
from tkFileDialog import askopenfilename
Tkinter.Tk().withdraw()
csvdata = askopenfilename()
try:
# python 2
import Tkinter as tkinter
from tkFileDialog import askopenfilename
except ImportError:
# python 3
import tkinter
from tkinter.filedialog import askopenfilename

tkinter.Tk().withdraw()
csvdata = askopenfilename()
else:
csvdata = samfile

Expand Down