最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Python GUI編程學(xué)習(xí)筆記之tkinter控件的介紹及基本使用方法詳解

 更新時(shí)間:2020年03月30日 11:26:42   作者:隨風(fēng)行云  
這篇文章主要介紹了Python GUI編程學(xué)習(xí)筆記之tkinter控件的介紹及基本使用方法,結(jié)合實(shí)例形式詳細(xì)分析了Python GUI編程中tkinter控件的原理、用法及相關(guān)操作注意事項(xiàng),需要的朋友可以參考下

本文實(shí)例講述了Python GUI編程學(xué)習(xí)筆記之tkinter控件的介紹及基本使用方法。分享給大家供大家參考,具體如下:

相關(guān)內(nèi)容:

  • tkinter的使用
    • 1.模塊的導(dǎo)入
    • 2.使用
    • 3.控件介紹
      • Tk
      • Button
      • Label
      • Frame
      • Toplevel
      • Menu
      • Menubutton
      • Canvas
      • Entry
      • Message
      • Text
      • Listbox
      • Checkbutton
      • Radiobutton
      • Scale
      • Scrollbar

首發(fā)時(shí)間:2018-03-04 16:39

Python的GUI各有各特點(diǎn)。

由于只是輕微涉及GUI開發(fā),所以就以輕量級(jí)的tkinter來學(xué)習(xí)。

tkinter的使用:

  • 1.模塊的導(dǎo)入

    • [tkinter是python默認(rèn)的gui庫(kù),所以一般不需要另外安裝模塊]:from tkinter import *
  • 2.使用:

    • 創(chuàng)建主窗口:root=Tk() 【root是一個(gè)主窗口對(duì)象】
    • 創(chuàng)建若干個(gè)控件:控件對(duì)象=控件(root,控件參數(shù)設(shè)置) 【這里的控件也可以添加到其他窗口中】
    • 將控件顯示出來:控件對(duì)象.pack() 【這里也不一定是pack,也可以是其他的顯示方式,比如grid,后面介紹】
    • 讓主窗口持續(xù)顯示:root.mainloop()
  • 3.控件介紹:

    • 主窗口Tk[所有控件都需要附著在界面上]:

      • 介紹:主窗口是所有控件附著的基礎(chǔ),所有控件都需要附著在界面上,如果程序中沒有指定控件附著的窗口,將默認(rèn)附著到主窗口Tk中,如果程序中沒有定義Tk,那么將自動(dòng)創(chuàng)建一個(gè)
      • 常見屬性【想要初始化主窗口的屬性需要使用 主窗口對(duì)象.屬性(“參數(shù)”) :
        • title:窗口標(biāo)題
        • geometry:窗口大小,大寫格式是”寬度x高度+x位置+y位置”【注意不是*是x】,其中x,y將左上角作為(0,0)
from tkinter import *

root=Tk()
root.title('我的窗口')
root.geometry('500x500')
root.mainloop()
  • 按鈕Button:

    • 介紹:按鈕image
    • 常用參數(shù)設(shè)置【可以在創(chuàng)建按鈕的時(shí)候指定,也可以創(chuàng)建后使用 按鈕對(duì)象.config() 來設(shè)置】:
      • text:按鈕上的文本顯示
      • anchor:按鈕上內(nèi)容的位置[取值:n, ne, e, se, s, sw, w, nw, or center,其中n e s w是東南西北的縮寫]
      • cursor:當(dāng)鼠標(biāo)移動(dòng)到按鈕上時(shí)所顯示的光標(biāo)【arrow:箭頭,cross:十字,dot: 點(diǎn),hand1:手 …….】
      • font:字體,使用元組來指定一個(gè)字體,這個(gè)元組包含了一個(gè)字體類型名字,一個(gè)以磅為單位的高度,代表一個(gè)或多個(gè)樣式的字符串,比如("Times", 10, "bold")
      • background[可縮寫為bg]:背景色,取值可未英文顏色字符串,或者RGB值
      • foreground[可縮寫為fg]:前景色,取值可未英文顏色字符串,或者RGB值
      • borderwidth[可縮寫為bd]::邊框大小
      • activebackground:按鈕處于活動(dòng)狀態(tài)時(shí)使用的背景顏色。
      • activeforeground:按鈕處于活動(dòng)狀態(tài)時(shí)使用的前景顏色。
      • disabledforeground:禁用按鈕時(shí)使用的顏色。
      • highlightbackground:當(dāng)按鈕沒有焦點(diǎn)時(shí)用于高亮邊框的顏色
      • relief:邊框的裝飾
        • 列表里面是relief的可選值:["flat", "raised", "sunken", "solid", "ridge", "groove"]
        • flat是指按鈕邊框是平坦的,raise是指按鈕邊框是凸起的,sunken是指按鈕邊框是凹入的,solid是指按鈕邊框是粗邊框…
        • 按鈕relief的效果:image
      • padx和pady:指定文本或圖象與按鈕邊框的間距,x,y為x軸,y軸方向
      • height,widht:按鈕的尺寸,height為高度,width為寬度,如果不設(shè)置則默認(rèn)為包括文本內(nèi)容
      • state:按鈕的狀態(tài),可取值:NORMAL, ACTIVE 或 DISABLED。默認(rèn)值為NORMAL。
      • justify:對(duì)齊方式
      • command:當(dāng)按下按鈕時(shí)調(diào)用的方法

Button所有的可設(shè)置參數(shù)

activebackground, activeforeground, anchor,
background, bitmap, borderwidth, cursor,
disabledforeground, font, foreground
highlightbackground, highlightcolor,
highlightthickness, image, justify,
padx, pady, relief, repeatdelay,
repeatinterval, takefocus, text,
textvariable, underline, wraplength

WIDGET-SPECIFIC OPTIONS【特有選項(xiàng)】: command, compound, default, height, overrelief, state, width

from tkinter import *

def hello():
 print("hello")
root=Tk()

# RELIEF=["flat", "raised", "sunken", "solid", "ridge", "groove"]

btn1=Button(root,text='click me')
btn1.config(bg='green',fg='white',cursor='hand1',height=10,width=10,command=hello,relief='sunken')
btn1.config(anchor=LEFT)
btn1.pack()

# for col,i in enumerate(RELIEF):
#  btn=Button(root,text=i,relief=i,anchor=S)
#  btn.grid(row=0,column=col)

root.mainloop()
  • Label:

    • 介紹:顯示一個(gè)文本或圖象。
    • 參數(shù)設(shè)置:label沒有什么特別的參數(shù),可用參數(shù)參考下面的可用參數(shù),再可以參考Button的參數(shù)設(shè)置
STANDARD OPTIONS【label的標(biāo)準(zhǔn)可選參數(shù)】

 activebackground, activeforeground, anchor,
 background, bitmap, borderwidth, cursor,
 disabledforeground, font, foreground,
 highlightbackground, highlightcolor,
 highlightthickness, image, justify,
 padx, pady, relief, takefocus, text,
 textvariable, underline, wraplength
WIDGET-SPECIFIC OPTIONS【特有選項(xiàng)】:

 height, state, width
from tkinter import *

root=Tk()
root.title('我的窗口')
root.geometry('500x500')

label=Label(text='用戶名:',bg='green')
label.grid()
root.mainloop()

image

  • 框架Frame:

    • 介紹:一個(gè)容器窗口部件??梢杂羞吙蚝捅尘?。Frame默認(rèn)是沒有大小的,所以必須要設(shè)置高度和寬度,而當(dāng)加了控件到Frame后它會(huì)“縮水”【這里縮水是因?yàn)镕rame自動(dòng)縮小到剛好能包裹控件】,需要在顯示的時(shí)候強(qiáng)制設(shè)置大小比如pack(fill=X),這是強(qiáng)制填充水平方向,又或者使用 Frame對(duì)象.pack_propagate(0),這個(gè)函數(shù)可以使得設(shè)置的高度和寬度生效
    • 參數(shù)設(shè)置:可用參數(shù)參考下面的可用參數(shù),再參考按鈕的參數(shù)設(shè)置
STANDARD OPTIONS【標(biāo)準(zhǔn)可用參數(shù)】

 activebackground, activeforeground, anchor,
 background, bitmap, borderwidth, cursor,
 disabledforeground, font, foreground,
 highlightbackground, highlightcolor,
 highlightthickness, image, justify,
 padx, pady, relief, takefocus, text,
 textvariable, underline, wraplength
#這是一段沒有顯示Frame 代碼
from tkinter import *

