会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132441个问题
JAVA 全系列/第九阶段:权限控制与安全认证/Shiro 6512楼
JAVA 全系列/第十三阶段:分布式文件存储与数据缓存/MongoDB 6513楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/HTML5基础元素 6517楼
JAVA 全系列/第一阶段:JAVA 快速入门/飞机大战小项目训练 6518楼

4.1.1bootStrap布局.rar

bootstrap-4.5.0-dist.zip

老师  我更改了bootstrap的版本还是无法实现布局的效果,引入老师您给版本在移动端小屏时占比不是100%。bootstrap的版本有些什么注意的地方吗

WEB前端全系列/第四阶段:BootStrap框架模块/BootStrap4基础 6519楼
JAVA 全系列/第六阶段:项目管理与SSM框架/RBAC实战 6520楼
Python 全系列/第二阶段:Python 深入与提高/GUI编程(隐藏) 6521楼

def checkio(text, word):
    text1 = text.lower().replace(' ', '').split('\n')
    # 如果word在text中row相同 enumerate()函数是提供两个参数,为索引和值
    for row, y in enumerate(text1):
        if y.find(word) != -1:
            return [row+1, y.find(word)+1, row+1, y.find(word)+len(word)]
    # 如果word在text中column相同
    text2 = []
    for i in range(len(text1)):
        for j in range(len(text1[i])):
            for k in range(len(text1)):
                text2.append(text1[k][j])
    print(text2)


if __name__ == '__main__':
    print(checkio("""DREAMING of apples on a wall,
And dreaming often, dear,
I dreamed that, if I counted all,
-How many would appear?""", "ten"))
    print(checkio("""He took his vorpal sword in hand:
Long time the manxome foe he sought--
So rested he by the Tumtum tree,
And stood awhile in thought.
And as in uffish thought he stood,
The Jabberwock, with eyes of flame,
Came whiffling through the tulgey wood,
And burbled as it came!""", "noir") == [4, 16, 7, 16])

老师,这是我在check io上遇到的题,我进行到最后一步就卡住了,能不能帮我解决一下,题目是求第二个参数首末单词在第一个参数中的行坐标和列坐标。我的想法是先求行坐标一样的第二参数,而后求列坐标一样的参数。但是列坐标一样的我不知道怎么弄。

微信图片_20210125162124.jpg

Python 全系列/第一阶段:Python入门/控制语句 6522楼
JAVA 全系列/第三阶段:数据库编程/JDBC技术(旧) 6523楼

"""测试Canvas组件的基本用法,使用面向对象的方式"""

from tkinter import *
from tkinter import messagebox
import random



class Application(Frame):

    def __init__(self, master=None):
     super().__init__(master)    # super()代表的是父类的定义,而不是父类的对象
    self.master = master
    self.pack()
    self.createWidget()


    def createWidget(self):
        self.canvas = Canvas(self, width=300, height=200, bg="green")
        self.canvas.pack()
        # 画一条直线
        line = self.canvas.create_line(10,10,30,20,40,50)
        # 画一个矩形
        rect = self.canvas.create_retangle(50,50,100,100)
        # 画一个椭圆,坐标两双。为椭圆的边界举行左上角和底部右下角
        oval = self.canvas.create_oval(50,50,100,100)

        global photo
        photo = PhotoImage(file="imgs/logo.gif")
        self.canvas.create_image(150,170,image=photo)

        Button(self,text="画10个举行",command=self.draw50Recg),pack(side="left")

    def draw50Recg(self):
        for i in range(0,10):
            x1 = random.randrange(int(self.canvas["width"])/2)
            y1 = random.randrange(int(self.canvas["height"])/2)
            x2 = x1 + random.randrange(int(self.canvas["width"])/2)
            y2 = y1 + random.randrange(int(self.canvas["height"])/2)
            self.canvas.create_rectangle(x1,y1,x2,y2)


    if __name__ == '__main__':
        root = Tk()
        root.geometry("400x300+200+300")
        app = Application(master=root)
        root.mainloop()

D:\python_env\gui\Scripts\python.exe C:/Users/邹霖/PycharmProjects/gui/venv/my09.py

Traceback (most recent call last):

  File "C:\Users\邹霖\PycharmProjects\gui\venv\my09.py", line 9, in <module>

    class Application(Frame):

  File "C:\Users\邹霖\PycharmProjects\gui\venv\my09.py", line 13, in Application

    self.master = master

NameError: name 'master' is not defined. Did you mean: 'aiter'?

又遇到这个错误,咋办?

Python 全系列/第二阶段:Python 深入与提高/GUI编程(隐藏) 6524楼
Python 全系列/第四阶段:函数式编程和核心特性/正则表达式 6525楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637