1、首先下载Anaconda
2、在Anaconda中安装Jupyter notebook
3、打开Jupyter notebook只需要在终端输入jupyter notebook
4、打开一个网页,点新建,选择相应版本的python,我选择了python 3
5、在打开的网页编辑器上输入如下代码:
import re
test_string = "我是一个中国人。在学习爬虫。爬虫非常有趣。"
regex = "爬虫"
p_string = test_string.split("。")
for line in p_string:
if re.search(regex,line) is not None:
print(line)
print(p_string)
输出结果:
在学习爬虫
爬虫非常有趣
['我是一个中国人', '在学习爬虫', '爬虫非常有趣', '']
博客介绍了在信息技术领域使用Anaconda安装Jupyter notebook的步骤,包括下载Anaconda、在其中安装Jupyter notebook,还说明了打开方式,即在终端输入命令,之后可在网页新建python版本并输入代码运行。
2029

被折叠的 条评论
为什么被折叠?



