老师请问一下,给已经存在的表创建主键索引的语句是什么?
这个copyOf方法返回的是新的数组还是就是在原来的数组上扩容
<body> <span th:text="WelcomeTo"></span> <hr/> <span th:text="${msg}"></span> </body>
老师,这里的文本text="WelcomtTo",这样可以在页面正常请求展示;
text="Welcomt To",但是中间加上“ ”空格的话,请求就会报错500;
这是什么原因呢?
m=命令行输不了 怎么回事呢
老师,我再试调模式下运行的时候不小心按错了,然后我重启vscode那些按钮都不能按,怎么解决??
还又我这个字段不知道为啥不变色
26wtforms结合peeweer的使用
Tornsdo_Demo.zip
子类重写父类的方法是不改变原父类方法,只在重写的子类生效吗?还是原父类的方法也被更改了?
输入神魔呢
老师 这步怎莫隆
class Person: def __init__(self,name): self.name=name def __add__(self,other): if isinstance(other,Person): return "{0}--{1}".format(self.name,other.name)#这里为什么用other.name else: return "不是同类,不能相加" def __mul__(self,other): if isinstance(other,int): return self.name*other else: return "不是同类,不能相乘" p1=Person("高洪") p2=Person("高希希") x=p1+p2 print(x) print(p1*3)
老师,改写add方法中,return中第二个参数为什么用other.name?
老师,为什么我的开发者模式没有老师视频中的东西,怎么跳出来啊?
第9章flask的课题资料下载下来发现没更新,跟现在的视屏讲义对不上
System.out.println(p1.getDistance(origin));
这个说是什么意思
/** * 创建发送消息类 */ class ClientSend extends Thread { private Socket socket; public ClientSend(Socket socket){ this.socket = socket; } @Override public void run() { this.sendMsg(); } /** * 发送消息 */ private void sendMsg(){ Scanner scanner = null; PrintWriter pw = null; try { //键盘输入 scanner = new Scanner(System.in); //创建向对方输出消息的流对象 pw = new PrintWriter(this.socket.getOutputStream()); while (true){ String msg = scanner.nextLine(); if ("exit".equals(msg)){ break; } pw.println(msg); pw.flush(); } } catch (IOException e) { e.printStackTrace(); }finally { if (pw != null){ pw.close(); } if (scanner != null){ scanner.close(); } if(this.socket!=null){ try { socket.close(); } catch (IOException e) { e.printStackTrace(); } } } } } /** * 创建接收消息线程类 */ class ClientReceive extends Thread { private Socket socket; public ClientReceive(Socket socket){ this.socket = socket; } @Override public void run() { } /** * 接收消息的方法 */ private void receiveMsg(){ BufferedReader br = null; try { br = new BufferedReader(new InputStreamReader(this.socket.getInputStream())); while (true){ String msg = br.readLine(); System.out.println("他说: " +msg ); } } catch (IOException e) { e.printStackTrace(); }finally { if (br!=null){ try { br.close(); } catch (IOException e) { e.printStackTrace(); } } } } } public class PointSocketClient { public static void main(String[] args) { try { Socket socket = new Socket("127.0.0.1",8888); System.out.println("连接成功"); new ClientSend(socket).start(); new ClientReceive(socket).start(); } catch (IOException e) { e.printStackTrace(); } } }
/** * 创建发送消息类 */ class Send extends Thread{ private Socket socket; public Send(Socket socket){ this.socket = socket; } @Override public void run() { this.sendMsg(); } /** * 发送消息 */ private void sendMsg(){ Scanner scanner = null; PrintWriter pw = null; try { //键盘输入 scanner = new Scanner(System.in); //创建向对方输出消息的流对象 pw = new PrintWriter(this.socket.getOutputStream()); while (true){ String msg = scanner.nextLine(); if ("exit".equals(msg)){ break; } pw.println(msg); pw.flush(); } } catch (IOException e) { e.printStackTrace(); }finally { if (pw != null){ pw.close(); } if (scanner != null){ scanner.close(); } if(this.socket!=null){ try { socket.close(); } catch (IOException e) { e.printStackTrace(); } } } } } /** * 创建接收消息线程类 */ class Receive extends Thread{ private Socket socket; public Receive(Socket socket){ this.socket = socket; } @Override public void run() { this.receiveMsg(); } /** * 接收消息的方法 */ private void receiveMsg(){ BufferedReader br = null; try { br = new BufferedReader(new InputStreamReader(this.socket.getInputStream())); while (true){ String msg = br.readLine(); System.out.println("他说: " +msg ); } } catch (IOException e) { e.printStackTrace(); }finally { if (br!=null){ try { br.close(); } catch (IOException e) { e.printStackTrace(); } } } } } public class PointSocketServer { public static void main(String[] args) { ServerSocket serverSocket = null; try { serverSocket =new ServerSocket(8888); System.out.println("服务器启动等待连接....."); Socket socket = serverSocket.accept(); System.out.println("连接成功"); new Send(socket).start(); new Receive(socket).start(); } catch (Exception e) { e.printStackTrace(); }finally { if (serverSocket != null){ try { serverSocket.close(); } catch (IOException e) { e.printStackTrace(); } } } } }
老师我这个代码只有客户端给服务端发消息的收回会输出
服务端给客户端发消息时没有反应,麻烦老师看下
class A: pass a=A() print(a)#打印<__main__.A object at 0x0000017BD217CE80>
老师,这直接打印实例对象,这个结果是什么东西,a的类型是A类,没有返回值,打印不应该是None么
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637