Merge pull request #1807 from PySimpleGUI/Dev-latest

Fixed argv bug.  Doh!
This commit is contained in:
MikeTheWatchGuy 2019-08-13 15:10:50 -04:00 committed by GitHub
commit efbe7257e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -269,7 +269,7 @@ How about a GUI **_and_** traditional CLI argument in 1 line of code?
import PySimpleGUI as sg
import sys
fname = sys.argv[1] if len(sys.argv) == 1 else sg.PopupGetFile('Document to open')
fname = sys.argv[1] if len(sys.argv) > 1 else sg.PopupGetFile('Document to open')
if not fname:
sg.Popup("Cancel", "No filename supplied")