<ul class="nav-right"> <li><a href="#">登录</a><span>|</span></li> <li><a href="#">注册</a><span>|</span></li> <li><a href="#">消息通知</a><span>|</span></li> <li class="cart"> <a href="#"> <span class="iconfont">󰅹</span> <span>购物车(0)</span> <div class="str2"> 购物车中还没有商品,赶紧选购吧 </div> </a> </li> </ul> .str2 { width: 250px; height: 0; overflow: hidden; background-color: #424242; position: absolute; right: 0; top: 40px; left: 50%; margin-left: -122px; line-height: 100px; transition: all 0.3s; } .cart:hover>.str2 { height: 100px; }
没有出现框
配置文件的话
和视频中的一样啊,为啥我的就不能用这个RunWith注解呢?
老师 我存了两个sheet页 为什么第二个会覆盖掉第一个呢?
def parse_info(self, response): total_price = response.xpath('concat(//span[@class="total"]/text(),//span[@class="unit"]/span/text())').extract_first() community_name = response.xpath('//div[@class="communityName"]/a[@class="info"]/text()').extract_first() area_name = response.xpath('string(//div[@class="areaName"]/span[2])').extract_first()
老师为什么我获得response之后用xpath提取信息,能够正确获得总价total_price,但是小区名称就一直返回None,xpath表达式没有错,在浏览器上用xpath helper也能提取出来,就是pycharm调试的时候不行
这个问什么报错了?
老师,我这个代码跟视频一样的可是为什么这结果会报错呢
package cn.sxt.game; import javax.swing.JFrame; /** * 飞机游戏的主窗口 * @author 高毅 * */ public class MyGameFrame extends JFrame{ /** * 初始化窗口 */ public void launchFrame(){ this.setTitle("尚学堂学员,程序员作品"); this.setVisible(true); //设置可见 this.setSize(500, 500); //设置窗口大小 this.setLocation(300,300); //窗口位置 this.addWindowListener(new WindowAdapter() { //设置窗口关闭 @Override public void windowClosing(WindowEvent e) { System.exit(0); } }); } public static void main(String[] args) { MyGameFrame f = new MyGameFrame(); f.launchFrame(); } }
报错提示是:The method addWindowListener(WindowListener) in the type Window is not applicable for the arguments (new WindowAdapter(){})
WindowAdapter cannot be resolved to a type
WindowEvent cannot be resolved to a type
lr=LogisticRegression(max_iter=1000)
老师 这个max_iter=1000是将所有的训练数据切分成1000份进行训练还是将所有数据看作一个整体训练1000次呢?
回归树的y_hat 根据w算出来的y_hat吗,为什么是平均值呢
老师好,请看一下,
异常名称:Exception in thread "main" java.net.SocketException: Connection reset
想要知道怎么避免,怎么操作,请演示一下
已通过防火墙
客户端:
package cn.sxt.entity; import java.io.DataInputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.net.Socket; import java.util.Scanner; public class Client2 { public static void main(String[] args) throws IOException { //1创建socket对象,用于连接服务器 Socket client = new Socket("localhost", 9999); //2获取输出流(对象流) ObjectOutputStream oos = new ObjectOutputStream(client.getOutputStream()); //3创建user对象 //获取user对象的方法 User2 user = getUser();//new User2("sxt", "sxt"); //4user对象发送到服务器 oos.writeObject(user);//发生了向上转型 //5获取输入流(数据流) DataInputStream dis = new DataInputStream(client.getInputStream()); System.out.println(dis.readUTF()); //6关闭流 if (dis!=null) { dis.close(); } if (oos!=null) { oos.close(); } if (client!=null) { client.close(); } } public static User2 getUser() {//获取对象的方法 Scanner sc = new Scanner(System.in); System.out.println("请输入账户名"); String userName = sc.next(); System.out.println("请输入密码"); String passWord = sc.next(); return new User2(userName, passWord); } }
服务器端:
package cn.sxt.server; import java.io.DataOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.net.ServerSocket; import java.net.Socket; import cn.sxt.entity.User2; public class Server2 { public static void main(String[] args) throws IOException, ClassNotFoundException { System.out.println("----------服务器端已启动---------"); //1.创建ServerSocket对象 ServerSocket server = new ServerSocket(9999); Socket client = server.accept(); //2.创建输入流--->ObjectInputStream ObjectInputStream ois = new ObjectInputStream(client.getInputStream()); User2 user = (User2)ois.readObject();//向下转型 System.out.println(client.getInetAddress().getHostAddress()+"请求登录:用户名:"+user.getUserName()+"\t密码:"+user.getPassWord()); //3.对用户名和密码进行验证 String str = ""; if ("sxt".equals(user.getUserName())&&"sxt".equals(user.getPassWord())) { str = "登录成功"; }else { str = "对不起,用户名或密码错误"; } //4.获取输出流(数据流) DataOutputStream dos = new DataOutputStream(client.getOutputStream()); dos.writeUTF(str); //5.关闭流 if (dos!=null) { dos.close(); } if (ois!=null) { ois.close(); } if (client!=null) { client.close(); } } }
运行效果:
#coding=utf-8 import os def getAllFiles(path,level): all_files = os.listdir(path) for filepath in all_files: # filepath = os.path.join(path,file) print("\t" * level + filepath) if os.path.isdir(filepath): getAllFiles(filepath,level+1) getAllFiles(os.getcwd(),0)
这段代码有什么问题吗?为什么输出不了更下一层的文件啊?
如果稍微改动一下,把注释部分取消注释则可以正常输出全部内容,这是什么情况?
def outer(): print("outer") a = 20 def inner(): print("inner") nonlocal a print(f'a={a}') return innera = outer()a()
问:a = outer()为什么只执行outer方法?
a()是执行了inner方法吗?
老师,我想问下,我们日常开发中所说的接口到底是什么意思?这不是我们学基础的时候所说的那个interface啊,我现在听别人说,通过调用别人接口来获取数据,听别人说写接口,听不懂,希望您可以举一些实实在在的例子,概念太模糊了。
import re pattern = r"\\\n\d{3,}" s=r"\\\n123" print(s) v=re.match(pattern,s) print(v)
老师,这里如果s也用r标识原始字符串,则返回None,这里怎么理解?
老师,安装的时候报错,一开始是SSL连接失败,又试了一次之后是拒绝连接,这怎么办?
turtle math x1,y1 =,x2,y2 =,-x3,y3 =-,-x4,y4 =-,turtle.penup() turtle.goto(x1,y1) turtle.pendown() turtle.goto(x2,y2) turtle.goto(x3,y3) turtle.goto(x4,y4) distance =math.sqrt(x1-x4)**+(y1-y4)**turtle.write(distance) turtle.done()
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637