root=Tk()
root.geometry('500x500')
frame=Frame(root,height = 200,width = 400,bg = 'black')

Label(frame,text='mylabel').pack()

frame.pack()

root.mainloop()
#下面是探究出縮水原因的代碼
from tkinter import *

root=Tk()
root.geometry('500x500')
frame=Frame(root,height = 400,width = 400,bg = 'green')


button1=Button(frame,text='hello')
button1.pack(side=LEFT,padx=5,pady=5)#增加了邊距之后,發(fā)現(xiàn)出了frame的背景顏色
button2=Button(frame,text='hello')
button2.pack(side=LEFT)
frame.pack(side=TOP)


root.mainloop()

image

#下面的是使用.pack_propagate(0)解決了問題的代碼
from tkinter import *

root=Tk()
root.geometry('500x500')
frame=Frame(root,height = 400,width = 400,bg = 'green')

# Label(frame,text='mylabel',padx=5,pady=5).pack(side=LEFT)
button1=Button(frame,text='hello')
button1.pack(side=LEFT,padx=5,pady=5)
button2=Button(frame,text='hello')
button2.pack(side=LEFT)
frame.pack_propagate(0)
frame.pack(side=TOP)

# frame.pack(side=TOP,fill=X)

root.mainloop()
  • Toplevel:

    • 介紹:一個(gè)容器窗口,作為一個(gè)單獨(dú)的、最上面的窗口顯示。 image
    • 參數(shù)設(shè)置:可用參數(shù)參考下面的,用法參考Tk的
    • Toplevel是一個(gè)子窗口,當(dāng)父窗口關(guān)閉時(shí)子窗口會(huì)關(guān)閉,但子窗口關(guān)閉時(shí)父窗口不關(guān)閉
Valid resource names: 
background, bd, bg, borderwidth, class,
colormap, container, cursor, height, highlightbackground,
highlightcolor, highlightthickness, menu, relief, screen, takefocus,
use, visual, width
from tkinter import *

root=Tk()
root.title('我的窗口')
root.geometry('500x500')

t1=Toplevel(root)
t1.title("Top窗口")
t1.geometry("100x100")
label=Label(t1,text="用戶名:")
label.pack()
root.mainloop()
  • 菜單Menu:

    • 介紹:菜單控件,相當(dāng)于一個(gè)菜單組\菜單欄,沒有添加其他菜單時(shí)默認(rèn)沒有顯示,只有添加其他的菜單,才會(huì)了實(shí)際的意義
    • 要想顯示菜單,必須在“要添加菜單的窗口對(duì)象”的config中允許添加上“菜單對(duì)象”image
    • 參數(shù)設(shè)置:可用參數(shù)參考下面的可用參數(shù),再參考按鈕的參數(shù)設(shè)置
      • 注意:Menu是沒有text的
    • 添加菜單按鈕:
      • 添加命令菜單:Menu對(duì)象.add_command()
      • 添加多級(jí)菜單:Menu對(duì)象.add_cascade(**options) 【多級(jí)菜單可以傳入一個(gè)菜單對(duì)象】image
      • 添加分割線:Menu對(duì)象.add_separator(**options)
      • 添加復(fù)選框菜單:Menu對(duì)象.add_checkbutton(**options)
      • 添加單選框菜單:Menu對(duì)象.add_radiobutton(**options)
      • 插入菜單:insert_separator(),insert_checkbutton(),insert_radiobutton(),insert_cascade(),
      • 其他。。。。
常見可用參數(shù):
activebackground, activeborderwidth,
activeforeground, background, bd, bg, borderwidth, cursor,
disabledforeground, fg, font, foreground, postcommand, relief,
selectcolor, takefocus, tearoff, tearoffcommand, title, type
from tkinter import *

root=Tk()

menuBar=Menu(root,tearoff=0)
root.config(menu=menuBar)
filemenu=Menu(menuBar,fg='green')#文件菜單下的字體是綠色的
filemenu.add_command(label='新建',accelerator = 'Ctrl+N')
filemenu.add_command(label='打開',accelerator = 'Ctrl+O')
filemenu.add_command(label='保存',accelerator = 'Ctrl+S')
filemenu.add_command(label='另存為',accelerator ='Ctrl+Shift+S')
menuBar.add_cascade(label='文件',menu=filemenu)

