Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN 技术社区
skill_tree_python
提交
b8710f29
S
skill_tree_python
项目概览
CSDN 技术社区
/
skill_tree_python
通知
66
Star
14
Fork
6
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
skill_tree_python
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b8710f29
编写于
11月 19, 2021
作者:
F
feilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
改进7题
上级
7815cbda
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
548 addition
and
68 deletion
+548
-68
data/1.python初阶/1.预备知识/4.运行方式/run.md
data/1.python初阶/1.预备知识/4.运行方式/run.md
+3
-1
data/1.python初阶/1.预备知识/5.常用开发工具/editor.jpg
data/1.python初阶/1.预备知识/5.常用开发工具/editor.jpg
+0
-0
data/1.python初阶/1.预备知识/5.常用开发工具/ide.json
data/1.python初阶/1.预备知识/5.常用开发工具/ide.json
+1
-18
data/1.python初阶/1.预备知识/5.常用开发工具/ide.md
data/1.python初阶/1.预备知识/5.常用开发工具/ide.md
+398
-0
data/1.python初阶/1.预备知识/5.常用开发工具/ide.py
data/1.python初阶/1.预备知识/5.常用开发工具/ide.py
+146
-49
未找到文件。
data/1.python初阶/1.预备知识/4.运行方式/run.md
浏览文件 @
b8710f29
...
...
@@ -4,7 +4,7 @@
`Shell`
是人和机器交互的界面,分为
`GUI`
和
`命令行(CLI)`
两种方式,这里重点介绍命令行的方式。概念
`Shell`
路易斯·普赞(Louis Pouzin)在1964年至1965年间首次提出,随后在Multics(MULTiplexed Information and Computing System)项目中首次被实现出来。肯·汤普逊(Ken Thompson)以Multics上的shell为范本实现的第一个Unix壳层(Unix shell):
`Thompson shell`
。AT&T贝尔实验室的史蒂夫·伯恩在1977年实现了
`Bourne shell`
,或
`sh`
,它是Version 7 Unix默认的Unix shell,替代执行文件同为sh的Thompson shell。微软的Windows操作系统也提供了命令行壳层的功能,它们是Windows 95 / 98下的
`command.com`
、Windows NT内核下的
`cmd.exe`
以及
`PowerShell`
。
下面的
`Python 列表`
包含了
常见
Unix系统常见的
`shell`
:
下面的
`Python 列表`
包含了Unix系统常见的
`shell`
:
```
python
shells
=
[
...
...
@@ -51,6 +51,8 @@ run = {
}
```
![](
https://codechina.csdn.net/csdn/skill_tree_python/-/blob/master/data/1.python%E5%88%9D%E9%98%B6/1.%E9%A2%84%E5%A4%87%E7%9F%A5%E8%AF%86/4.%E8%BF%90%E8%A1%8C%E6%96%B9%E5%BC%8F/repl.png
)
交互式命令行通常也称
`REPL`
,表示
`Read-Eval-Print-Loop`
,顾名思义是:
`读取`
-
`评估`
-
`打印`
-
`循环`
的意思。当你在
`shell`
环境里输入
`python`
并回车,就进入了
`Python的REPL环境`
,程序总是:
1.
等待用户输入 Python 代码
...
...
data/1.python初阶/1.预备知识/5.常用开发工具/editor.jpg
0 → 100644
浏览文件 @
b8710f29
25.9 KB
data/1.python初阶/1.预备知识/5.常用开发工具/ide.json
浏览文件 @
b8710f29
{
"one_line"
:
{
"break"
:
[
"continue"
],
"ide = ide_dict.get(ret)"
:
[
"ide = ide_dict[ret]"
],
"if ide is None"
:
[
"if ide is not None"
],
"input"
:
[
"print"
],
"format(ide['desc'])"
:
[
"format(ide['link'])"
]
},
"source"
:
"ide.py"
,
"source"
:
"ide.md"
,
"depends"
:
[],
"exercise_id"
:
30
,
"type"
:
"code_options"
...
...
data/1.python初阶/1.预备知识/5.常用开发工具/ide.md
0 → 100644
浏览文件 @
b8710f29
# 现代集成开发环境(IDE)
下面的
`Python多行字符串`
包含了根据搜索引擎IDE关键词频次建立的IDE排行榜数据,以下数据直接从网页https://pypl.github.io/IDE.html 右侧的表格拷贝下来:
```
python
top_ide_trend
=
'''
Rank Change IDE Share Trend
1 Visual Studio 29.24 % +3.5 %
2 Eclipse 13.91 % -2.9 %
3 Visual Studio Code 12.07 % +3.3 %
4 Android Studio 9.13 % -2.5 %
5 pyCharm 8.43 % +0.7 %
6 IntelliJ 6.7 % +0.8 %
7 NetBeans 4.82 % -0.3 %
8 Sublime Text 3.49 % -0.2 %
9 Xcode 3.37 % -1.2 %
10 Atom 3.25 % -0.5 %
11 Code::Blocks 2.16 % +0.2 %
12 Vim 0.79 % -0.1 %
13 Xamarin 0.48 % -0.1 %
14 PhpStorm 0.46 % -0.2 %
15 geany 0.39 % +0.2 %
16 Komodo 0.31 % -0.2 %
17 Qt Creator 0.26 % -0.0 %
18 Emacs 0.18 % -0.1 %
19 JDeveloper 0.13 % -0.0 %
20 RAD Studio 0.08 % -0.0 %
21 JCreator 0.07 % -0.0 %
22 Light Table 0.07 % -0.0 %
23 MonoDevelop 0.06 % -0.0 %
24 SharpDevelop 0.03 % -0.0 %
25 Eric Python 0.03 % -0.0 %
26 Aptana 0.02 % -0.0 %
27 RubyMine 0.02 % -0.0 %
28 Coda 2 0.02 % +0.0 %
29 Monkey Studio 0.01 % -0.0 %
30 DrJava 0.01 % -0.0 %
'''
```
事实上其中有些是
`编辑器`
,例如
`Vim`
和
`Sublime Text`
,这些编辑器有丰富的辅助开发的插件体系,因此许多程序员也会用它们来作为集成开发环境。VIM编辑器源自 Bram Moolenaar 在 80 年代末购入他的 Amiga 计算机时,Amiga 上没有他最常用的编辑器vi。Bram 从一个开源的 vi 复制 Stevie 开始,开发了 Vim 的 1.0 版本。另一个著名的编辑器是 Emacs,VIM 和 Emacs 是编辑器的两大流派。
特别值得一提的是如果你装了VIM,在命令行里输入VIM,打开的VIM屏幕上会展示打开文本,其中文本
`Help poor children in Uganda!`
是一个线索,你可以通过搜索引擎了解这个细节。
此外不同的编辑器的学习陡峭程度不同,下图展示了这点:
![](
./editor.jpg
)
下面的
`Python数组`
包含了一组 Python 开发常用工具信息:
```
python
py_ide_infos
=
[
"IDEL(https://docs.python.org/3/library/idle.html), Python 内置的IDE,功能比较一般。"
,
"VIM(http://www.vim.org/),如果你是个VIM爱好者,可以用VIM编写Python,但是Python的缩进处理会比较麻烦。当然,你在 Linux 服务器上的时候有时候就只能用VI/VIM了。"
,
"Visual Studio Code(https://code.visualstudio.com/),VSCode 对Python的支持非常友好,配合几个插件后几乎是对 Python 开发最友好的IDE了。"
,
"PyCharm(https://www.jetbrains.com/pycharm/),jetbrains 出品的 PyCharm 也是 Python 开发者常用的IDE。"
]
```
请编写一个 Python 比对程序,支持功能:
1.
解析 Python 常用开发工具信息,获得结构化信息
2.
解析 Python 排行榜数据,获得结构化信息
3.
在 Python 排行榜结构化信息中查找 Python 常用开发工具的数据
4.
输出合并后的结构信息
基本的程序框架如下:
```
python
def
parse_ide_trend
(
top_ide_trend
):
top_ides
=
[]
top_ide_lines
=
top_ide_trend
.
split
(
'
\n
'
)[
1
:]
head
=
top_ide_lines
[
0
]
columns
=
head
.
split
(
'
\t
'
)
for
row
in
top_ide_lines
[
1
:]:
row
=
row
.
strip
()
if
row
:
cells
=
row
.
split
(
'
\t
'
)
top_ide
=
{}
for
i
in
range
(
0
,
len
(
columns
)):
column
=
columns
[
i
]
cell
=
cells
[
i
]
top_ide
[
column
]
=
cell
top_ides
.
append
(
top_ide
)
return
top_ides
def
parse_py_ide
(
py_ide_infos
):
py_ides
=
[]
for
row
in
py_ide_infos
:
name_end
=
row
.
find
(
'('
)
name
=
row
[
0
:
name_end
]
link_end
=
row
.
find
(
')'
)
link
=
row
[
name_end
+
1
:
link_end
]
desc
=
row
[
link_end
+
2
:]
py_ides
.
append
({
'name'
:
name
,
'link'
:
link
,
'desc'
:
desc
})
return
py_ides
def
dump_join_result
(
py_ide
,
top_ide
):
py_ide_name
=
py_ide
[
'name'
]
print
(
f
'Python IDE:
{
py_ide_name
}
'
)
print
(
'----------'
)
print
(
'* 基本信息'
)
for
key
in
py_ide
:
value
=
py_ide
[
key
]
print
(
f
' *
{
key
}
:
{
value
}
'
)
print
(
'* 排行信息'
)
if
top_ide
:
for
key
in
top_ide
:
if
key
!=
'IDE'
and
key
!=
'Change'
:
value
=
top_ide
[
key
]
print
(
f
' *
{
key
}
:
{
value
}
'
)
else
:
print
(
' * 无'
)
print
(
''
)
if
__name__
==
'__main__'
:
top_ide_trend
=
...
py_ide_infos
=
...
top_ides
=
parse_ide_trend
(
top_ide_trend
)
py_ides
=
parse_py_ide
(
py_ide_infos
)
# TODO(You): 请在此编写比对程序
```
比对程序的输出格式如下:
```
bash
Python IDE:IDEL
----------
*
基本信息
*
name: IDEL
*
link
: https://docs.python.org/3/library/idle.html
*
desc: Python 内置的IDE,功能比较一般。
*
排行信息
*
无
Python IDE:VIM
----------
*
基本信息
*
name: VIM
*
link
: http://www.vim.org/
*
desc: 如果你是个VIM爱好者,可以用VIM编写Python,但是Python的缩进处理会比较麻烦。当然,你在 Linux 服务器上的时候有时候就只能用VI/VIM了。
*
排行信息
*
Rank: 12
*
Share: 0.79 %
*
Trend:
-0
.1 %
Python IDE:Visual Studio Code
----------
*
基本信息
*
name: Visual Studio Code
*
link
: https://code.visualstudio.com/
*
desc: VSCode 对Python的支持非常友好,配合几个插件后几乎是对 Python 开发最友好的IDE了。
*
排行信息
*
Rank: 3
*
Share: 12.07 %
*
Trend: +3.3 %
Python IDE:PyCharm
----------
*
基本信息
*
name: PyCharm
*
link
: https://www.jetbrains.com/pycharm/
*
desc: jetbrains 出品的 PyCharm 也是 Python 开发者常用的IDE。
*
排行信息
*
Rank: 5
*
Share: 8.43 %
*
Trend: +0.7 %
```
以下选项是对代码中
`TODO`
部分的多种实现,你能找出以下实现
<span
style=
"color:red"
>
错误
</span>
的选项吗?
## template
```
python
def
parse_ide_trend
(
top_ide_trend
):
top_ides
=
[]
top_ide_lines
=
top_ide_trend
.
split
(
'
\n
'
)[
1
:]
head
=
top_ide_lines
[
0
]
columns
=
head
.
split
(
'
\t
'
)
for
row
in
top_ide_lines
[
1
:]:
row
=
row
.
strip
()
if
row
:
cells
=
row
.
split
(
'
\t
'
)
top_ide
=
{}
for
i
in
range
(
0
,
len
(
columns
)):
column
=
columns
[
i
]
cell
=
cells
[
i
]
top_ide
[
column
]
=
cell
top_ides
.
append
(
top_ide
)
return
top_ides
def
parse_py_ide
(
py_ide_infos
):
py_ides
=
[]
for
row
in
py_ide_infos
:
name_end
=
row
.
find
(
'('
)
name
=
row
[
0
:
name_end
]
link_end
=
row
.
find
(
')'
)
link
=
row
[
name_end
+
1
:
link_end
]
desc
=
row
[
link_end
+
2
:]
py_ides
.
append
({
'name'
:
name
,
'link'
:
link
,
'desc'
:
desc
})
return
py_ides
def
dump_join_result
(
py_ide
,
top_ide
):
py_ide_name
=
py_ide
[
'name'
]
print
(
f
'Python IDE:
{
py_ide_name
}
'
)
print
(
'----------'
)
print
(
'* 基本信息'
)
for
key
in
py_ide
:
value
=
py_ide
[
key
]
print
(
f
' *
{
key
}
:
{
value
}
'
)
print
(
'* 排行信息'
)
if
top_ide
:
for
key
in
top_ide
:
if
key
!=
'IDE'
and
key
!=
'Change'
:
value
=
top_ide
[
key
]
print
(
f
' *
{
key
}
:
{
value
}
'
)
else
:
print
(
' * 无'
)
print
(
''
)
def
compare_1
():
for
py_ide
in
py_ides
:
find_top_ide
=
None
for
top_ide
in
top_ides
:
if
py_ide
[
'name'
].
lower
()
==
top_ide
[
'IDE'
].
lower
():
find_top_ide
=
top_ide
dump_join_result
(
py_ide
,
find_top_ide
)
def
compare_2
():
top_ide_dict
=
{}
for
top_ide
in
top_ides
:
top_ide_dict
[
top_ide
[
'IDE'
].
lower
()]
=
top_ide
for
py_ide
in
py_ides
:
find_top_ide
=
top_ide_dict
.
get
(
py_ide
[
'name'
].
lower
())
dump_join_result
(
py_ide
,
find_top_ide
)
def
compare_3
():
find_records
=
{}
for
top_ide
in
top_ides
:
for
py_ide
in
py_ides
:
py_ide_name
=
py_ide
[
'name'
]
if
not
find_records
.
get
(
py_ide_name
):
if
py_ide
[
'name'
].
lower
()
==
top_ide
[
'IDE'
].
lower
():
find_records
[
py_ide
[
'name'
]]
=
True
dump_join_result
(
py_ide
,
top_ide
)
def
compare_4
():
top_ide_dict
=
{}
i
=
0
while
i
<
len
(
top_ides
):
top_ide_dict
[
top_ides
[
i
][
'IDE'
].
lower
()]
=
i
i
+=
1
j
=
0
while
j
<
len
(
py_ides
):
py_ide
=
py_ides
[
j
]
find_index
=
top_ide_dict
.
get
(
py_ide
[
'name'
].
lower
())
find_top_ide
=
None
if
find_index
and
find_index
>=
0
:
find_top_ide
=
top_ides
[
find_index
]
dump_join_result
(
py_ide
,
find_top_ide
)
j
+=
1
if
__name__
==
'__main__'
:
top_ide_trend
=
'''
Rank Change IDE Share Trend
1 Visual Studio 29.24 % +3.5 %
2 Eclipse 13.91 % -2.9 %
3 Visual Studio Code 12.07 % +3.3 %
4 Android Studio 9.13 % -2.5 %
5 pyCharm 8.43 % +0.7 %
6 IntelliJ 6.7 % +0.8 %
7 NetBeans 4.82 % -0.3 %
8 Sublime Text 3.49 % -0.2 %
9 Xcode 3.37 % -1.2 %
10 Atom 3.25 % -0.5 %
11 Code::Blocks 2.16 % +0.2 %
12 Vim 0.79 % -0.1 %
13 Xamarin 0.48 % -0.1 %
14 PhpStorm 0.46 % -0.2 %
15 geany 0.39 % +0.2 %
16 Komodo 0.31 % -0.2 %
17 Qt Creator 0.26 % -0.0 %
18 Emacs 0.18 % -0.1 %
19 JDeveloper 0.13 % -0.0 %
20 RAD Studio 0.08 % -0.0 %
21 JCreator 0.07 % -0.0 %
22 Light Table 0.07 % -0.0 %
23 MonoDevelop 0.06 % -0.0 %
24 SharpDevelop 0.03 % -0.0 %
25 Eric Python 0.03 % -0.0 %
26 Aptana 0.02 % -0.0 %
27 RubyMine 0.02 % -0.0 %
28 Coda 2 0.02 % +0.0 %
29 Monkey Studio 0.01 % -0.0 %
30 DrJava 0.01 % -0.0 %
'''
py_ide_infos
=
[
"IDEL(https://docs.python.org/3/library/idle.html), Python 内置的IDE,功能比较一般。"
,
"VIM(http://www.vim.org/),如果你是个VIM爱好者,可以用VIM编写Python,但是Python的缩进处理会比较麻烦。当然,你在 Linux 服务器上的时候有时候就只能用VI/VIM了。"
,
"Visual Studio Code(https://code.visualstudio.com/),VSCode 对Python的支持非常友好,配合几个插件后几乎是对 Python 开发最友好的IDE了。"
,
"PyCharm(https://www.jetbrains.com/pycharm/),jetbrains 出品的 PyCharm 也是 Python 开发者常用的IDE。"
]
top_ides
=
parse_ide_trend
(
top_ide_trend
)
py_ides
=
parse_py_ide
(
py_ide_infos
)
compare_1
()
compare_2
()
compare_3
()
compare_4
()
```
## 答案
```
python
find_records
=
{}
for
top_ide
in
top_ides
:
for
py_ide
in
py_ides
:
py_ide_name
=
py_ide
[
'name'
]
if
not
find_records
.
get
(
py_ide_name
):
if
py_ide
[
'name'
].
lower
()
==
top_ide
[
'IDE'
].
lower
():
find_records
[
py_ide
[
'name'
]]
=
True
dump_join_result
(
py_ide
,
top_ide
)
```
## 选项
### 两层循环
```
python
for
py_ide
in
py_ides
:
find_top_ide
=
None
for
top_ide
in
top_ides
:
if
py_ide
[
'name'
].
lower
()
==
top_ide
[
'IDE'
].
lower
():
find_top_ide
=
top_ide
dump_join_result
(
py_ide
,
find_top_ide
)
```
### 索引
```
python
top_ide_dict
=
{}
for
top_ide
in
top_ides
:
top_ide_dict
[
top_ide
[
'IDE'
].
lower
()]
=
top_ide
for
py_ide
in
py_ides
:
find_top_ide
=
top_ide_dict
.
get
(
py_ide
[
'name'
].
lower
())
dump_join_result
(
py_ide
,
find_top_ide
)
```
### 使用整数索引
```
python
top_ide_dict
=
{}
i
=
0
while
i
<
len
(
top_ides
):
top_ide_dict
[
top_ides
[
i
][
'IDE'
].
lower
()]
=
i
i
+=
1
j
=
0
while
j
<
len
(
py_ides
):
py_ide
=
py_ides
[
j
]
find_index
=
top_ide_dict
.
get
(
py_ide
[
'name'
].
lower
())
find_top_ide
=
None
if
find_index
and
find_index
>=
0
:
find_top_ide
=
top_ides
[
find_index
]
dump_join_result
(
py_ide
,
find_top_ide
)
j
+=
1
```
data/1.python初阶/1.预备知识/5.常用开发工具/ide.py
浏览文件 @
b8710f29
...
...
@@ -4,59 +4,156 @@
# 描述:提示用户选择想要了解的IDE,输出对应 IDE 介绍
def
test
():
ide_list
=
[
{
"shutcut"
:
'i'
,
"name"
:
"IDEL"
,
"link"
:
"https://docs.python.org/3/library/idle.html"
,
"desc"
:
"Python 内置的IDE,功能比较一般"
},
{
"shutcut"
:
'v'
,
"name"
:
"VIM"
,
"link"
:
"http://www.vim.org/"
,
"desc"
:
"如果你是个VIM爱好者,可以用VIM编写Python,但是Python的缩进处理会比较麻烦。当然,你在 Linux 服务器上的时候有时候就只能用VI/VIM了。"
},
{
"shutcut"
:
'c'
,
"name"
:
"VSCode"
,
"link"
:
"https://code.visualstudio.com/"
,
"desc"
:
"VSCode 对Python的支持非常友好,配合几个插件后几乎是对 Python 开发最友好的IDE了"
},
{
"shutcut"
:
'p'
,
"name"
:
"PyCharm"
,
"link"
:
"https://www.jetbrains.com/pycharm/"
,
"desc"
:
"jetbrains 出品的 PyCharm 也是 Python 开发者常用的IDE"
}
]
def
parse_ide_trend
(
top_ide_trend
):
top_ides
=
[]
top_ide_lines
=
top_ide_trend
.
split
(
'
\n
'
)[
1
:]
head
=
top_ide_lines
[
0
]
columns
=
head
.
split
(
'
\t
'
)
for
row
in
top_ide_lines
[
1
:]:
row
=
row
.
strip
()
if
row
:
cells
=
row
.
split
(
'
\t
'
)
top_ide
=
{}
for
i
in
range
(
0
,
len
(
columns
)):
column
=
columns
[
i
]
cell
=
cells
[
i
]
top_ide
[
column
]
=
cell
top_ides
.
append
(
top_ide
)
return
top_ides
def
parse_py_ide
(
py_ide_infos
):
py_ides
=
[]
for
row
in
py_ide_infos
:
name_end
=
row
.
find
(
'('
)
name
=
row
[
0
:
name_end
]
link_end
=
row
.
find
(
')'
)
link
=
row
[
name_end
+
1
:
link_end
]
desc
=
row
[
link_end
+
2
:]
py_ides
.
append
({
'name'
:
name
,
'link'
:
link
,
'desc'
:
desc
})
return
py_ides
def
dump_join_result
(
py_ide
,
top_ide
):
py_ide_name
=
py_ide
[
'name'
]
print
(
f
'Python IDE:
{
py_ide_name
}
'
)
print
(
'----------'
)
print
(
'* 基本信息'
)
for
key
in
py_ide
:
value
=
py_ide
[
key
]
print
(
f
' *
{
key
}
:
{
value
}
'
)
print
(
'* 排行信息'
)
if
top_ide
:
for
key
in
top_ide
:
if
key
!=
'IDE'
and
key
!=
'Change'
:
value
=
top_ide
[
key
]
print
(
f
' *
{
key
}
:
{
value
}
'
)
else
:
print
(
' * 无'
)
ide_dict
=
{}
short_cuts
=
[]
for
ide
in
ide_list
:
s
=
ide
[
'shutcut'
]
ide_dict
[
s
]
=
ide
short_cuts
.
append
(
s
)
print
(
''
)
print
(
"常见的 Python IDE 列表:"
)
for
s
in
ide_dict
:
print
(
'* {}: {}'
.
format
(
s
,
ide_dict
[
s
][
'name'
]))
while
True
:
print
(
''
)
ret
=
input
(
"请选择你喜欢的IDE({}, q退出):"
.
format
(
'/'
.
join
(
short_cuts
)))
if
ret
==
'q'
:
break
def
compare_1
():
for
py_ide
in
py_ides
:
find_top_ide
=
None
for
top_ide
in
top_ides
:
if
py_ide
[
'name'
].
lower
()
==
top_ide
[
'IDE'
].
lower
():
find_top_ide
=
top_ide
dump_join_result
(
py_ide
,
find_top_ide
)
ide
=
ide_dict
.
get
(
ret
)
if
ide
is
None
:
print
(
"[错误] 不支持的选项"
)
else
:
print
(
"* IDE: {}"
.
format
(
ide
[
'name'
]))
print
(
"* 链接: {}"
.
format
(
ide
[
'link'
]))
print
(
"* 描述: {}"
.
format
(
ide
[
'desc'
]))
def
compare_2
():
top_ide_dict
=
{}
for
top_ide
in
top_ides
:
top_ide_dict
[
top_ide
[
'IDE'
].
lower
()]
=
top_ide
for
py_ide
in
py_ides
:
find_top_ide
=
top_ide_dict
.
get
(
py_ide
[
'name'
].
lower
())
dump_join_result
(
py_ide
,
find_top_ide
)
def
compare_3
():
find_records
=
{}
for
top_ide
in
top_ides
:
for
py_ide
in
py_ides
:
py_ide_name
=
py_ide
[
'name'
]
if
not
find_records
.
get
(
py_ide_name
):
if
py_ide
[
'name'
].
lower
()
==
top_ide
[
'IDE'
].
lower
():
find_records
[
py_ide
[
'name'
]]
=
True
dump_join_result
(
py_ide
,
top_ide
)
def
compare_4
():
top_ide_dict
=
{}
i
=
0
while
i
<
len
(
top_ides
):
top_ide_dict
[
top_ides
[
i
][
'IDE'
].
lower
()]
=
i
i
+=
1
j
=
0
while
j
<
len
(
py_ides
):
py_ide
=
py_ides
[
j
]
find_index
=
top_ide_dict
.
get
(
py_ide
[
'name'
].
lower
())
find_top_ide
=
None
if
find_index
and
find_index
>=
0
:
find_top_ide
=
top_ides
[
find_index
]
dump_join_result
(
py_ide
,
find_top_ide
)
j
+=
1
if
__name__
==
'__main__'
:
test
()
top_ide_trend
=
'''
Rank Change IDE Share Trend
1 Visual Studio 29.24 % +3.5 %
2 Eclipse 13.91 % -2.9 %
3 Visual Studio Code 12.07 % +3.3 %
4 Android Studio 9.13 % -2.5 %
5 pyCharm 8.43 % +0.7 %
6 IntelliJ 6.7 % +0.8 %
7 NetBeans 4.82 % -0.3 %
8 Sublime Text 3.49 % -0.2 %
9 Xcode 3.37 % -1.2 %
10 Atom 3.25 % -0.5 %
11 Code::Blocks 2.16 % +0.2 %
12 Vim 0.79 % -0.1 %
13 Xamarin 0.48 % -0.1 %
14 PhpStorm 0.46 % -0.2 %
15 geany 0.39 % +0.2 %
16 Komodo 0.31 % -0.2 %
17 Qt Creator 0.26 % -0.0 %
18 Emacs 0.18 % -0.1 %
19 JDeveloper 0.13 % -0.0 %
20 RAD Studio 0.08 % -0.0 %
21 JCreator 0.07 % -0.0 %
22 Light Table 0.07 % -0.0 %
23 MonoDevelop 0.06 % -0.0 %
24 SharpDevelop 0.03 % -0.0 %
25 Eric Python 0.03 % -0.0 %
26 Aptana 0.02 % -0.0 %
27 RubyMine 0.02 % -0.0 %
28 Coda 2 0.02 % +0.0 %
29 Monkey Studio 0.01 % -0.0 %
30 DrJava 0.01 % -0.0 %
'''
py_ide_infos
=
[
"IDEL(https://docs.python.org/3/library/idle.html), Python 内置的IDE,功能比较一般。"
,
"VIM(http://www.vim.org/),如果你是个VIM爱好者,可以用VIM编写Python,但是Python的缩进处理会比较麻烦。当然,你在 Linux 服务器上的时候有时候就只能用VI/VIM了。"
,
"Visual Studio Code(https://code.visualstudio.com/),VSCode 对Python的支持非常友好,配合几个插件后几乎是对 Python 开发最友好的IDE了。"
,
"PyCharm(https://www.jetbrains.com/pycharm/),jetbrains 出品的 PyCharm 也是 Python 开发者常用的IDE。"
]
top_ides
=
parse_ide_trend
(
top_ide_trend
)
py_ides
=
parse_py_ide
(
py_ide_infos
)
compare_1
()
compare_2
()
compare_3
()
compare_4
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录