2022年2月22日
摘要: Here's the solution: If you're not using Code Runner: you need to go to settings (press Ctrl+, to do so) and type "Python Terminal Execute in File Dir 阅读全文
posted @ 2022-02-22 21:08 AbbeyCenter 阅读(407) 评论(0) 推荐(0) 编辑
  2021年12月15日
摘要: 之前用easy_install命令安装python第三方库,现在都是在dos命令下用pip install “库的名称”方式来安装。通常在安装python解释器的时候会默认安装pip的工具,但有时需要更新pip或者莫名其妙地损坏了文件情况下,导致pip不能正常使用,这时通常通过cmd进入dos命令模 阅读全文
posted @ 2021-12-15 14:19 AbbeyCenter 阅读(421) 评论(0) 推荐(0) 编辑
  2021年10月14日
摘要: 问题:如何实现下列的子串替换功能? 输入:s='你好你好我好我好' 输出:s='我好我好你好你好' 如果用常规的replace函数,则会出现如下不符合预期的结果 可以考虑如下方法: 方法一:采用python内置的临时变量方法 方法二:采用Python maketrans() 方法用于创建字符映射的转 阅读全文
posted @ 2021-10-14 16:15 AbbeyCenter 阅读(270) 评论(0) 推荐(0) 编辑