def about_window(self): about = tk.Tk() about.title('About') about.minsize(300, 150) self.about = tk.Label( about, text= 'PCR processing\nProgram for processing PCR RT data from\nRoche LightCycler® ' '480 System\n\n\n' 'Version: Jul, 2018, 0.4\n\n\nAuthors: Arina Pershina, Michael Timoshin\n' '*****@*****.**') self.about.pack(fill='x') about.mainloop()
def whats_new(self): whats_new = tk.Tk() whats_new.title("What's new") whats_new.minsize(300, 150) self.whats_new = tk.Label( whats_new, text='What is new in v0.4\n\n' '> Fixed bug with one-way ANOVA, when degree of freedom was not ' 'clear\n' '> Fixed comparing lists by name of items, not by thier position in ' 'the lists\n' "> Create What's new button") self.whats_new.pack(fill='x') whats_new.mainloop()
def __init__(self): # Отображение начального диалогового окна, которое предоставляет выбор ко всем функциям программы root = tk.Tk() root.title('PCR processing') # Создание основного окна. root.minsize(600, 400) self.one_file_not_console_button = tk.Button( root, text='Processing raw data', command=one_file_not_console.start) self.one_file_not_console_button.pack(side='top', fill='x', padx=20, pady=5) self.two_file_not_console_button = tk.Button( root, text='Create full list', command=two_file_not_console.start) self.two_file_not_console_button.pack(side='top', fill='x', padx=20, pady=5) self.new_statistics_methods_button = tk.Button( root, text='Statistic processing', command=new_statistics_methods.start) self.new_statistics_methods_button.pack(side='top', fill='x', padx=20, pady=5) self.help_button = tk.Button(root, text='Help', command=self.help) self.help_button.pack(side='top', fill='x', padx=20, pady=5) self.whats_new_button = tk.Button(root, text="What's new", command=self.whats_new) self.whats_new_button.pack(side='top', fill='x', padx=20, pady=5) self.about_button = tk.Button(root, text='About program', command=self.about_window) self.about_button.pack(side='top', padx=20, pady=5) root.mainloop()
def save_to_csv(tables, tables_for_youtube): """ Записывает получившийся список в csv """ path_to_sites = path.realpath( 'sites_' + str(datetime.today().strftime("%Y-%m-%d-%H.%M")) + '.csv') path_to_youtube = path.realpath( 'youtube_' + str(datetime.today().strftime("%Y-%m-%d-%H.%M")) + '.csv') if path.exists(path_to_sites) is False: root = filedialog.Tk() dirs = filedialog.askdirectory() path_to_sites = dirs + '\\' + 'sites_' + str( datetime.today().strftime("%Y-%m-%d-%H.%M")) + '.csv' path_to_youtube = dirs + '\\' + 'youtube_' + str( datetime.today().strftime("%Y-%m-%d-%H.%M")) + '.csv' path_to_sites = path_to_sites.replace('/', '\\\\') path_to_youtube = path_to_youtube.replace('/', '\\\\') root.destroy() path_to_sites = path_to_sites.replace('\\', '\\\\') path_to_youtube = path_to_youtube.replace('\\', '\\\\') tables.to_csv(str(path_to_sites), header=False, index=False, encoding='cp1251') tables_for_youtube.to_csv(str(path_to_youtube), header=False, index=False, encoding='cp1251') print('Готово') return 0
splashScreenTk.overrideredirect(1) splashScreenTk.configure(bg='darkblue') lblTitle = tk.Label(splashScreenTk, fg='white', bg='darkblue', font=('arial', 40, 'bold'), text='\n' * 2 + TITLE) lblTitle.pack() lblCreatedBy = tk.Label(splashScreenTk, fg='white', bg='darkblue', font=('arial', 15, 'bold'), text='\n' * 6 + '© 2020 Anirudh Sriram') lblCreatedBy.pack() splashScreenTk.mainloop() _splashScreen = threading.Thread(target=splashScreen) _splashScreen.start() cam = cv2.VideoCapture(0) splashScreenTk.withdraw() saveWin = filedialog.Tk() saveWin.withdraw() imglist = [] while True: ret, frame = cam.read() if not ret: break cv2.imshow(TITLE, frame) key = cv2.waitKey(25) if key == 27: break elif key == ord('s'): cv2.destroyAllWindows()
def chooseFile(): tkn.Tk().withdraw() # Close the root window in_path = tkn.askopenfilename() return (in_path)
def risanje2(st): barve = ['k', 'b', 'g', 'm', 'r', 'y'] if st % 10 == 0: k += 1 fig, ax = plt.subplots(1) plt.xscale('log') plt.xlabel('$\\tau$ $[ms]$', fontsize=22) plt.ylabel('$g^{(2)}(\\tau)-1$', fontsize=22) plt.ylim(0, 1.1) plt.plot(xdata, ydata, barve[k]) root = tk.Tk() root.withdraw() pot = tk.askdirectory(initialdir='/media/vid/DLS DATA/seq4Amod35') seznam = os.listdir(pot) seznam = natsort.natsorted(seznam) fji = [] fjierr = [] serije = {} temp = [] indeks = -1 params = lm.Parameters() params.add('A', value=0.01) params.add('y0', value=0) params.add('jd', value=0.7, min=0, max=1) params.add('f1', value=430, min=0) params.add('f2', value=1.5)
def prompt_dir(): from tkinter import filedialog filedialog.Tk().withdraw() directory = filedialog.askdirectory() return directory
def disconnect(self): self.lasso.disconnect_events() self.fc[:, -1] = 1 self.collection.set_facecolors(self.fc) self.canvas.draw_idle() if __name__ == '__main__': import matplotlib.pyplot as plt import os from tkinter import filedialog plt.ion() root = filedialog.Tk() root.withdraw() pot = filedialog.askdirectory(initialdir='/media/vid/DLS DATA/') seznam = os.listdir(pot) di = {} temperatura = [] absor = [] # print(seznam) for a in seznam: if a[-4:] == '.txt': key = a.split('.')[0] # print('nutr') # try: with open(pot + '//' + a, encoding='windows-1250') as file:
import cv2 as cv import numpy as np import matplotlib.pyplot as plt from tensorflow.keras import datasets, models import os from tkinter import filedialog os.chdir(os.path.dirname(__file__)) openWin = filedialog.Tk() openWin.withdraw() imgname = filedialog.askopenfilename(filetypes=[('PNG', '*.png')]) if not imgname.endswith('.png'): imgname = imgname + '.png' (training_images, training_labels), (testing_images, testing_labels) = datasets.cifar10.load_data() training_images, testing_images = training_images / 255, testing_images / 255 class_names = ['Plane', 'Car', 'Bird', 'Cat', 'Deer', 'Dog', 'Frog', 'Horse', 'Ship', 'Truck'] training_images = training_images[:20000] training_labels = training_labels[:20000] testing_images = testing_images[:4000] testing_labels = testing_labels[:4000] model = models.load_model('image_classifier.model') if imgname != '': img = cv.imread(imgname) img = cv.cvtColor(img, cv.COLOR_BGR2RGB) plt.imshow(img, cmap=plt.cm.binary) predection = model.predict(np.array([img]) / 255) index = np.argmax(predection) print(f'Prediction Is: {class_names[index]}') plt.xlabel(class_names[index]) plt.show()
import requests, os, shutil, sys from bs4 import BeautifulSoup import tkinter as tk from tkinter import filedialog from getpass import getuser useSpigot = False worldPath = "C:/Users/" + getuser() + "/AppData/Roaming/.minecraft/saves/TestWorld" serverPath = "C:/Users/" + getuser() + "/Documents/WorldToServer/" filedialog.Tk().withdraw() def setUseSpigot(): global useSpigot useSpigot = False if useSpigot else True def selectWorldPath(): global worldPath, worldLocationEntry worldPath = worldLocationEntry.get() path = filedialog.askdirectory(initialdir=worldPath, title="Select World") if (path != ""): worldPath = path worldLocationEntry.delete(0, tk.END) worldLocationEntry.insert(0, worldPath) def selectServerPath(): global serverPath, targetLocationEntry serverPath = targetLocationEntry.get() path = filedialog.askdirectory(initialdir=serverPath, title="Select Server Path") if (path != ""): serverPath = path + "/" targetLocationEntry.delete(0, tk.END)
return _response except IOError: try: _response = requests.get(_link) return _response except IOError: print( 'Не удалось получить информацию с сайта animevost.org...\nВероятно ваш IP был заблокирован...' ) time.sleep(0.01) for _ in tqdm(range(10), desc='Завершение программы'): time.sleep(1) sys.exit(0) root = fd.Tk() root.withdraw() try: settings = open('settings.conf', 'r') for line in settings: current_string = str(line) break settings.close() file_name = current_string except FileNotFoundError: file_name = askfolder() except NameError: file_name = askfolder() anime_name = []
def choosefile(): t.Tk().withdraw() path = t.askdirectory() return path