Tkinter教程之Canvas篇(1)

Python ---(十一)Tkinter窗口组件:Canvas 上一篇:Python —(十)Tkinter窗口组件:Text                            &nbsp... 阅读详情
''' Tkinter教程之Canvas篇(1) '''
#  提供可以用来进行绘图的Container,支持基本的几何元素,使用Canvas进行绘图时,所有的操作都是通过Canvas,不是通过它的元素
#
 元素的表示可以使用handle或tag。
''' 1.第一个Canvas程序 '''
#  -*- coding: cp936 -*-
#
 指定画布的颜色为白色
from  Tkinter  import   *
root 
=  Tk()
#  创建一个Canvas,设置其背景色为白色
cv  =  Canvas(root,bg  =   ' white ' )
cv.pack()
root.mainloop()
#  为明显起见,将背景色设置为白色,用以区别root

''' 2.创建一个item '''
#  -*- coding: cp936 -*-
#
 创建一个矩形,指定画布的颜色为白色
from  Tkinter  import   *
root 
=  Tk()
#  创建一个Canvas,设置其背景色为白色
cv  =  Canvas(root,bg  =   ' white ' )
#  创建一个矩形,坐标为(10,10,110,110)
cv.create_rectangle( 10 , 10 , 110
Tkinter教程之Canvas篇(4) Tkinter教程之Canvas篇(4)22.绘制弧形# -*- coding: cp936 -*-# 创建一个ARCfrom Tkinter import *root = Tk()# 创建一个Canvas,设置其背景色为白色cv = Canvas(root,bg = white)cv.create_arc((10,10,110,110),)cv.pack()roo 阅读详情

相关推荐

Tkinter教程之Canvas篇(3)

Tkinter教程之Canvas篇(3)16.移动item# -*- coding: cp936 -*-# move指定x,y在偏移量from Tkinter import *root = Tk()# 创建一个Canvas,设置其背景色为白色cv = Canvas(root,bg = white)# 创建两个同样的rectangle,比较移动前后的不同rt1 = c

灵蛇舞动 7299

Tkinter教程之Canvas篇(2)

Tkinter教程之Canvas篇(2)9.创建item的tags# -*- coding: cp936 -*-# 使用属性tags设置item的tag# 使用Canvas的方法gettags获取指定item的tagsfrom Tkinter import *root = Tk()# 创建一个Canvas,设置其背景色为白色cv = Canvas(root,bg = 

灵蛇舞动 6652

python tkinter详解

PYTHON TKINTER Tkinter 模块(Tk 接口)是 Python 的标准 Tk GUI 工具包的接口 .Tk 和 Tkinter 可以在大多数的平台下使用,同样可以应用在 Windows 和 Mac系统里。 与tkinter齐名的还有wxpython,jython,pyqt(pyqt5)。其中,公认的对python新手而言的好用程度:jython<tkinter<wxpython<pyqt。(仅代表博主所看到的意见,没有反驳的必要) Tkinter编程 一个标准

python萌新花花的博客 2万+

tkinter的Canvas组件,绘画基本知识

画布组件是Tkinter画图的最重要组件。画布对象是几何绘制、动画绘制的不二选项,本文专门对画布Canvas进行详细描述,并配以适当代码支持。

gongdiwudu的专栏 4326

Canvas 图形

The command $widget -> create type options is used to make different structures A few examples are given below For more information read the manual Example #!/usr/local/bin/perl use Tk; # Main Window

zhaoyangjian724的专栏 704

Veeam Backup 13 通过UI界面高效备份VMware ESXi虚拟机的完整指南

本文提供了一份使用Veeam Backup 13图形化界面高效备份VMware ESXi虚拟机的完整指南。内容涵盖从环境准备、添加vCenter/ESXi主机、配置备份存储库,到创建备份任务、设置保留策略与计划,以及执行备份和验证成功的关键步骤。通过直观的UI操作,管理员可以轻松实现虚拟机数据的可靠保护与快速恢复。

weixin_29322553的博客 433

由于找不到mfc110u.dll,无法继续执行代码,重新安装程序可能会解决此问题的 解决方案

本文主要介绍了由于找不到mfc110.dll,无法继续执行代码的解决方案,希望能对使用Windows的同学们有所帮助。 文章目录 1. 问题描述 2. 解决方案

weixin_43178406的博客 5万+

智能预测性维护AI系统实战效率提升:AI应用架构师的技巧分享

在工业领域,预测性维护(Predictive Maintenance, PdM)是降低停机损失、优化维护成本的关键手段。然而,现有系统往往面临三大效率瓶颈数据处理延迟:工业设备产生的海量实时数据(如传感器、PLC)需传输至云端处理,导致预警滞后;模型推理效率:复杂深度学习模型(如ResNet、Transformer)在边缘设备上推理时间长,无法满足实时要求;落地集成困难:与企业现有ERP、MES、SCADA系统对接繁琐,导致“模型好用但业务不用”的尴尬。本文从架构、数据、模型、落地架构设计。

AI天才研究院 744

华为OD机试双机位C卷 - 高矮个子排队 (C++/Py/Java/Js/Go/C)

华为OD机试双机位C卷 高矮个子排队,提供C语言、Java、C++、Python、Go、JavaScript源码实现,并提供完整思路讲解。华为OD机试 - 高矮个子排队。

qq_45776114的博客 2159

RT-DETR改进策略【RT-DETR和Mamba】| 替换骨干 Mamba-RT-DETR-T !!! 最新的发文热点

模块是模型中的一个重要组成部分,其主要作用是在模型的初始阶段对输入图像进行处理,方便后续的特征提取和目标检测。以下是对。

Limiiiing的博客 1321

HBase学习二:RegionServer详解

RegionServer是HBase系统中最核心的组件,主要负责用户数据写入、读取等基础操作。RegionServer组件实际上是一个综合体系,包含多个各司其职的核心模块:HLog、MemStore、HFile以及BlockCache。一个RegionServer由一个(或多个)HLog、一个BlockCache以及多个Region组成。其中,HLog用来保证数据写入的可靠性;BlockCache可以将数据块缓存在内存中以提升数据读取性能;

qwerty1372431588的博客 747

手把手教你学AI GPU UMD驱动软件开发专栏--1.1 UMD(用户模式驱动)的定义与定位

摘要:UMD(用户模式驱动)是GPU驱动架构中的关键组件,负责连接AI应用与硬件。作为运行在用户空间的动态链接库,UMD通过减少系统调用开销显著提升AI计算性能。其核心功能包括API转换、资源管理和命令生成,同时具备安全性高(崩溃不影响系统)、开发灵活等优势。随着AI发展,UMD已从图形驱动演变为深度学习加速的关键组件,支持TensorCore等硬件特性优化。未来趋势包括深度框架集成、硬件感知增强和虚拟化支持。UMD通过性能优化和安全隔离机制,成为现代AI计算基础设施的理想选择。

MHD0815的博客 170

如何设置Xilinx以太网IP核的Pause帧处理

这里要注意,为什么是或,第一个条件是该功能使能取反,也就是说,如果你设置使能不打开的话,这个条件是直接满足的;先来看图中第二句,判断该以太网数据包为Global Pause帧(gpp),首先要满足Step1,然后是由上图中第二句代码(assign global_pause_packet)后面的所有项“与”(&&)起来的,就是说要满足后面所有的项,分别是DA符合,SA符合,Etype符合,Opcode符合,并且使能了该功能(即设置ctl_rx_enable_gpp=1)。如果没通过,则进入Step3。

qq_43416206的博客 616

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

上一篇: Tkinter教程系列前言
下一篇: Tkinter教程之Canvas篇(2)
jcodeer
博客等级 码龄22年 272粉丝 43原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值