小编use*_*917的帖子

Python Tkinter模块没有显示输出

我正在尝试学习Python并在Python中尝试使用GUI,并遇到了这个Tkinter模块.我的代码运行但运行时窗口没有出现.我的代码如下

 #GUI

#from Tkinter import *
from Tkinter import *
#to create a root window 
root = Tk()
Run Code Online (Sandbox Code Playgroud)

任何有关这方面的帮助将不胜感激.程序运行,没有错误,但从/窗口没有显示

python tkinter

4
推荐指数
2
解决办法
9499
查看次数

如果我有很多文件,如何在Linux中加入两个文件

我有133个名为Trace1.log Trace2.log的文件等等,所以如何将所有这些文件合并在一起并保存在一个文件中

merge text-files

3
推荐指数
1
解决办法
8374
查看次数

在串联(.)中使用未初始化的值或在mksmksmks.pl第63行使用字符串

我写了一些代码,我不确定错误是什么.我收到错误:

在串联(.)中使用未初始化的值或在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)

perl initialization

3
推荐指数
1
解决办法
5万
查看次数

Python中的IndentationError

我编写了以下程序,但不确定它有什么问题,它给出了:

File "Button_2.py", line 9
""" Initialise the Frame. """
                            ^
  IndentationError: expected an indented block
Run Code Online (Sandbox Code Playgroud)

这是我的代码的图像:

在此输入图像描述

这里发生了什么?

python user-interface indentation button

3
推荐指数
1
解决办法
378
查看次数

使用Python GUI创建按钮

我正在尝试使用类在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)

python user-interface class tkinter button

0
推荐指数
1
解决办法
1万
查看次数