From 7d541255e66a30360ac292ab0d6e0273cce4f1c0 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Tue, 13 Aug 2019 15:09:48 -0400 Subject: [PATCH] Fixed argv bug. Doh! --- docs/cookbook.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cookbook.md b/docs/cookbook.md index d07a4e5e..b58ce440 100644 --- a/docs/cookbook.md +++ b/docs/cookbook.md @@ -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")