1. Install Python2. Install QT Designer or Qt creator3. Open QT Designer to draw the graphical interface you wantLike thisSave the file and save it in the form of a UI suffix4. Download and install PysideDirect Easy_install or PIP installation may be saved when I install, prompting for MSVC version issueAfter viewing many foreign forums, you can choose to download the corresponding Python version of the WHL
Python provides a library of multiple graphical development interfaces, several common Python GUI libraries are as follows:
Tkinter: The Tkinter module (TK interface) is the interface for Python's standard Tk GUI toolkit. Tk and Tkinter can be used on most Unix platforms and can also be applied to Windows and Macintosh systems. Subsequent versions of Tk8
1. Steps to create a graphical user interface using Tkinter(1) Import Tkinter module, use import Tkinter or from Tkinter import *(2) Create a top-level window object container, using top = tkinter.tk ()(3) Creating a GUI object on the top-level window object(4) Connecting the GUI object to the underlying program code(5) Enter the main event loopFor example:# !/usr/bin/env python Import == Tkinter.label (to
PySide -- Python graphical interface getting started (3), pysidepython
PySide -- Python graphical interface getting started tutorial (3)
-- Create an internal number and a slot
-- Using Built-In Signals and Slots
In the previous tutorial, we learned how to create and establish an interactive widgets and how to la
In Python's matplotlib, and R in the drawing itself, if you want to save the picture, when you have a graphical user interface is not a problem, but when there is no graphical user interface, will be error:
In R, the workaround:
6373291
In Python, the workaround:
Before you import other packages for Matplotlib, write the following statement:Import
Python supports third-party libraries for a variety of graphical interfaces, including:
Tk
WxWidgets
Qt
Gtk
Wait a minute.
But Python's own library is a tkinter that supports TK, using Tkinter, which can be used directly without installing any packages. This chapter briefly describes how to use Tkinter for GUI programming.Tkinter
Let's comb the concept:
The
12.1 Rich PlatformBefore writing a Python GUI program, you need to decide which GUI platform to use. Wxpython----Cross-platform Pythongui ToolkitMake sure that the binary version that you select corresponds to the version of Python, for example, Wxpython compiled for python2.3 is not available for python2.4.12.3.1 StartThe WX module needs to be started:Import WXThere are many ways to write Wxpython programs
Use Python for image programming, to use the graphics library. The graphics library can be obtained from http://mcsp.wartburg.edu/zelle/python/graphics.py. Save the downloaded graphics.py on the Windows platform in C:\Python31\Lib\site-packages. The following code shows how to draw points, draw lines, draw circles, draw rectangles, draw ellipses, and display text.From graphics import * #设置画布窗口名和尺寸win = Grap
A tkinter:tkinter is a python-backed library of TK, and Python code calls the native GUI (TKL language development) provided by the Tkinter->tk-> operating system to complete the interface development without the need to install any third-party programs. Tkinter Tutorial Second Edition Https://link.zhihu.com/?target=http%3A//pan.baidu.com/s/1hr6ortE,Python GUI pr
Main use of Wxpython (most mature cross-platform Python GUI toolkit) foreplay: Veteran python GUI program (Tkinter)Import Tkinter.messagebox asMessageBoxclassApplication (Frame): def __init__ (Self,master=None): frame.__init__ (SELF,MASTER,BG="Red") #设置框架类的父类 (based on master), frame can be considered as the parent container of the control Self.pack () #显示frame控件 self.createwidgets () def createwidgets (sel
. SetValue (File.read ()) File.close ()#save函数几乎和load一样, except that it has a ' W ' attribute and the Write method.#GetValue用于从文本区获得信息Def save (Event): file = open (filename. GetValue (), ' W ') file.write (contents. GetValue ()) File.close ()
Program Listing 6: The final program
import wxdef Load (event): File = open (filename. GetValue ()) contents. SetValue (File.read ()) File.close () def Save (event): File = open (filename. GetValue (), ' W ') file.write (contents.
construction Methods: Gauge (Parent,id,range=100,pos,size,style=ga_horizontal)Range refers to the value of an end point specified when the progress bar is loaded, and the program will confirm that the current progress bar should be more than full. The style specifies whether the load is loaded horizontally or vertically, and is loaded vertically ga_verticalUnlike some other components, it is not enough to construct the progress bar in the window alone, so the progress bar is static. The progres
=[ willing , " unwilling ", " listen to your orders. " reply=g.choicebox ( " you want to be with me, beautiful. ", Choices=choices) 5 G.msgbox (Reply) The functions of MsgBox are defined as follows1 >>> Help (G.msgbox)2 in module Easygui:34 MsgBox (msg='(Your message goes here)', title=', ok_button= 'OK', Image=none, root=None)5 Display a MessageBoxhere is a demonstration of the way to modify the button.1 g.msgbox ('is it ready? ', ok_button= ' yo Me grass ')about Ccbox1 M
A brief description of how to use Tkinter for GUI programming. fromTkinterImport*ImportTkinter.messagebox as MessageBox" "in the GUI, each button, Label, input box, and so on, is a widget. Frame is a widget that can accommodate other widgets, and all widgets are grouped together as a tree. The pack () method adds the widget to the parent container and implements the layout. Pack () is the simplest layout, and grid () allows for more complex layouts. In the Createwidgets () method, we create a la
, horizontal leftCenter centered vertically, horizontally centered
1 fromTkinterImport*2win=Tk ()3Win.title ('mywindows')4Lb=label (win,bitmap='Error')5 Lb.pack ()6Bm=photoimage (file='C:\\users\\cai\\desktop\\tp.png')7Lb2=label (win,image=BM)8lb2.bm=BM9 Lb2.pack ()TenLb3=label (win,fg='RED', bg='BLUE', text='Color') One Lb3.pack () AWin.mainloop ()Four, button components① is used to display the button in the window, the button can display text or images, creating the following syntax;
IntroductionMany development tasks today require remote access, such as deep learning that requires logging on to a dedicated server. When you need to see some visual results, you may need to use a drawing library such as Matplotlib or Seaborn. Then you may need to download the images to your local desktop via SSH or SCP, which is very troublesome.Considering that the present terminal basically have already supported the 24-bit true color expression, so it is natural to think that can be directl
Matplotlib is a common data visualization tool used in Python, and is a bit similar to MATLAB. Calls are simple and powerful. You can install it from the command line pip install matplotlib under Windows.Here are some examples of basic use:1. Draw a straight lineFirst generate a set of data on line y = 5 * x + 5 by NumPy and then draw it on the chart1 Import NumPy as NP 2 Import Matplotlib.pyplot as Plot 3 4 x = Np.linspace (1, ten, ten)5 y = 5 * x +
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.