All kinds of window bar, quite simple,
Look at the tutorials, the tutorials URL click on the Open link
Tried a variety of window.
Source:
Import tkinter.messagebox
import tkinter as TK
window=tk. Tk ()
window.title (' menu ')
window.geometry (' 400x400 ')
def hit ():
#box系列
# Tk.messagebox.showinfo (title= ' Hi ', message= ' So is a MsgBox ')
#tk. messagebox.showwarning (title= ' warning '), Message= ' So is a Warningbox ')
#tk
1, fonts (font)
General format: (' Times-10 bold ')
(' Times ', ten, ' bold ', ' italic ') in turn, indicate font, font size, bold, italic
2, the use of pictures (image)
Photo=photoimage (file= ' path.gif ')
Canvas = Canvas.create_image (Image=photo)
Tkinter only supports a few other formats, such as GIF and BMP, you want to insert other format pictures you need to import Pil;pip install a Third-party class library pillow
From PIL import image,imagetk
stipple= "gray25". has no effect unless the fill have been set to some color. See section 4.7, "Bitmaps".
Tags
The tags to is associated with the object, as a sequence of strings. See section 6.1.4, "Canvas tags".
Width
The Width of the border around the outside of the ellipse. Default is 1 pixel; See sections 4.1, "Dimensions" for possible values. If you set this to zero, the border is not appear. If you set this to zero and make the fill transparent
This paper is mainly based on colorsys implementation, the sample is from HLS to RGB, if you want to change the color space is very easy to modify only a function, the specific content is as follows
Scale and canvas components are used.
Run:
The code is as follows:
from Tkinter import * Import Colorsys #操作后的响应函数 def update (* args): ' color ' r,g,b = Colorsys.hl S_to_rgb (H.get ()/255.0, L.get ()/255.0, S.get ()/255.0) R,g,b = R * 255, G * 255, B *
The module ("Tk interface") isInterface of the standard Tk GUI toolkit. Tk andIt can be used on most Unix platforms,
It can also be applied in Windows and Macintosh systems. Later versions of Tk8.0 can implement local window styles and run well on most platforms.
Is a Python module with Tk interfaces,Library provides interfaces for Tk APIs,
It belongs to the GUI tool group of Tcl/Tk. Tcl/Tk is a writing and graphics device developed by John Ousterhout.
Tcl (tool command language) is a macro
of the dialog box. If this option is not specified, then a default title will be displayed.
[Source:]
Http://www.tcl.tk/man/tcl8.4/TkCmd/getOpenFile.htm
Http://www.tcl.tk/man/tcl8.4/TkCmd/chooseDirectory.htm
Example
This example just shoshould give you an idea of the modules use.
import Tkinter, Tkconstants, tkFileDialogclass TkFileDialogExample(Tkinter.Frame): def __init__(self, root): Tkinter.Frame.__init__(self, root) # options for but
Event:1 def evclear (): 2 lhistory['text'] = ehello.get ()3 ehello.delete (0, Tk. END)DescriptionThe text within the lhistory tag becomes the content of the Ehello input area, and then the text of the Ehello area is deleted.You can set the label text using a dictionary-style access method.Delete () uses 0 as the first argument, the description text begins, and the second parameter Tk. END. Represents a special value that represents the end of the text.python-Module-
1 #!/usr/bin/env python2 #-*-coding:utf-8-*-3 4 ImportTkinter as TK5 6 classFullscreenapp (object):7 def __init__(Self, master, * *Kwargs):8Self.root =Master9 #self.tk.attributes ('-zoomed ', True) # This just maximizes it so we can see the window. It 's nothing-to-do with fullscreen.TenSelf.frame =tk. Frame (self.root) One Self.frame.pack () ASelf.state =False -Self.root.bind ("", Self.toggle_fullscreen) -Self.root.bind ("", Self.end_fullscreen) the - defToggle_fullscreen (Self
Reply content:Basic syntax
Coding techniques, coding specifications
Various functions
Various PHP modules
Learn a CMS or two-time development
Learn about Pdo,ado, data-driven layers, and learn MySQL on the go
Error mechanism
Object oriented
Use a framework to help develop
Magic method
Design Patterns
Reflection
Write all kinds of tools, drivers.
Write a small fra
reading is not enough, actual combat is the most important, so-called learning, such as in the "Python core programming 2" after class exercises/learning some small script/etc., here are several sites for the Python script instance study:
(1). Code share list--Python
(2). Python Code Library
(3).
https://
searchcode.com/
(4). GitHub best choice, more search some related projects, look at someone else's code, copy the wheel!!
4. Advanced entryThe Python advanced section of learning can ref
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.