#這里測(cè)試root.config(menu=menuBar)的作用
# def show_menuBar():
#  root.config(menu=menuBar)
# button=Button(text='show_menu',command=show_menuBar)
# button.pack()


root.mainloop()
  • Menubutton:

    • 介紹:菜單按鈕。用來實(shí)現(xiàn)下拉式菜單。 image
    • 參數(shù)設(shè)置:可用參數(shù)參考上面Menu的,用法同樣可以參考按鈕Button的
    • 添加菜單的方法參考Menu的
    • 注意:這次不是在root里面config了,而是在菜單按鈕中設(shè)置
from tkinter import *
root=Tk()
menubtn=Menubutton(root,text='單擊出現(xiàn)下拉菜單',relief='raise')#建立一個(gè)菜單按鈕
menubtn.pack()
#添加菜單
filemenu=Menu(menubtn)
filemenu.add_command(label='新建')

menubtn.config(menu=filemenu)#設(shè)置菜單按鈕允許顯示菜單,這里不是root了
root.mainloop()

  • Canvas:

    • 介紹:組織圖形。這個(gè)部件可以用來繪制圖表和圖,創(chuàng)建圖形編輯器,實(shí)現(xiàn)定制窗口部件
    • 參數(shù)設(shè)置:可用參數(shù)參考下面的,用法同樣可以參考按鈕Button的
    • 添加圖像的方法:
      • create_rectangle:根據(jù)四個(gè)參數(shù)畫一個(gè)矩形,四個(gè)參數(shù)是位置
      • create_polygon:根據(jù)提供的多個(gè)參數(shù)畫一個(gè)多邊形
      • 其他。。
可用參數(shù): background, bd, bg, borderwidth, closeenough,
confine, cursor, height, highlightbackground, highlightcolor,
highlightthickness, insertbackground, insertborderwidth,
insertofftime, insertontime, insertwidth, offset, relief,
scrollregion, selectbackground, selectborderwidth, selectforeground,
state, takefocus, width, xscrollcommand, xscrollincrement,
yscrollcommand, yscrollincrement
from tkinter import *

root=Tk()
root.title('我的窗口')
root.geometry('500x500')
mycanvas=Canvas(root,width=200,height=200,bg='green')
mycanvas.pack()
#畫一個(gè)矩形
mycanvas.create_rectangle(10,10,110,110,outline = 'red',width = 5)

root.mainloop()
  • Entry:

    • 介紹:?jiǎn)涡形谋据斎胗颉?image
    • 參數(shù)設(shè)置:可用參數(shù)參考下面的,用法同樣可以參考按鈕Button的
Valid resource names: background, bd, bg, borderwidth, cursor,
exportselection, fg, font, foreground, highlightbackground,
highlightcolor, highlightthickness, insertbackground,
insertborderwidth, insertofftime, insertontime, insertwidth,
invalidcommand, invcmd, justify, relief, selectbackground,
selectborderwidth, selectforeground, show, state, takefocus,
textvariable, validate, validatecommand, vcmd, width,
xscrollcommand.
from tkinter import *

root=Tk()
root.title('我的窗口')
root.geometry('300x300+20+10')
entry=Entry(root)
entry.pack()

root.mainloop()
  • Text:

    • 介紹:多行文本輸入域,允許你用不同的樣式和屬性來顯示和編輯文本。同時(shí)支持內(nèi)嵌圖象和窗口。 image
    • 參數(shù)設(shè)置:可用參數(shù)參考下面的,用法同樣可以參考按鈕Button的
STANDARD OPTIONS

 background, borderwidth, cursor,
 exportselection, font, foreground,
 highlightbackground, highlightcolor,
 highlightthickness, insertbackground,
 insertborderwidth, insertofftime,
 insertontime, insertwidth, padx, pady,
 relief, selectbackground,
 selectborderwidth, selectforeground,
 setgrid, takefocus,
 xscrollcommand, yscrollcommand,

WIDGET-SPECIFIC OPTIONS

 autoseparators, height, maxundo,
 spacing1, spacing2, spacing3,
 state, tabs, undo, width, wrap,
from tkinter import *

root=Tk()
root.title('我的窗口')
root.geometry('300x300+250+55')
button=Button(text='submit')
button.pack()
t1=Text(root,height=100,width=100,cursor='cross')
t1.pack()

