gui

“RuntimeError: Calling Tcl from different appartment” tkinter and threading

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to implement GUI using threading and tkinter ( python 3.6 ). When I run GUIExecution.py, the following error occurs. " RuntimeError: Calling Tcl from different appartment " on self.root.mainloop() in base_gui_class.py I am implementing it on a class basis, and the three code files are as follows. The executable file is GUIExecution.py. I spent a lot of time trying to fix the error, but I have not been able to fix it yet. Please give a lot of advice. Additionally, if I run the following code in a python2 environment, it works fine

Python简单制作GUI界面

我怕爱的太早我们不能终老 提交于 2019-12-03 01:36:31
不管你是 Mac OS 系统,还是 Windows 系统,它都可以生成相对应的操作界面,这就是所谓的跨平台。其原理就是我们使用 Python代码去调用 Tkinter, Tkinter 已经封装了访问TK的接口,这个接口是一个图形库,支持多跨平台操作系统,进而通过它,我们就可以调用我们系统本身的GUI接口了。 操作系统:Windows / Linux / Mac OS Python版本:3.6.6 [Python] 纯文本查看 复制代码 ? 1 2 3 4 5 import tkinter # 定义一个窗体 top = tkinter.Tk() # 将其加入主循环 top.mainloop() [Python] 纯文本查看 复制代码 ? 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 import tkinter as tk import tkinter.messagebox as mbox # 定义MainUI类表示应用/窗口,继承Frame类 class MainUI(tk.Frame): # Application构造函数,master为窗口的父控件 def

Python Flask - GUI for client

匿名 (未验证) 提交于 2019-12-03 01:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to run a client-side file dialog GUI so that the user can choose a file to process with python ( example ). My code, which fundamentally works fine, is here: from flask import Flask, url_for, request app = Flask(__name__) @app.route('/data') def gui_test(): import Tkinter, tkFileDialog root = Tkinter.Tk() root.withdraw() filepath = tkFileDialog.askopenfilename() with open(filepath,'rb') as tt: lines = tt.readlines() return 'You are reading ' + filepath + '<p>Top 10 lines for proof of concept<p>'+'<br>'.join(lines[0:10]) if __name__ ==

Start a GUI process in Mac OS X without dock icon

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an application that normally runs with a standard graphical interface. However, for certain long-running tasks, it spawns additional processes of the same application that run in a "script mode," where I am controlling it from the parent process. Everything works great, except that for each child process I get another dock icon that pops in for a second or two and then disappears. Is there a way to run an application sometimes without the application icon showing up on the dock? I can't edit the info.plist or anything because normally

Can/Does WPF have multiple GUI threads?

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Can/Does WPF have multiple GUI threads? Or does it always only have one GUI thread (even if I have multiple windows/dialogs)? I'm asking because I have events coming from other threads and I'd like to handle them in the GUI thread (because I need to modify the controls of my main window accordings to the events). Btw: I know I need to use a Dispatcher object for this purpose. So, I could rephrase my question and ask: Is there always only one Dispatcher object for all GUI elements in WPF? 回答1: Based on the link in the first answer I did some

git gui - can it be made to display UTF16?

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there any way to make git gui display and show diffs for UTF16 files somehow? I found some information , but this is mostly referring to the command line rather than the gui. 回答1: I have been working on a much better solution with help from the msysGit people, and have come up with this clean/smudge filter. The filter uses the Gnu file and iconv commands to determine the type of the file, and convert it to and from msysGit's internal UTF-8 format. This type of Clean/Smudge Filter gives you much more flexibility. It should allow Git to

Threads and tkinter python 3

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I've heard that threads in Python are not easy to handle and they become more tangled with tkinter. I have the following problem. I have two classes, one for the GUI and another for an infinite process. First, I start the GUI class and then the infinite process' class. I want that when you close the GUI, it also finishes the infinite process and the program ends. A simplified version of the code is the following: import time , threading from tkinter import * from tkinter import messagebox finish = False class tkinterGUI ( threading

Python GUI framework for Mac OS X

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to find a good "python GUI framework" for Mac OS X, but I haven't found anything good until now, only wxWidgets which I don't like and it's also unstable. Any suggestions? 回答1: I use pyqt ( pyside should be equivalent but with more relaxed license terms) and I find it pleasing and useful -- I also like the fact that (with no extra effort on my part) it gives me cross-platform apps!-) pyobjc (comes w/your Mac, works w/Xcode, etc) may be preferable for apps you never want to be cross-platform, but I find it less easily usable than

PyQt - Modify GUI from another thread

匿名 (未验证) 提交于 2019-12-03 01:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to modify my main layout from another thread. But the function run() is never called and i'm having the error: QObject::setParent: Cannot set parent, new parent is in a different thread Here's my code: class FeedRetrievingThread(QtCore.QThread): def __init__(self, parent=None): super(FeedRetrievingThread, self).__init__(parent) self.mainLayout = parent.mainLayout def run(self): # Do things with self.mainLayout class MainWindow(QtGui.QDialog): def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.mainLayout

GTK3 function keys; which are consumed (and unusable from my GTK app)?

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: FWIW, the exact program motivating this question is (on Linux/Debian/Sid/x86-64) my bismon on github, commit d43a75fb9f8e13 . GTK3 is 3.22.24. If you need to try it, build it with make and run ./bismon . It is in alpha stage, and still not interesting to others than me. It is some kind of DSL interpreter with a GTK interface and a persistent heap. If you want something to appear, click to focus on the middle widget, type the_system there followed by Ctrl Return , but that is not relevant for this question. I am successfully able, with