会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 134268个问题

import turtle as t
import random
import time
import pygame
import threading
import tkinter as tk

t.screensize(bg='red')#定义背景颜色
def loving_hear(r):
    l=2*r
    t.left(45)
    t.forward(1)
    t.circle(r,100)
    t.right(90)
    t.circle(r,180)
    t.forward(1)

#树函数()递归

def tree(d,s):
    if d <=0:
        return
    t.forward(s)
    tree(d - 1,s * .8)
    t.right(120)
    tree(d - 3,s * .5)
    t.right(120)
    tree(d -3 , s *.5)
    t.right(120)
    t.backward(s) #回退函数

#话爱心函数
t.penup()
t.goto(0,200)
t.pendown()
t.pencolor('red')
t.color('red')
t.begin_fill()#对图形进行填充
loving_hear(20)#执行话爱心的函数
t.end_fill()

#画树部分
n=100
t.speed(0)
t.right(225)
t.color('dark green')
t.backward(n * 4.8)
tree(15,n)
t.backward(n/5)

#绘制落叶
for i in range(200):
    a = 200 - 400*random.random()
    b = 10 - 20*random.random()
    t.speed(0)
    t.up()
    t.forward(b)
    t.left(90)
    t.forward(a)
    t.down()
    if random.randint(1,2) == 1:
        t.color('tomato')
    else:
        t.color('wheat')

    t.circle(4)
    t.up()
    t.backward(a)
    t.right(90)
    t.backwaed(b)
#绘制雪花
def drawsnow():#定义雪花的方法
    t.speed(0)
    t.ht()#隐藏笔头
    t.pensize(2)#定义笔头大小
    for i in range(200):
        t.pencolor('white')
        t.pu() #提笔
        t.setx(random.randint(-350,350))
        t.sety(random.randint(100,350))
        t.pd()#落笔
        dens=6
        snowsize =random.randint(1,10)#定义雪花的大小
        for j in range(dens):
            t.fd(int(snowsize))
            t.backward(int(snowsize))
            t.right(int(360/dens))

drawsnow()
t.color('red')
t.up()
t.goto(170, -200)
t.down()
t.write('Created:俞兴志',font=('行书',18,'normal'))
t.ht()

t.hideturtle()

time.sleep(2)


#弹窗制作
def dow():
    window = tk.Tk()
    width = window.winfo_screenwidth()
    height = window.winfo_screenheight()
    a = random.randrange(0,width)
    b = random.randrange(0,height)
    window.title('老师 圣诞快乐')
    window.geometry('200*50'+'+'+str(b))
    tk.label(text='圣诞快乐!!!!!',
             bg='pink',
             font=('..',17),#字体大小
             width=18,height=2
             ).pack()
    window.mainloop()


threads = []

for i in range(100):
    t=threading.Thread(target=dow)
    threads.append(t)
    time.sleep(0.01)
    threads[i].start()

#老师我这个是70行出现了毛病 不知道怎末修改了

Python全系列/第六阶段:数据库与AI协同技术实战/mysql的使用 26913楼
Python全系列/第一阶段:AI驱动的Python编程/序列 26914楼
Python全系列/第一阶段:AI驱动的Python编程/控制语句 26915楼
Python全系列/第十六阶段:Python 爬虫开发/scrapy框架使用 26917楼
Python全系列/第十六阶段:Python 爬虫开发/爬虫反反爬 26919楼

 more details, see https://link.vuejs.org/feature-flags.

initFeatureFlags @ runtime-core.esm-bundler.js:4607

baseCreateRenderer @ runtime-core.esm-bundler.js:4624

createRenderer @ runtime-core.esm-bundler.js:4617

ensureRenderer @ runtime-dom.esm-bundler.js:1737

createApp @ runtime-dom.esm-bundler.js:1751

eval @ main.js:11

./src/main.js @ app.js:19

__webpack_require__ @ app.js:243

(匿名) @ app.js:1414

__webpack_require__.O @ app.js:285

(匿名) @ app.js:1415

(匿名) @ app.js:1417