root.mainloop()
  • Message:

  • 介紹:顯示多行文本。類似label窗口部件,但是能夠自動(dòng)地調(diào)整文本到給定的寬度或比率。 image
  • 參數(shù)設(shè)置:與Label類似
  • 由于Label也可以顯示多行文本后,就逐漸少用Message了。"""Message widget to display multiline text. Obsolete since Label does it too."""
  • Listbox:

    • 介紹:列表框用于從一組文本項(xiàng)目中進(jìn)行選擇。 根據(jù)列表框的配置方式,用戶可以從列表中選擇一個(gè)或多個(gè)項(xiàng)目。image
    • 參數(shù)設(shè)置:可用參數(shù)參考下面的,參數(shù)設(shè)置同樣可以參考按鈕Button的
      • selectmode:選擇模式,selectmode=EXTENDED時(shí)允許多選
      • selectbackground:選中時(shí)的背景顏色
      • selectforeground:選中時(shí)的字體顏色
      • selectborderwidth:選中時(shí)的邊框大小
    • 常用函數(shù):
      • 插入:insert(索引,元素)
      • 刪除:delete(索引,元素)
      • 獲取listbox元素:get()
Valid resource names: background, bd, bg, borderwidth, cursor,
exportselection, fg, font, foreground, height, highlightbackground,
highlightcolor, highlightthickness, relief, selectbackground,
selectborderwidth, selectforeground, selectmode, setgrid, takefocus,
width, xscrollcommand, yscrollcommand, listvariable
from tkinter import *

root=Tk()
root.title('我的窗口')
root.geometry('300x300+20+10')
# listbox=Listbox(root)
listbox=Listbox(root,selectmode=EXTENDED)
listbox.insert(0,"孫悟空")
listbox.insert(1,"唐僧")
listbox.insert(2,"葫蘆娃")
listbox.pack()
def func1():
 print(listbox.get(0,END))#以元組形式返回所有l(wèi)istbox的元素
def func2():
 print(listbox.select_includes(1))#當(dāng)對(duì)應(yīng)索引被選中時(shí)返回True
def func3():
 print(listbox.curselection())#以元組形式返回被選中的元素

btn1=Button(text="獲取所有元素",command=func1)
btn1.pack()
btn2=Button(text="判斷1是否選中",command=func2)
btn2.pack()
btn3=Button(text="獲取選中的索引",command=func3)
btn3.pack()


root.mainloop()
  • 復(fù)選框Checkbutton:

    • 介紹:復(fù)選框點(diǎn)擊這個(gè)按鈕將會(huì)在這兩個(gè)值間切換。
    • 參數(shù)設(shè)置:可用參數(shù)參考下面的,用法同樣可以參考按鈕Button的
      • variable:值為tkinter變量,可以使用 tkinter變量.get方法 來獲取是否選中
    • 如果想要獲取選中值,必須設(shè)置一個(gè)tkinter變量來獲取,tkinter變量類型有:BooleanVar, DoubleVar, IntVar, StringVar
可用參數(shù):activebackground, activeforeground, anchor,
background, bd, bg, bitmap, borderwidth, command, cursor,
disabledforeground, fg, font, foreground, height,
highlightbackground, highlightcolor, highlightthickness, image,
indicatoron, justify, offvalue, onvalue, padx, pady, relief,
selectcolor, selectimage, state, takefocus, text, textvariable,
underline, variable, width, wraplength
from tkinter import *

root=Tk()
root.title('我的窗口')
root.geometry('200x200')
def submit():
 print('男:',v1.get(),'女:',v2.get(),'另外:',v3.get())#選擇則值為1,不選中為0
 # pass


v1 = IntVar()   #用tkinter變量來表示按鈕是否選中
v2 = IntVar()
v3 = IntVar()
# 使用 Checkbutton時(shí),必須創(chuàng)建一個(gè) Tkinter 變量用于存放按鈕的狀態(tài):
cbtn=Checkbutton(root,text='男',variable=v1,command=submit)
cbtn2=Checkbutton(root,text='女',variable=v2,command=submit)
#v3是為了測(cè)試variable相同時(shí),點(diǎn)一個(gè),所有的v3都被選中
cbtn3=Checkbutton(root,text='不明',variable=v3,command=submit)
cbtn4=Checkbutton(root,text='保密',variable=v3,command=submit)

