Home > other >  Small white met a question about the Pycharm Tkinter
Small white met a question about the Pycharm Tkinter

Time:09-26



Excuse me, asked what the complains, a study in the afternoon,

CodePudding user response:

CodePudding user response:


What reason is this

CodePudding user response:

Study out

CodePudding user response:

Hello, how to install in pycharm tkinter, my pycharm can not find

CodePudding user response:

First, from the perspective of the problem:
See your error message is:
AttributeError: module 'tkinter' hs no attribute 'label'
- "means: tikinter this (variable? The library? There is no label this attribute
- "why not? I'm not familiar with this problem the specific details, but I have the ability to learn and problem solving skills
Record the process to solve the problem below:
First python (as if) there is a known (built-in) library call: tkinter

So go to Google search:
Python tkinter
Python tkinter label
Find some information:
Tk graphical user interface (GUI) - Python 3.8.2 document
https://docs.python.org/zh-cn/3/library/tk.html
Tkinter Tcl/Tk Python interface - Python 3.8.2 document
https://docs.python.org/zh-cn/3/library/tkinter.html#tkinter-modules
Tkinter - Python interface to Tcl/Tk - Python 3.8.2 documentation
https://docs.python.org/3/library/tkinter.html
Python GUI programming (Tkinter) | novice tutorial
https://www.runoob.com/python/python-gui-tkinter.html
See some information:
"Python3. X version using the library name for tkinter, namely to lowercase letter T,
The import tkinter
To use Tkinter usually you only need a simple import statements:
The import tkinter
Or, more commonly used:
The from tkinter import *
"

Python - Tkinter Label - Tutorialspoint
https://www.tutorialspoint.com/python/tk_label.htm
Tkinter tutorial of Label _Python_ serpents dancing - CSDN blog article
https://blog.csdn.net/jcodeer/article/details/1811293
The from Tkinter import *
Initialization # Tk
Root=Tk ()
# create a label, the use of coding, so far has not been used directly through the "drag - and - drop" can be completed IDE,
Label=label (root, text='Hello Tkinter)
The Label & amp; The Button labels and buttons - window Tkinter | don't bother Python
https://morvanzhou.github.io/tutorials/python-basic/tkinter/2-01-label-button/
"L=tk. Label (window,
Text='OMG! This is TK! ', # label text
Bg='green', # background color
The font=(' Arial, 12), # font and font size
Width=15, height width=2 # tag
)
L.p ack () # fixed window position "
Tkinter. TTK Tk theme widgets - Python 3.8.2 document
https://docs.python.org/zh-cn/3/library/tkinter.ttk.html#label-options
L1=tkinter. Label (text="Test", fg="black", bg="white")
L2=tkinter. Label (text="Test", fg="black", bg="white")

[conclusion]
* in Python tkinter is own
* no additional installation
The name of the * tkinter library
* is capitalized in Python 2 T: Tkinter
* be lowercase in Python 3 T: tkinter
* import tkinter common written in Python 3
There are two: *
* ordinary: import tkinter
* more common: the from tkinter import *
The Label L * tkinter is uppercase
* from the website can view to
* tkinter TTK Tk theme widgets - Python 3.8.2 document
* https://docs.python.org/zh-cn/3/library/tkinter.ttk.html#label-options
* use Label written in tkinter
 import tkinter 
L1=tkinter. Label (text="Test", fg="black", bg="white")

Or:
 the from tkinter import * 
L1=Label (text="Test", fg="black", bg="white")


- "here, you take:

 CCC=tkinter. Label (win 

To:
 CCC=tkinter. Label (win 




[extension=extrapolate]
* why you will write lowercase capital Label Label?
* because: you do not have to refer to the website document
* why you can't find the website document? Or don't know how's website documents?
* because actually not familiar with: learning ideas
* good study idea is: there is a problem, try to find a website technical document
* because the website technical documentation, explained the problem often
* the most clear and understand that a lot of technology, website written materials are very easy to understand
* the most accurate: unlike other may be lag or expired
* how to learn good study ideas and methods?
* reference (I will) released tutorial
* learning method and technical experience summary
* Python small white how to avoid common pit?
* reference (I will) released tutorial
* Python beginners small white common errors and problems

CodePudding user response:

Label a capital L, boss
  • Related