input.vue:531  [Vue warn]: Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`. 

Component that was made reactive:  {name: 'User', __name: 'user', setup: ƒ} 

  at <ElIcon key=0 class="el-input__icon" > 

  at <ElInput modelValue="" onUpdate:modelValue=fn placeholder="输入账户"  ... > 

  at <ElFormItem label="账户" > 

  at <ElForm model= {username: '', password: ''} label-width="auto" style= {max-width: '600px'} > 

  at <Login onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > 

  at <RouterView> 

  at <Application>

warn$1 @ runtime-core.esm-bundler.js:51

_createVNode @ runtime-core.esm-bundler.js:7531

createVNodeWithArgsTransform @ runtime-core.esm-bundler.js:7415

createBlock @ runtime-core.esm-bundler.js:7385

eval @ input.vue:531

renderFnWithContext @ runtime-core.esm-bundler.js:692

renderSlot @ runtime-core.esm-bundler.js:2981

eval @ icon.vue:28

renderComponentRoot @ runtime-core.esm-bundler.js:6501

componentUpdateFn @ runtime-core.esm-bundler.js:5319

run @ reactivity.esm-bundler.js:225

setupRenderEffect @ runtime-core.esm-bundler.js:5454

mountComponent @ runtime-core.esm-bundler.js:5229

processComponent @ runtime-core.esm-bundler.js:5182

patch @ runtime-core.esm-bundler.js:4700

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

mountChildren @ runtime-core.esm-bundler.js:4932

processFragment @ runtime-core.esm-bundler.js:5112

patch @ runtime-core.esm-bundler.js:4674

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

componentUpdateFn @ runtime-core.esm-bundler.js:5326

run @ reactivity.esm-bundler.js:225

setupRenderEffect @ runtime-core.esm-bundler.js:5454

mountComponent @ runtime-core.esm-bundler.js:5229

processComponent @ runtime-core.esm-bundler.js:5182

patch @ runtime-core.esm-bundler.js:4700

mountChildren @ runtime-core.esm-bundler.js:4932

processFragment @ runtime-core.esm-bundler.js:5112

patch @ runtime-core.esm-bundler.js:4674

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

componentUpdateFn @ runtime-core.esm-bundler.js:5326

run @ reactivity.esm-bundler.js:225

setupRenderEffect @ runtime-core.esm-bundler.js:5454

mountComponent @ runtime-core.esm-bundler.js:5229

processComponent @ runtime-core.esm-bundler.js:5182

patch @ runtime-core.esm-bundler.js:4700

mountChildren @ runtime-core.esm-bundler.js:4932

processFragment @ runtime-core.esm-bundler.js:5112

patch @ runtime-core.esm-bundler.js:4674

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

componentUpdateFn @ runtime-core.esm-bundler.js:5326

run @ reactivity.esm-bundler.js:225

setupRenderEffect @ runtime-core.esm-bundler.js:5454

mountComponent @ runtime-core.esm-bundler.js:5229

processComponent @ runtime-core.esm-bundler.js:5182

patch @ runtime-core.esm-bundler.js:4700

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

mountChildren @ runtime-core.esm-bundler.js:4932

processFragment @ runtime-core.esm-bundler.js:5112

patch @ runtime-core.esm-bundler.js:4674

componentUpdateFn @ runtime-core.esm-bundler.js:5326

run @ reactivity.esm-bundler.js:225

setupRenderEffect @ runtime-core.esm-bundler.js:5454

mountComponent @ runtime-core.esm-bundler.js:5229

processComponent @ runtime-core.esm-bundler.js:5182

patch @ runtime-core.esm-bundler.js:4700

componentUpdateFn @ runtime-core.esm-bundler.js:5406

run @ reactivity.esm-bundler.js:225

runIfDirty @ reactivity.esm-bundler.js:263

callWithErrorHandling @ runtime-core.esm-bundler.js:199

flushJobs @ runtime-core.esm-bundler.js:408

Promise.then

queueFlush @ runtime-core.esm-bundler.js:322

queueJob @ runtime-core.esm-bundler.js:317

effect.scheduler @ runtime-core.esm-bundler.js:5448

trigger @ reactivity.esm-bundler.js:253

endBatch @ reactivity.esm-bundler.js:311

notify @ reactivity.esm-bundler.js:597

trigger @ reactivity.esm-bundler.js:571

set value @ reactivity.esm-bundler.js:1448

finalizeNavigation @ vue-router.mjs:3478

eval @ vue-router.mjs:3343

Promise.then

pushWithRedirect @ vue-router.mjs:3309

push @ vue-router.mjs:3235

install @ vue-router.mjs:3677

use @ runtime-core.esm-bundler.js:3863

eval @ main.js:14

./src/main.js @ app.js:19

__webpack_require__ @ app.js:243

(匿名) @ app.js:1414

__webpack_require__.O @ app.js:285

(匿名) @ app.js:1415

(匿名) @ app.js:1417

input.vue:531  [Vue warn]: Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`. 