button=Button(text='submit',command=submit)
button.pack()
cbtn.pack()
cbtn2.pack()
cbtn3.pack()
cbtn4.pack()
root.mainloop()
  • Radiobutton:

    • 介紹:代表一個(gè)變量,它可以有多個(gè)值中的一個(gè)。點(diǎn)擊它將為這個(gè)變量設(shè)置值,并且清除與這同一變量相關(guān)的其它radiobutton。
    • 參數(shù)設(shè)置:可用參數(shù)參考下面的,用法同樣可以參考按鈕Button的
      • variable:值為tkinter變量,可以使用 tkinter變量.get方法 來獲取是否選中
      • value:根據(jù)前面的variable來決定數(shù)據(jù)類型,使用 tkinter變量.get方法 此時(shí)獲取的是選中選項(xiàng)的value的值
Valid resource names: activebackground, activeforeground, anchor,
background, bd, bg, bitmap, borderwidth, command, cursor,
disabledforeground, fg, font, foreground, height,
highlightbackground, highlightcolor, highlightthickness, image,
indicatoron, justify, padx, pady, relief, selectcolor, selectimage,
state, takefocus, text, textvariable, underline, value, variable,
width, wraplength
from tkinter import *

root=Tk()
v=StringVar()
l=['man','woman','unknow']
def ptr():
 print(v.get())
for i in l:
 rbtn=Radiobutton(root,text=i,variable=v,value=i,command=ptr)
 rbtn.pack()

root.mainloop()
  • Scale:

      介紹:允許你通過滑塊來設(shè)置一數(shù)字值。
    • 介紹:允許你通過滑塊來設(shè)置一數(shù)字值。 image
    • 常用參數(shù)設(shè)置:
      • from_:設(shè)置滑塊起始值
      • to:設(shè)置滑塊最大值
      • orient:設(shè)置方向,默認(rèn)是豎的,如果想改成水平的:orient=HORIZONTAL
Valid resource names: 
activebackground, background, bigincrement, bd,
bg, borderwidth, command, cursor, digits, fg, font, foreground, from,
highlightbackground, highlightcolor, highlightthickness, label,
length, orient, relief, repeatdelay, repeatinterval, resolution,
showvalue, sliderlength, sliderrelief, state, takefocus,
tickinterval, to, troughcolor, variable, width
from tkinter import *

root=Tk()
root.title('我的窗口')
root.geometry('300x300+20+10')
scale=Scale(root,from_=0, to=100)#默認(rèn)是豎的
scale2=Scale(root,from_=0, to=100,orient=HORIZONTAL)#橫的
scale.pack()
scale2.pack()

root.mainloop()
  • Scrollbar:

    • 介紹:為配合使用canvas, entry, listbox, and text窗口部件的標(biāo)準(zhǔn)滾動(dòng)條。
    • 參數(shù)設(shè)置:可用參數(shù)參考下面的,用法參考按鈕Button的
Valid resource names: 
activebackground, activerelief,
background, bd, bg, borderwidth, command, cursor,
elementborderwidth, highlightbackground,
highlightcolor, highlightthickness, jump, orient,
relief, repeatdelay, repeatinterval, takefocus,
troughcolor, width.
from tkinter import *

root=Tk()
root.title('我的窗口')
root.geometry('300x300+250+55')
button=Button(text='submit')
button.pack()
t1=Text(root,height=100,width=100,cursor='cross')

slb=Scrollbar(root)
slb.pack(side=RIGHT,fill=Y)#設(shè)置滾動(dòng)條的顯示形式
t1.config(yscrollcommand=slb.set)#設(shè)置允許滾動(dòng)條
#由于沒有綁定事件,所以直接拖拽滾動(dòng)條無效

t1.pack()
root.mainloop()

想要了解更多,可以參考tkinter的官方文檔:http://effbot.org/tkinterbook/

更多關(guān)于Python相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《Python數(shù)據(jù)結(jié)構(gòu)與算法教程》、《Python Socket編程技巧總結(jié)》、《Python函數(shù)使用技巧總結(jié)》、《Python字符串操作技巧匯總》、《Python入門與進(jìn)階經(jīng)典教程》及《Python文件與目錄操作技巧匯總

希望本文所述對(duì)大家Python程序設(shè)計(jì)有所幫助。

