我正在尝试学习Python并在Python中尝试使用GUI,并遇到了这个Tkinter模块.我的代码运行但运行时窗口没有出现.我的代码如下
#GUI
#from Tkinter import *
from Tkinter import *
#to create a root window
root = Tk()
Run Code Online (Sandbox Code Playgroud)
任何有关这方面的帮助将不胜感激.程序运行,没有错误,但从/窗口没有显示
我有133个名为Trace1.log Trace2.log的文件等等,所以如何将所有这些文件合并在一起并保存在一个文件中
我写了一些代码,我不确定错误是什么.我收到错误:
在串联(.)中使用未初始化的值或在mksmksmks.pl第63行使用字符串
我的代码如下:
for(my $j = 0; $j < $num2; $j++) {
print {$out} "$destination[$j]|$IP_one_1[$j]|$IP_one_2[$j]|$reached[$j]|$IP_two_1[$j]|$IP_two_2[$j]\n";`
}
Run Code Online (Sandbox Code Playgroud) 我编写了以下程序,但不确定它有什么问题,它给出了:
File "Button_2.py", line 9
""" Initialise the Frame. """
^
IndentationError: expected an indented block
Run Code Online (Sandbox Code Playgroud)
这是我的代码的图像:
这里发生了什么?
我正在尝试使用类在Python中创建按钮,但在运行它时按钮不会出现.以下是我的代码
#Button_2
#Using Classes
from Tkinter import *
class Application(Frame):
"""A GUI application with three button"""
def _init_(self, master):
""" Initialise the Frame. """
Frame._init_(self, master)
self.grid()
self.create_widgets()
def create_widgets(self):
#"""Create three buttons"""
#Create first buttom
self.btn1 = Button(self, text = "I do nothing")
self.btn1.grid()
#Create second button
self.btn2 = Button(self)
self.btn2.grid()
self.btn2.configure(text = "T do nothing as well")
#Create third button
self.btn3 = Button(self)
self.btn3.grid()
self.btn3.configure(text = "I do nothing as well as well")
root = Tk()
root.title("Lazy Button …
Run Code Online (Sandbox Code Playgroud)