Component that was made reactive:  {name: 'Edit', __name: 'edit', setup: ƒ} 

  at <ElIcon key=0 class="el-input__icon" > 

  at <ElInput modelValue="" onUpdate:modelValue=fn placeholder="输入密码"  ... > 

  at <ElFormItem label="密码" > 

  at <ElForm model= {username: '', password: ''} label-width="auto" style= {max-width: '600px'} > 

  at <Login onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > 

  at <RouterView> 

  at <Application>

warn$1 @ runtime-core.esm-bundler.js:51

_createVNode @ runtime-core.esm-bundler.js:7531

createVNodeWithArgsTransform @ runtime-core.esm-bundler.js:7415

createBlock @ runtime-core.esm-bundler.js:7385

eval @ input.vue:531

renderFnWithContext @ runtime-core.esm-bundler.js:692

renderSlot @ runtime-core.esm-bundler.js:2981

eval @ icon.vue:28

renderComponentRoot @ runtime-core.esm-bundler.js:6501

componentUpdateFn @ runtime-core.esm-bundler.js:5319

run @ reactivity.esm-bundler.js:225

setupRenderEffect @ runtime-core.esm-bundler.js:5454

mountComponent @ runtime-core.esm-bundler.js:5229

processComponent @ runtime-core.esm-bundler.js:5182

patch @ runtime-core.esm-bundler.js:4700

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

mountChildren @ runtime-core.esm-bundler.js:4932

processFragment @ runtime-core.esm-bundler.js:5112

patch @ runtime-core.esm-bundler.js:4674

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

componentUpdateFn @ runtime-core.esm-bundler.js:5326

run @ reactivity.esm-bundler.js:225

setupRenderEffect @ runtime-core.esm-bundler.js:5454

mountComponent @ runtime-core.esm-bundler.js:5229

processComponent @ runtime-core.esm-bundler.js:5182

patch @ runtime-core.esm-bundler.js:4700

mountChildren @ runtime-core.esm-bundler.js:4932

processFragment @ runtime-core.esm-bundler.js:5112

patch @ runtime-core.esm-bundler.js:4674

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

componentUpdateFn @ runtime-core.esm-bundler.js:5326

run @ reactivity.esm-bundler.js:225

setupRenderEffect @ runtime-core.esm-bundler.js:5454

mountComponent @ runtime-core.esm-bundler.js:5229

processComponent @ runtime-core.esm-bundler.js:5182

patch @ runtime-core.esm-bundler.js:4700

mountChildren @ runtime-core.esm-bundler.js:4932

processFragment @ runtime-core.esm-bundler.js:5112

patch @ runtime-core.esm-bundler.js:4674

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

componentUpdateFn @ runtime-core.esm-bundler.js:5326

run @ reactivity.esm-bundler.js:225

setupRenderEffect @ runtime-core.esm-bundler.js:5454

mountComponent @ runtime-core.esm-bundler.js:5229

processComponent @ runtime-core.esm-bundler.js:5182

patch @ runtime-core.esm-bundler.js:4700

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

mountChildren @ runtime-core.esm-bundler.js:4932

mountElement @ runtime-core.esm-bundler.js:4855

processElement @ runtime-core.esm-bundler.js:4820

patch @ runtime-core.esm-bundler.js:4688

mountChildren @ runtime-core.esm-bundler.js:4932

processFragment @ runtime-core.esm-bundler.js:5112

patch @ runtime-core.esm-bundler.js:4674

componentUpdateFn @ runtime-core.esm-bundler.js:5326

run @ reactivity.esm-bundler.js:225

setupRenderEffect @ runtime-core.esm-bundler.js:5454

mountComponent @ runtime-core.esm-bundler.js:5229

processComponent @ runtime-core.esm-bundler.js:5182

patch @ runtime-core.esm-bundler.js:4700

componentUpdateFn @ runtime-core.esm-bundler.js:5406

run @ reactivity.esm-bundler.js:225

runIfDirty @ reactivity.esm-bundler.js:263

callWithErrorHandling @ runtime-core.esm-bundler.js:199

flushJobs @ runtime-core.esm-bundler.js:408

Promise.then

queueFlush @ runtime-core.esm-bundler.js:322

queueJob @ runtime-core.esm-bundler.js:317

effect.scheduler @ runtime-core.esm-bundler.js:5448

trigger @ reactivity.esm-bundler.js:253

endBatch @ reactivity.esm-bundler.js:311

notify @ reactivity.esm-bundler.js:597

trigger @ reactivity.esm-bundler.js:571

set value @ reactivity.esm-bundler.js:1448

finalizeNavigation @ vue-router.mjs:3478

eval @ vue-router.mjs:3343

Promise.then