相關(guān)文章

  • 在Django下創(chuàng)建項(xiàng)目以及設(shè)置settings.py教程

    在Django下創(chuàng)建項(xiàng)目以及設(shè)置settings.py教程

    今天小編就為大家分享一篇在Django下創(chuàng)建項(xiàng)目以及設(shè)置settings.py教程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2019-12-12
  • Python安裝模塊的常見問題及解決方法

    Python安裝模塊的常見問題及解決方法

    下面小編就為大家分享一篇Python安裝模塊的常見問題及解決方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2018-02-02
  • 詳解Python中的動(dòng)態(tài)屬性和特性

    詳解Python中的動(dòng)態(tài)屬性和特性

    本篇文章主要介紹了詳解Python中的動(dòng)態(tài)屬性和特性,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-04-04
  • python使用post提交數(shù)據(jù)到遠(yuǎn)程url的方法

    python使用post提交數(shù)據(jù)到遠(yuǎn)程url的方法

    這篇文章主要介紹了python使用post提交數(shù)據(jù)到遠(yuǎn)程url的方法,涉及Python使用post傳遞數(shù)據(jù)的相關(guān)技巧,需要的朋友可以參考下
    2015-04-04
  • python中ransac算法擬合圓的實(shí)現(xiàn)

    python中ransac算法擬合圓的實(shí)現(xiàn)

    RANSAC是一種用于從包含異常數(shù)據(jù)的樣本數(shù)據(jù)集中計(jì)算數(shù)學(xué)模型參數(shù)的算法,本文主要介紹了python中ransac算法擬合圓的實(shí)現(xiàn),具有一定的參考價(jià)值,感興趣的可以了解一下
    2025-01-01
  • Selenium爬取b站主播頭像并以昵稱命名保存到本地

    Selenium爬取b站主播頭像并以昵稱命名保存到本地

    這篇文章主要介紹了使用Selenium自動(dòng)化爬取b站主播頭像并以昵稱命名保存到本地的方法,代碼簡(jiǎn)單完整,對(duì)于大家練習(xí)Selenium自動(dòng)化有一定的幫助,需要的朋友可以參考下
    2021-04-04
  • python皮爾遜相關(guān)性數(shù)據(jù)分析分析及實(shí)例代碼

    python皮爾遜相關(guān)性數(shù)據(jù)分析分析及實(shí)例代碼

    這篇文章主要為大家介紹了python皮爾遜相關(guān)性分析及實(shí)例代碼,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-02-02
  • OpenCV 表盤指針自動(dòng)讀數(shù)的示例代碼

    OpenCV 表盤指針自動(dòng)讀數(shù)的示例代碼

    這篇文章主要介紹了OpenCV 表盤指針自動(dòng)讀數(shù)的示例代碼,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-04-04
  • Python3 讀取Word文件方式

    Python3 讀取Word文件方式

    今天小編就為大家分享一篇Python3 讀取Word文件方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2020-02-02
  • Python使用kombu連接信息中包含#號(hào)問題排查方式

    Python使用kombu連接信息中包含#號(hào)問題排查方式

    文章描述了在部署Python項(xiàng)目到生產(chǎn)環(huán)境時(shí)遇到的一個(gè)錯(cuò)誤,即端口號(hào)無法正確轉(zhuǎn)換為整數(shù)值,該錯(cuò)誤在測(cè)試環(huán)境和本地調(diào)試中沒有出現(xiàn),但在生產(chǎn)環(huán)境中才出現(xiàn),通過分析錯(cuò)誤信息和代碼,作者發(fā)現(xiàn)問題出在URL解析過程中,特別是在處理包含特殊字符(如#號(hào))的URL時(shí)
    2024-12-12

最新評(píng)論

巴塘县| 伊通| 天全县| 云安县| 德清县| 南昌县| 潮安县| 新乡市| 武冈市| 广水市| 杭锦旗| 广州市| 泸水县| 正定县| 桃江县| 西丰县| 手游| 周宁县| 乌鲁木齐县| 南京市| 黄浦区| 凭祥市| 永清县| 乳源| 徐水县| 龙井市| 阳东县| 安溪县| 沽源县| 弥勒县| 仪征市| 方山县| 定西市| 鹤庆县| 沛县| 文山县| 社旗县| 东宁县| 杭锦旗| 天全县| 密云县|