# 请教，python怎么入门，硬件、软件、环境搭建

**URL:** <https://forum.freemdict.com/t/topic/15574>\
**Category:** 技术交流与词典编修\
**Created:** [2022 年9 月 22 日 13:54 UTC](https://forum.freemdict.com/t/topic/15574 "2022-09-22T13:54:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

作者： ![mdict6](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mdict6](https://forum.freemdict.com/u/mdict6)\
发布日期： [2022 年9 月 22 日 13:54 UTC](https://forum.freemdict.com/t/topic/15574/1 "2022-09-22T13:54:29Z")

</div>

我也不知道分类对不对，

就是我现在必须这个计算机二级证，然后我就挑个数据处理方向的python路径学习，  
由于完全不会编程，所以挑了个sololearn，没听过的也不用去研究了，就是学习编程版的duolingo（多临国），一个学编程，一个学外语。闯关卡，寓教于乐这样，错题扣❤，没心了买会员或者等明天再学。这样。

我拍脑袋觉得这个对修编词典有帮助。

要买个什么硬件设备跑 linux 跑python 么？

因为虽然google 有提供那啥（ [https://colab.research.google.com/](https://colab.research.google.com/) ，网页版的python），但是我不太会用，也不太能和现有的教程结合起来。  
就，学起来，感觉有点割裂。

记录一点网上抄来的只言片语，希望对学习编程有帮助吧。

1. If you are using Python on Windows for **web development** , we recommend a different set up for your development environment. Rather than installing directly on Windows, we recommend installing and using Python via the Windows Subsystem for Linux.

---

<div class="post-metadata">

作者： ![hua](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/hua/32/11090_2.png) [@hua](https://forum.freemdict.com/u/hua)\
发布日期： [2022 年9 月 22 日 13:57 UTC](https://forum.freemdict.com/t/topic/15574/2 "2022-09-22T13:57:58Z")

</div>

> **[PyCharm: the Python IDE for Professional Developers by JetBrains](https://www.jetbrains.com/pycharm/)**
>
> The Python & Django IDE with intelligent code completion, on-the-fly error checking, quick-fixes, and much more...

用这个就好了，你的问题都解决了。

---

<div class="post-metadata">

作者： ![poorich](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/p/ecae2f/32.png) [@poorich](https://forum.freemdict.com/u/poorich)\
发布日期： [2022 年9 月 22 日 14:03 UTC](https://forum.freemdict.com/t/topic/15574/4 "2022-09-22T14:03:43Z")

</div>

如果用win，可以弄个wsl（win上的linux虚拟环境）  
这东西，你安装卸载软件方便，都有仓库里集成好的  
反正不管学啥都可以试着在wsl里装一个，我除了py之外还装了racket，sage  
不想学了把wsl整个卸载了，神清气爽

编辑器的话楼下说了本地的vscode，pycharm  
缺点是，文件一个一个多到爆，如果不想一个一个文件多到爆，可以用py的包——jupyter notebook  
任谁用了都只能说一句，爽  
hua大前段时间开的py自学服务貌似也倚重jupyter的

---

<div class="post-metadata">

作者： ![Z\_Cotton](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/z/9fc348/32.png) [@Z\_Cotton](https://forum.freemdict.com/u/Z_Cotton)\
发布日期： [2022 年9 月 22 日 14:34 UTC](https://forum.freemdict.com/t/topic/15574/5 "2022-09-22T14:34:11Z")

</div>

如果是新手的话，推荐这本书《Python编程快速上手—让繁琐工作自动化》。里面的内容很实用，尤其是文本处理和网页抓取方面的内容，对于制作词典而言大有用处。硬件方面没有什么要求，软件方面的话，可以用免费的PyCharm的社区版，它会自动帮你完成一切配置。

* * *

你的硬件指的是操作系统吗，我建议Windows即可，linux需要花费很多时间去学。  
[Python编程快速上手 - 让繁琐工作自动化 by Al Sweigart.pdf](https://forum.freemdict.com/uploads/short-url/fAQEelW592edGBnmOOmVwoOq0hK.pdf) (13.9 MB) @mdict6

---

<div class="post-metadata">

作者： ![舒服员](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/%E8%88%92/13edae/32.png) [@舒服员](https://forum.freemdict.com/u/%E8%88%92%E6%9C%8D%E5%91%98)\
发布日期： [2022 年9 月 22 日 14:46 UTC](https://forum.freemdict.com/t/topic/15574/6 "2022-09-22T14:46:17Z")

</div>

笨方法学Python，

---

<div class="post-metadata">

作者： ![endnote](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/e/9de0a6/32.png) [@endnote](https://forum.freemdict.com/u/endnote)\
发布日期： [2022 年9 月 22 日 15:10 UTC](https://forum.freemdict.com/t/topic/15574/7 "2022-09-22T15:10:58Z")

</div>

> [@poorich](#):
>
> wsl（win上的linux虚拟环境）

同推荐。最新是WSL2。可以顺便接触一些Linux的简单命令  
代码其实找个免费开源的就好，如VS Code  
初学者的代码简单，其实常见的文本编辑器也能用

---

<div class="post-metadata">

作者： ![mdict6](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@mdict6](https://forum.freemdict.com/u/mdict6)\
发布日期： [2022 年9 月 22 日 15:36 UTC](https://forum.freemdict.com/t/topic/15574/9 "2022-09-22T15:36:16Z")

</div>

笔芯 thanks

---

<div class="post-metadata">

作者： ![shiruxue](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shiruxue](https://forum.freemdict.com/u/shiruxue)\
发布日期： [2022 年9 月 23 日 06:33 UTC](https://forum.freemdict.com/t/topic/15574/10 "2022-09-23T06:33:06Z")

</div>

1. 去苏联大学怎么要考法语写作啊？
2. 楼主学Python是因为他考的就是二级Python啊？（我没理解错吧？）  
而且楼主还志不在此，他还要修编词典。要鼓励他啊！

---

<div class="post-metadata">

作者： ![shiruxue](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@shiruxue](https://forum.freemdict.com/u/shiruxue)\
发布日期： [2022 年9 月 23 日 07:57 UTC](https://forum.freemdict.com/t/topic/15574/12 "2022-09-23T07:57:47Z")

</div>

在我印象中计算机二级难度不大，对就业也帮助不大，以楼主的学历似乎并不需要多考这个证书。但是如果是出于兴趣，在学有余力下以考促学拿下Python也是一件好事。再说Python不光能修编词典，如果经常跟数据打交道还是很有用处的。  
看得出你是真心为他好！他是不会拉黑你的！  
当然我也不会！

---

<div class="post-metadata">

作者： ![Z\_Cotton](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/z/9fc348/32.png) [@Z\_Cotton](https://forum.freemdict.com/u/Z_Cotton)\
发布日期： [2022 年9 月 23 日 11:06 UTC](https://forum.freemdict.com/t/topic/15574/13 "2022-09-23T11:06:47Z")

</div>

计算机二级随便刷刷题目就行了，学校老师都会发题库的。

---

<div class="post-metadata">

作者： ![Perf](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@Perf](https://forum.freemdict.com/u/Perf)\
发布日期： [2022 年9 月 24 日 11:53 UTC](https://forum.freemdict.com/t/topic/15574/14 "2022-09-24T11:53:06Z")

</div>

Python属于入门容易的语言，深度使用后会觉得还是挺难的，类似于英语。如果有台ArchLinux电脑，那么接下来就是看其Wiki [Python - ArchWiki (archlinux.org)](https://wiki.archlinux.org/title/Python)跟着操作的环节了，linux的强大之处在于终端上输入命令行，简单几行命令，顷刻之间即可以安装许多个Python版本，再用pythonx.x - m pip install package命令安装包即可。

那么，没有Linux系统只有Windows的人怎么办？安装WSL等模拟Linux环境(10 GB甚至几十GB是常事，运行效率比不上单独使用Linux）。但是模拟系统都不想装，只想用Windows，那么除了读ArchLinux Wiki（内容极其丰富，除了提示conda、pip包管理器外，还提到了一般使用了许多年的人都没有注意到的pipx，pip包管理器在升级python或者包、多个版本Python混合使用时用起来是很不方便的，需要修改代码等等。 构建独立的安装与运行环境需要用pipx，Windows平台推荐使用pipx）外，还需要

1、先安装Python，再用pip命令添加包，再安装IDE。  
~~pip源用清华镜像( ` pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package`)~~  
[date=2022-11-06 timezone=“Asia/Shanghai”]补充：经 live9999 提醒，删除此段，最佳选择是用官方源，如果不行通过代理用官方源，实在没办法用清华镜像等。

或者  
2、安装Anaconda（笨重，预装了许多包）或者Miniconda（相对轻量），再用conda添加包，再安装IDE  
[Anaconda | Anaconda Distribution](https://www.anaconda.com/products/distribution)

IDE选择Pycharm（收费，每隔几年升级的话相当于终身订阅续费了）或者Eclipse+Pydev（开源免费，先安装Eclipse，再安装Eclipse的Pydev包，有可能的话给Pydev作者打赏）

**入门：**  
读文档，看代码

**文档**  
Python官网  
[3.10.7 Documentation (python.org)](https://docs.python.org/3/)  
[The Python Tutorial — Python 3.10.7 documentation](https://docs.python.org/3/tutorial/index.html)

**代码**  
[Stackoverflow.com](http://Stackoverflow.com)、[Github.com](http://Github.com)

---

<div class="post-metadata">

作者： ![atauzki](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/atauzki/32/1365_2.png) [@atauzki](https://forum.freemdict.com/u/atauzki)\
发布日期： [2022 年9 月 24 日 12:15 UTC](https://forum.freemdict.com/t/topic/15574/15 "2022-09-24T12:15:13Z")

</div>

装个anaconda和vscode（或者pycharm免费版）就行了，为什么楼上都喜欢搞这么复杂

---

<div class="post-metadata">

作者： ![surfactant](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/dbc845/32.png) [@surfactant](https://forum.freemdict.com/u/surfactant)\
发布日期： [2022 年9 月 24 日 12:17 UTC](https://forum.freemdict.com/t/topic/15574/16 "2022-09-24T12:17:54Z")

</div>

> [@Perf](#):
>
> 没有Linux系统只有Windows的人怎么办？安装WSL等模拟Linux环境

老兄似乎把 Linux 排在 Windows 之前，请教下有什么非 Linux 不可的原因吗？

---

<div class="post-metadata">

作者： ![Perf](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@Perf](https://forum.freemdict.com/u/Perf)\
发布日期： [2022 年9 月 24 日 12:20 UTC](https://forum.freemdict.com/t/topic/15574/17 "2022-09-24T12:20:47Z")

</div>

Linux是我最喜欢的操作系统，特别是ArchLinux及Debian。Windows当然是必不可少的。

---

<div class="post-metadata">

作者： ![surfactant](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/dbc845/32.png) [@surfactant](https://forum.freemdict.com/u/surfactant)\
发布日期： [2022 年9 月 24 日 12:21 UTC](https://forum.freemdict.com/t/topic/15574/18 "2022-09-24T12:21:57Z")

</div>

能说下为什么喜欢 Linux吗？是干什么活效率特别高，还是有什么活只有 Linux 能干？

---

<div class="post-metadata">

作者： ![Perf](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@Perf](https://forum.freemdict.com/u/Perf)\
发布日期： [2022 年9 月 24 日 12:25 UTC](https://forum.freemdict.com/t/topic/15574/19 "2022-09-24T12:25:28Z")

</div>

> [@surfactant](#):
>
> 效率

如果是与编程相关，那么Linux确实是不少程序员的最爱，比如V2EX平台上。如果是办公，那么只能是Windows了。

打个比方，如果上个月一个庞大的文件夹修改了些代码，但是不记得哪个文件夹了，只记得自己大约打了些中文注释，这些注释以前也打过，但是那是几个月之前的事情了，此时，grep -rnw . -e ‘中文注释’ 配合find加限制时间命令一下就找到了。如果是windows，估计一顿好找，可能性比较大的是安装一个收费软件来查找。

---

<div class="post-metadata">

作者： ![surfactant](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/dbc845/32.png) [@surfactant](https://forum.freemdict.com/u/surfactant)\
发布日期： [2022 年9 月 24 日 12:28 UTC](https://forum.freemdict.com/t/topic/15574/20 "2022-09-24T12:28:22Z")

</div>

在 Linux 上写程序，可以最大限度确保程序的全平台通用性，如果在 Windows 上一不小心会用到 Windows的API而影响程序的跨平台性能，这么理解对吗？

---

<div class="post-metadata">

作者： ![hua](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/hua/32/11090_2.png) [@hua](https://forum.freemdict.com/u/hua)\
发布日期： [2022 年9 月 24 日 12:30 UTC](https://forum.freemdict.com/t/topic/15574/21 "2022-09-24T12:30:27Z")

</div>

+1

---

<div class="post-metadata">

作者： ![Perf](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@Perf](https://forum.freemdict.com/u/Perf)\
发布日期： [2022 年9 月 24 日 12:30 UTC](https://forum.freemdict.com/t/topic/15574/22 "2022-09-24T12:30:56Z")

</div>

我没有做过复杂的，一般就是C++及Python等等简单用下。

---

<div class="post-metadata">

作者： ![surfactant](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/dbc845/32.png) [@surfactant](https://forum.freemdict.com/u/surfactant)\
发布日期： [2022 年9 月 24 日 12:35 UTC](https://forum.freemdict.com/t/topic/15574/23 "2022-09-24T12:35:48Z")

</div>

@Perf 谢谢耐心解答！

> [@Perf](#):
>
> ，此时，grep -rnw . -e ‘中文注释’ 配合find加限制时间命令一下就找到了。如果是windows，估计一顿好找

这个功能好像很多编辑器都行，比如 EmEditor 里有个 Find in Files，也是很方便的

[下一页](https://forum.freemdict.com/t/topic/15574.md?page=2)