pushWithRedirect @ vue-router.mjs:3309

push @ vue-router.mjs:3235

install @ vue-router.mjs:3677

use @ runtime-core.esm-bundler.js:3863

eval @ main.js:14

./src/main.js @ app.js:19

__webpack_require__ @ app.js:243

(匿名) @ app.js:1414

__webpack_require__.O @ app.js:285

(匿名) @ app.js:1415

(匿名) @ app.js:1417

content.js:202 

-----------
控制台警告报错,什么原因呢

Python全系列/第十一阶段:Flask百战电商后台项目/Flask百战电商后台项目 26920楼
C++特训班/第一阶段:基础篇/基础篇 26922楼
JAVA 全系列/第一阶段:AI驱动的JAVA编程/面向对象详解和JVM底层内存分析 26924楼

package com.bjsxt;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ResourceBundle;

/**
 * jdbc工具类
 * @author Administrator
 *
 */
public class JdbcUtil2 {
	private static String driver;
	private static String jdbcUrl;
	private static String username;
	private static String userpassword;
	static{
		//读取Properties文件
		ResourceBundle bundle = ResourceBundle.getBundle("jdbc");
		driver = bundle.getString("driver");
		jdbcUrl= bundle.getString("jdbcUrl");
		username = bundle.getString("username");
		userpassword = bundle.getString("userpassword");
		try {
			Class.forName(driver);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}

	//获取Connection对象
	public static Connection getConnection(){
		Connection conn = null;
		try {
		 conn =	DriverManager.getConnection(jdbcUrl, username, userpassword);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return conn;
		
	}
	//关闭Statement
	public static void closeStatement(Statement state){
			try {
				if(state != null){
					state.close();
				}
			} catch (SQLException e) {
				e.printStackTrace();
			}
	}
	//关闭Connection
	public static void closeConnection(Connection conn){
		try {
			if(conn != null){
				conn.close();
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	//關閉資源
	public static void closeResource(Statement state,Connection conn,ResultSet rs){
		closeStatement(state);
		closeConnection(conn);
		closeResultSet(rs);
	}
	//关闭ResultSet连接
	public static void closeResultSet(ResultSet rs){
		try {
			if(rs != null){
				rs.close();
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
package com.bjsxt;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;



public class JdbcTest2 {
	//向Department表中添加一条数据
	public void insertDepartments(String department_name,int location_id) {
			Connection conn = null;
			Statement state = null;
		try {
			conn = JdbcUtil2.getConnection();
			String sql="insert into departments values(default,'"+department_name+"',"+location_id+")";
			state = conn.createStatement();
			int flag = state.executeUpdate(sql);
			System.out.println(flag);
		} catch (Exception e) {
			e.printStackTrace();
		}finally {
			JdbcUtil2.closeResource(state, conn,null);
			}
			
		}
	
	//更新departments表中的deoartment_id为5的数据,将部门名称修改为教学部,location_id修改为5
	public void updateDempartments(String department_name,int location_id,int department_id) {
		Connection conn = null;
		Statement state = null;
		try {
			conn = JdbcUtil2.getConnection();
			state = conn.createStatement();
			String sql = "update departments d set d.department_name = '"+department_name+"',d.location_id = "+location_id+" where d.department_id = "+department_id;
			int flag = state.executeUpdate(sql);
			System.out.println(flag);
		}catch(Exception e) {
			e.printStackTrace();
		}finally{
			JdbcUtil2.closeResource(state,conn,null);
		}
	}
	//查询Departments表中部门ID为6的部门信息
	public void selectDepartmentsById(int departmentId) {
		Connection conn = null;
		Statement state = null;
		ResultSet rs = null;
		try {
			conn = JdbcUtil2.getConnection();
			state = conn.createStatement();
			String sql = "select * from departments d where d.department_id = "+departmentId;
			//执行查询返回结果
			rs=state.executeQuery(sql);
			while(rs.next()) {
				System.out.println(rs.getInt("department_id")+" "+rs.getString("department_name")+" "+rs.getInt(3));
			}
		}catch(Exception e) {
			e.printStackTrace();
		}finally {
			JdbcUtil2.closeResource(state,conn,rs);
		}
	}
	public static void main(String[] args) {
		JdbcTest2 test2 = new JdbcTest2();
		//test2.insertDepartments("教学部",9);
		//test2.updateDempartments("工程部",7,5);
		test2.selectDepartmentsById(6);

	}

}




麻烦老师帮忙看一下这个是什么问题









JAVA 全系列/第四阶段:数据库与AI协同技术实战/JDBC技术(旧) 26925楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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