python - 如何在 jupyter lab 中正确打印 url?
问题描述
这是在 google.com 上搜索关键字 google 的网址:
https://www.google.com/search?q=google&rlz=1C1CHBD_elGR899GR899&oq=google&aqs=chrome..69i57j69i60l4j69i65l2j69i60.1647j0j7&sourceid=chrome&ie=UTF-8
如果我在 jupyter lab 中执行以下单元格,
print("https://www.google.com/search?q=google&rlz=1C1CHBD_elGR899GR899&oq=google&aqs=chrome..69i57j69i60l4j69i65l2j69i60.1647j0j7&sourceid=chrome&ie=UTF-8")
我得到:
https://www.google.com/search?q=google&rlz=1C1CHBD_elGR899GR899&oq=google&aqs=chrome..69i57j69i60l4j69i65l2j69i60.1647j0j7&sourceid=chrome&ie=UTF-8
我怎样才能避免&
被显示为&
?
解决方案
我发现这是由 Jupyter 创建可点击链接引起的。例如,如果您在尝试打印的字符串前加上“x”,则不会发生这种情况,并且与号不会被转义。
推荐阅读
- ruby - 使用 Ruby 从其旧父级的子级中删除一个节点
- python - 熊猫数据框中的列得到不正确的值
- database - 股市金融数据的数据库架构设计
- java - 如何将相同的方法从(非静态)内部类引用到外部类
- reactjs - ErrorType:数据库不是 Firebase 的函数
- c++ - 我可以使用构造函数在具有模板的类中初始化任意数量的元素,该模板采用 1 和关联结构吗?
- wordpress - Google Search Console - 网址不在 Google 上:索引错误
- c++ - 在屏幕空间中查找元素的世界位置
- python - 如何在Python中找到对应的FFT波数
- azure - Terraform 模板中的资源创建顺序