This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ######################################################################### ### | |
# ########### NETWORK CONTROLLER ########### ### | |
# ######################################################################### ### | |
class Networking(object): | |
def __init__(self, server_ip, server_port, server_password, | |
server_data, object_pass): | |
self.server_ip = server_ip | |
self.server_password = server_password | |
self.server_port = server_port |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Need to investigate these errors (happens rarely and usually after running threaded tests): | |
Traceback (most recent call last): | |
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 329, in __del__ | |
if self._tk.getboolean(self._tk.call("info", "exists", self._name)): | |
RuntimeError: main thread is not in main loop | |
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1992, in wm_withdraw | |
return self.tk.call('wm', 'withdraw', self._w) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# REDESIGN 11/12/18 | |
# MAIN: Three images across row | |
maindisplay = [[sg.T("")],[sg.Button(image_filename = "main_config.png", key = "config"), sg.Button(image_filename = "main_build.png", key = "build"), sg.Button(image_filename = "main_test.png", key = "test")], | |
[sg.ReadButton('', image_filename="license.png", key = "license"), sg.T("", size=(37,1)), sg.ReadButton('', image_filename = "exit.png", key = "exit")]] | |
layout = [[sg.Column(maindisplay)]] | |
########################## | |
### GUI VARS ### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Commented below: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
layout = [[sg.TabGroup([[ | |
sg.Tab('General Settings', tab1, title_color = "#282923", background_color = "#282923"), | |
sg.Tab('Database Settings', tab2, title_color = "#282923", background_color = "#282923"), | |
sg.Tab('Custom App Settings', tab3, title_color = "#282923", background_color = "#282923"), | |
sg.Tab('Graphing', tab4, title_color = "#282923", background_color = "#282923"), | |
sg.Tab('Site Data', tab10, title_color = "#282923", background_color = "#282923"), | |
sg.Tab('Scratchboard', tab11, border_width =0, title_color = "#282923", background_color = "#282923"), | |
sg.Tab('Screenshots', tab5, title_color = "#282923", background_color = "#282923"), | |
sg.Tab('Reporting', tab6, title_color = "#282923", background_color = "#282923"), | |
sg.Tab('Logging', tab7, title_color = "#282923", background_color = "#282923"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colm = [[sg.T("", background_color = "#282923")],[sg.T('Topanga ∩(^-^)∩ Test Anatomy', text_color = "#666463", background_color = "#282923", justification = "center"), | |
sg.ReadButton("Create a Topanga", border_width=0), sg.ReadButton("Open Project Folder", border_width=0), sg.ReadButton("Load", border_width=0), sg.ReadButton("Save", border_width=0),sg.ReadButton("Quit", border_width=0)], | |
[sg.T("")], | |
[sg.ProgressBar(10, orientation='h', size=(65,20), key='progress')], | |
[sg.ProgressBar(10, orientation='h', size=(65,10), key='progress2', bar_color=("#56D8EF", "#56D8EF"))], | |
[sg.T("", key = "step_status", background_color = "#282923", text_color = "#666463")]] | |
LookAndFeel(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for image in fnames: | |
filename = os.path.join(folder, image) | |
image_elem = sg.Image(data = get_img_data(filename, first = True)) | |
col5 = [[sg.ReadButton("Generate")],[sg.T("")], | |
[image_elem]] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PySimpleGUI as sg | |
import matplotlib | |
matplotlib.use('TkAgg') | |
from matplotlib.backends.backend_tkagg import FigureCanvasAgg | |
import matplotlib.backends.tkagg as tkagg | |
import tkinter as Tk | |
""" | |
Demonstrates one way of embedding Matplotlib figures into a PySimpleGUI window. | |
Basic steps are: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib | |
matplotlib.use('TkAgg') | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import pylab | |
import seaborn as sns | |
from pandas.plotting import scatter_matrix | |
import numpy as np | |
from matplotlib.ticker import NullFormatter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setting up the following will enable running a notebook from CLI and create a plotly image from the generated graph: | |
CLI: | |
sudo jupyter nbconvert --execute notebook.ipynb | |
Python: | |
At top of notebook: offline.init_notebook_mode() | |
After defining data and figure: | |
offline.iplot(fig, filename='graph', image='png') |