Skip to content

Commit 4548b1d

Browse files
New imports... switched order so that PyCharm will pick up with Python 3 import first
1 parent aeafdfe commit 4548b1d

84 files changed

Lines changed: 1071 additions & 265 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Demo_All_Widgets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python
22
import sys
3-
if sys.version_info[0] < 3:
4-
import PySimpleGUI27 as sg
5-
else:
3+
if sys.version_info[0] >= 3:
64
import PySimpleGUI as sg
5+
else:
6+
import PySimpleGUI27 as sg
77

88
sg.ChangeLookAndFeel('GreenTan')
99

Demo_Borderless_Window.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python
22
import sys
3-
if sys.version_info[0] < 3:
4-
import PySimpleGUI27 as sg
5-
else:
3+
if sys.version_info[0] >= 3:
64
import PySimpleGUI as sg
5+
else:
6+
import PySimpleGUI27 as sg
77

88
"""
99
Turn off padding in order to get a really tight looking layout.

Demo_Button_Click.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python
22
import sys
3-
if sys.version_info[0] < 3:
4-
import PySimpleGUI27 as sg
5-
else:
3+
if sys.version_info[0] >= 3:
64
import PySimpleGUI as sg
5+
else:
6+
import PySimpleGUI27 as sg
77

88
import winsound
99

Demo_Button_States.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env python
22
import sys
3-
if sys.version_info[0] < 3:
4-
import PySimpleGUI27 as sg
5-
else:
3+
if sys.version_info[0] >= 3:
64
import PySimpleGUI as sg
7-
5+
else:
6+
import PySimpleGUI27 as sg
87
"""
98
Demonstrates using a "tight" layout with a Dark theme.
109
Shows how button states can be controlled by a user application. The program manages the disabled/enabled

Demo_Calendar.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python
22
import sys
3-
if sys.version_info[0] < 3:
4-
import PySimpleGUI27 as sg
5-
else:
3+
if sys.version_info[0] >= 3:
64
import PySimpleGUI as sg
5+
else:
6+
import PySimpleGUI27 as sg
77

88
layout = [[sg.T('Calendar Test')],
99
[sg.In('', size=(20,1), key='input')],

Demo_Canvas.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python
22
import sys
3-
if sys.version_info[0] < 3:
4-
import PySimpleGUI27 as sg
5-
else:
3+
if sys.version_info[0] >= 3:
64
import PySimpleGUI as sg
5+
else:
6+
import PySimpleGUI27 as sg
77

88
layout = [
99
[sg.Canvas(size=(150, 150), background_color='red', key='canvas')],

Demo_Chat.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python
22
import sys
3-
if sys.version_info[0] < 3:
4-
import PySimpleGUI27 as sg
5-
else:
3+
if sys.version_info[0] >= 3:
64
import PySimpleGUI as sg
5+
else:
6+
import PySimpleGUI27 as sg
77

88
'''
99
A chat window. Add call to your send-routine, print the response and you're done

Demo_Chat_With_History.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/usr/bin/env python
22
import sys
3-
if sys.version_info[0] < 3:
4-
import PySimpleGUI27 as sg
5-
else:
3+
if sys.version_info[0] >= 3:
64
import PySimpleGUI as sg
5+
else:
6+
import PySimpleGUI27 as sg
7+
78
'''
89
A chatbot with history
910
Scroll up and down through prior commands using the arrow keys

Demo_Chatterbot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python
22
import sys
3-
if sys.version_info[0] < 3:
4-
import PySimpleGUI27 as sg
5-
else:
3+
if sys.version_info[0] >= 3:
64
import PySimpleGUI as sg
5+
else:
6+
import PySimpleGUI27 as sg
77

88
from chatterbot import ChatBot
99
import chatterbot.utils

Demo_Color.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python
22
import sys
3-
if sys.version_info[0] < 3:
4-
import PySimpleGUI27 as sg
5-
else:
3+
if sys.version_info[0] >= 3:
64
import PySimpleGUI as sg
5+
else:
6+
import PySimpleGUI27 as sg
77

88
MY_WINDOW_ICON = 'E:\\TheRealMyDocs\\Icons\\The Planets\\jupiter.ico'
99
reverse = {}
@@ -1702,10 +1702,14 @@ def main():
17021702
if hex_input == '' and len(drop_down_value) == 0:
17031703
continue
17041704

1705-
if hex_input is not '' and hex_input[0] == '#':
1706-
color_hex = hex_input.upper()
1707-
color_name = get_name_from_hex(hex_input)
1708-
elif drop_down_value is not None:
1705+
if len(hex_input) != 0:
1706+
if hex_input[0] == '#':
1707+
color_hex = hex_input.upper()
1708+
color_name = get_name_from_hex(hex_input)
1709+
else:
1710+
color_name = hex_input
1711+
color_hex = get_hex_from_name(color_name)
1712+
elif drop_down_value is not None and len(drop_down_value) != 0:
17091713
color_name = drop_down_value[0]
17101714
color_hex = get_hex_from_name(color_name)
17111715

0 commit comments

Comments
 (0)