Thanks to visit codestin.com
Credit goes to github.com

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

Update pvsystem.py #112

merged 2 commits into from
Jan 30, 2016

Conversation

pyElena21
Copy link
Contributor

I think you need this change in tkinter module import in order to comply with Python 3.

Cheers,
Elena

I think you need this change in tkinter module import in order to comply with Python 3. 

Cheers,
Elena
@wholmgren
Copy link
Member

Thanks for catching this and making the PR. We're going to need a try/except block to make it work on both Python 2 and 3. I think that the following should work. Can you update your PR to something like this?

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() 

@wholmgren wholmgren added the bug label Jan 30, 2016
@wholmgren wholmgren added this to the 0.3 milestone Jan 30, 2016
@wholmgren
Copy link
Member

@pyElena21 Thanks for updating the code.

wholmgren added a commit that referenced this pull request Jan 30, 2016
@wholmgren wholmgren merged commit 007adf9 into pvlib:master Jan 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants