老师麻烦看看什么原因?我试了好多次。。。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Canvas多个小球随机运动.html</title> <style> canvas{ border: 1px solid #000; } </style> </head> <body> <canvas width="400px" height="300px">您的浏览器不支持canvas,请升级浏览器!</canvas> </body> <script> /*var modul = (function () { function getElement(eleName) { return document.querySelector(eleName); } return { getElement:getElement }; })(); var canvas = modul.getElement("canvas"); var ctx = canvas.getContext("2d"); console.log(canvas);*/ var canvas = document.querySelector("canvas"); var ctx = canvas.getContext("2d"); function randomColor() { var r = parseInt(Math.random() * 256); var g = parseInt(Math.random() * 256); var b = parseInt(Math.random() * 256); var CircleColor = "rgb(" + r + "," + g + "," + b + ")"; return CircleColor; } function Circle() { this.r = Math.floor(Math.random() * 20 + 11); this.x = Math.floor(Math.random() * (400 - this.r)); this.y = Math.floor(Math.random() * (300 - this.r)); this.speedX = Math.floor(Math.random() * 8); this.speedY = Math.floor(Math.random() * 6); this.color = randomColor(); } Circle.prototype.circleSpeed = function () { this.x += this.speedX; if (this.x <= this.r){ this.speedX = -this.speedX; }else if (this.x >= (400 - this.r)){ this.speedX = -this.speedX; } this.y += this.speedY; if (this.y <= this.r){ this.speedY = -this.speedY; }else if (this.y >= (300 - this.r)){ this.speedY = -this.speedY; } }; Circle.prototype.drawCircle = function () { ctx.beginPath(); ctx.arc(this.x,this.y,this.r,0,2*Math.PI); ctx.fillStyle = this.color; ctx.fill(); ctx.closePath(); }; var arr = []; for (var i = 0; i < 4; i++){ arr[i] = new Circle(); } var timer = setInterval(function () { ctx.clearRect(0,0,canvas.width,canvas.height); for (var i = 0; i < arr.length; i++){ arr[i] = circleSpeed(); arr[i] = drawCircle(); } },18); </script> </html>
哪里有问题?
老师这个os.path.join()方法代表的什么意思,能详细说一下吗,只要是提交路径的都用这个方法吗
老师你好 怎么创建文件的时候不是python的文件呀
D:\pycharm\venv\Scripts\python.exe D:/pycharm/GUI/my01.py
File "D:/pycharm/GUI/my01.py", line 3
SyntaxError: Non-UTF-8 code starting with '\xb5' in file D:/pycharm/GUI/my01.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
Process finished with exit code 1
老师,这是什么情况啊,我去调了file Encodeing 没用
想请问一下,这个项目是不是得会VUE才适合学,我看这大部分都是前端代码的编写,如果继续往下学这个项目,侧重点应该放在哪块?
b2.a.say_a2() 这里为什么要加个a,而不是b2.say_a2()
老师,你安装的linux是克隆的还是说重新安装的?如果是克隆的被克隆的Linux里面的配置被克隆了吗????
Motor: (): () Chassis (): () Seat: (): () Shell: (): () Vehicle: (motorchassisseat): .motor=motor .chassis=chassis .seat=seat (): () a=Motor() b=Chassis() c=Seat() b1=Vehicle(abc) b1.motor.work1() b1.chassis.work2() b1.seat.worl3
D:\pycharm\venv\Scripts\python.exe D:/pycharm/zuoye/6.6.py
File "D:/pycharm/zuoye/6.6.py", line 3
SyntaxError: Non-UTF-8 code starting with '\xd5' in file D:/pycharm/zuoye/6.6.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
老师,我这里是上面原因导致这个的
老师我记得用html好像要添加什么,不然报错,添加是啥啊?之前学springboot的时候用的html4,还是说他们没啥区别?????
可以把接口和接口实现类放在同一个接口和同一个接口实现类吗?那样岂不是更方便?好像有点逻辑不清晰
老师,我upload为啥会报这个错误??
1.老师,这里为什么端口配置的是6390但是访问的是6379?
2.还有,感觉在这里直接try有点不合理,像我这边是redis的错误,也提示用户或密码不正确。
老师您好
from socket import * import asyncio # 给对方传递信息 s = socket(AF_INET, SOCK_DGRAM) # ipv4协议 使用的是udp协议 s.bind(("", 5431)) addr = ("172.27.150.26", 8080) # ip 地址和端口地址 async def fun1(): while True: date = input("请输入要选择的内容") s.sendto(date.encode("gb2312"), addr) # 将字符流转为字符串 async def fun2(): while True: task = asyncio.create_task(fun1()) task.add_done_callback() redate = s.recvfrom(10) print(redate[0].decode("gb2312")) if __name__ == '__main__': f1 = fun1() f2 = fun2() loop = asyncio.get_event_loop() loop.run_until_complete(f2) loop.close()
我想用进程的方法实现它可以同时接受信息,请问要怎么做才行啊?
redis端口不是6379吗,不在这个范围内,老师这里是不是错了?
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637