動態(tài)視頻最近幾天由于后臺服務器升級,所以視頻過幾天我上傳上來。
4 Python代碼
def bgpic(self, picname=None):
“”"Set background image or return name of current backgroundimage.
Optional argument:
picname – a string, name of a gif-file or “nopic”.
If picname is a filename, set the corresponding image as background.
If picname is “nopic”, delete backgroundimage, if present.
If picname is None, return the filename of the current backgroundimage.
Example (for a TurtleScreen instance named screen):
screen.bgpic()
‘nopic’
screen.bgpic(“l(fā)andscape.gif”)
screen.bgpic()
‘landscape.gif’
“”"
if picname is None:
return self._bgpicname
if picname not in self._bgpics:
self._bgpics[picname] = self._image(picname)
self._setbgpic(self._bgpic, self._bgpics[picname])
self._bgpicname = picname
coding: utf-8
import pygame
import os
import sys
from pygame.locals import *
os.chdir(‘E:/星空下的告白’)
os.getcwd()
pygame.init()
pygame.mixer.init()
pygame.mixer.music.load(“星空之美.mp3”)
pygame.mixer.music.set_volume(0.4)
pygame.mixer.music.play()
bg_size = width, height = 300, 200
bg_rgb = (255, 255, 255)
screen1 = pygame.display.set_mode(bg_size)
pygame.display.set_caption(“告白音樂”)
clock = pygame.time.Clock()
pause_rect = pause_image.get_rect()
print(pause_rect.width, pause_rect.height)
pause_rect.left, pause_rect.top = (width - pause_rect.width) // 2, (height - pause_rect.height) // 2
from turtle import *
from random import random, randint
os.chdir(‘E:星空下的告白’)
screen = Screen()
width, height = 900, 700
screen.setup(width, height)
screen.title(“浪漫的流星雨”)
screen.bgcolor(“black”)
screen.mode(“l(fā)ogo”)
screen.delay(0)
printer = Turtle()
printer.hideturtle()
printer.penup()
printer.color(‘red’)
printer.goto(-100, -350)
printer.write(“宇宙廣闊(弱水三千)”“\n\n”, move=True, align=“l(fā)eft”, font=(“Italic”, 30, “bold”))
printer.goto(-50, -400)
printer.write(“只尋你一顆!(只取一瓢飲!)\n\n”, move=True, align=“l(fā)eft”, font=(“Italic”, 30, “bold”))
t = Turtle(visible=False, shape=‘circle’)
t.pencolor(“white”)
t.fillcolor(“white”)
t.penup()
t.setheading(-90)
t.goto(width / 2, randint(-height / 2, height / 2))
stars = []
for i in range(300):
star = t.clone()
s = random() / 3
if s > 0.01 and s < 0.03:
star.pencolor(“black”)
star.fillcolor(“black”)
elif s > 0.03 and s < 0.04:
star.pencolor(“l(fā)ightcoral”)
star.fillcolor(“l(fā)ightcoral”)
elif s > 0.05 and s < 0.1:
star.pencolor(“green”)
star.fillcolor(“green”)
elif s > 0.15 and s < 0.16:
star.pencolor(“yellow”)
star.fillcolor(“yellow”)
elif s > 0.19 and s < 0.2:
star.pencolor(“red”)
star.fillcolor(“red”)
elif s > 0.21 and s < 0.22:
star.pencolor(“purple”)
自我介紹一下,小編13年上海交大畢業(yè),曾經(jīng)在小公司待過,也去過華為、OPPO等大廠,18年進入阿里一直到現(xiàn)在。
深知大多數(shù)Python工程師,想要提升技能,往往是自己摸索成長或者是報班學習,但對于培訓機構動則幾千的學費,著實壓力不小。自己不成體系的自學效果低效又漫長,而且極易碰到天花板技術停滯不前!
因此收集整理了一份《2024年Python開發(fā)全套學習資料》,初衷也很簡單,就是希望能夠幫助到想自學提升又不知道該從何學起的朋友,同時減輕大家的負擔。
既有適合小白學習的零基礎資料,也有適合3年以上經(jīng)驗的小伙伴深入學習提升的進階課程,基本涵蓋了95%以上Python開發(fā)知識點,真正體系化!
由于文件比較大,這里只是將部分目錄大綱截圖出來,每個節(jié)點里面都包含大廠面經(jīng)、學習筆記、源碼講義、實戰(zhàn)項目、講解視頻,并且后續(xù)會持續(xù)更新
如果你覺得這些內(nèi)容對你有幫助,可以添加V獲?。簐ip1024c (備注Python)
最后
不知道你們用的什么環(huán)境,我一般都是用的Python3.6環(huán)境和pycharm解釋器,沒有軟件,或者沒有資料,沒人解答問題,都可以免費領取(包括今天的代碼),過幾天我還會做個視頻教程出來,有需要也可以領取~
給大家準備的學習資料包括但不限于:
Python 環(huán)境、pycharm編輯器/永久激活/翻譯插件
python 零基礎視頻教程
Python 界面開發(fā)實戰(zhàn)教程
Python 爬蟲實戰(zhàn)教程
Python 數(shù)據(jù)分析實戰(zhàn)教程
python 游戲開發(fā)實戰(zhàn)教程
Python 電子書100本
Python 學習路線規(guī)劃文章來源:http://www.zghlxwxcb.cn/news/detail-858283.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-858283.html
本
Python 學習路線規(guī)劃
到了這里,關于你值得擁有——流星雨下的告白,面試竟然被這31道Python基礎題難倒了的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!