-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocal-search.xml
105 lines (50 loc) · 30.7 KB
/
local-search.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>Git基本操作</title>
<link href="/2023/02/16/IT/Other/Git%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C/"/>
<url>/2023/02/16/IT/Other/Git%E5%9F%BA%E6%9C%AC%E6%93%8D%E4%BD%9C/</url>
<content type="html"><![CDATA[<p>Git是一个<strong>分布式版本控制系统</strong>,它可以跟踪文件的变化,从而使得多人协作开发变得更加容易。在Git中,每个人都可以创建自己的分支,对代码进行修改、提交、合并等操作,从而保证代码的版本管理和团队协作的效率。Git拥有强大的分支管理和合并功能,可以有效地避免代码冲突,并支持远程仓库的管理和同步。同时,Git还提供了很多有用的命令和工具,如git clone、git push、git pull、git merge等,可以使得代码的管理更加方便快捷。Git已经成为现代软件开发必备的工具之一。</p><p>不过对于我来说,Git最大的用处是多端协同,文件同步,比如多个设备写blog,pull下来就行。</p><p><strong>一般工作流程如下:</strong></p><ul><li>克隆 Git 资源作为工作目录。</li><li>在克隆的资源上添加或修改文件。</li><li>如果其他人修改了,你可以更新资源。</li><li>在提交前查看修改。</li><li>提交修改。</li><li>在修改完成后,如果发现错误,可以撤回提交并再次修改并提交。</li></ul><h1 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h1><p>Git官网下载地址:<a href="https://git-scm.com/downloads">https://git-scm.com/downloads</a></p><ul><li><p><strong>Windows</strong>直接下载安装包运行就行</p></li><li><p><strong>Linux</strong></p><ul><li><p><strong>Debian/Ubuntu</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_">$ </span><span class="language-bash">apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \</span><br><span class="language-bash"> libz-dev libssl-dev</span><br> <br><span class="hljs-meta prompt_">$ </span><span class="language-bash">apt-get install git</span><br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_">$ </span><span class="language-bash">git --version</span><br> git version 1.8.1.2<br></code></pre></td></tr></table></figure></li><li><p><strong>Centos/RedHat</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_">$ </span><span class="language-bash">yum install curl-devel expat-devel gettext-devel \</span><br><span class="language-bash"> openssl-devel zlib-devel</span><br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_">$ </span><span class="language-bash">yum -y install git-core</span><br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_">$ </span><span class="language-bash">git --version</span><br>git version 1.7.1<br></code></pre></td></tr></table></figure></li></ul></li></ul><h1 id="基本操作"><a href="#基本操作" class="headerlink" title="基本操作"></a>基本操作</h1><p>需要你先有Github的号,然后创建仓库,这边不演示。</p><p>本次主要演示关联仓库同步和拉取。</p><p><strong>初始化仓库:</strong>到你想创建的仓库,或者就是一个文件夹</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">git init<br></code></pre></td></tr></table></figure><p><strong>关联仓库:</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">git remote add origin + 你的远程git仓库地址。<br></code></pre></td></tr></table></figure><p><strong>文件添加到本地仓库:</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell">git add .<br>git commit -am "备注"<br></code></pre></td></tr></table></figure><p><strong>推送:</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">git push -u origin master <br></code></pre></td></tr></table></figure><p>此时Github仓库上就有你同步的文件。</p><p><strong>克隆:</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">git clone + ‘项目的远程仓库地址’<br></code></pre></td></tr></table></figure><p>克隆远端仓库,在文件夹夹执行,能够保证一致性。</p><h1 id="常用命令"><a href="#常用命令" class="headerlink" title="常用命令"></a>常用命令</h1><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><code class="hljs shell">git init //初始化本地git环境<br>git clone XXX //克隆一份代码到本地仓库<br>git pull //把远程库的代码更新到工作台<br>git pull --rebase origin master //强制把远程库的代码跟新到当前分支上面<br>git fetch //把远程库的代码更新到本地库<br>git add . //把本地的修改加到stage中<br>git commit -m 'comments here' //把stage中的修改提交到本地库<br>git push //把本地库的修改提交到远程库中<br>git branch -r/-a //查看远程分支/全部分支<br>git checkout master/branch //切换到某个分支<br>git checkout -b test //新建test分支<br>git checkout -d test //删除test分支<br>git merge master //假设当前在test分支上面,把master分支上的修改同步到test分支上<br>git merge tool //调用merge工具<br>git stash //把未完成的修改缓存到栈容器中<br>git stash list //查看所有的缓存<br>git stash pop //恢复本地分支到缓存状态<br>git blame someFile //查看某个文件的每一行的修改记录()谁在什么时候修改的)<br>git status //查看当前分支有哪些修改<br>git log //查看当前分支上面的日志信息<br>git diff //查看当前没有add的内容<br>git diff --cache //查看已经add但是没有commit的内容<br>git diff HEAD //上面两个内容的合并<br>git reset --hard HEAD //撤销本地修改<br>echo $HOME //查看git config的HOME路径<br>export $HOME=/c/gitconfig //配置git config的HOME路径<br></code></pre></td></tr></table></figure><p>如果你是团体协作的话,学会下面的命令:</p><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><code class="hljs awk">git clone XXX <span class="hljs-regexp">//</span>克隆代码库<br>git checkout -b test <span class="hljs-regexp">//</span>新建分支<br>modify some files <span class="hljs-regexp">//</span>完成修改<br>git add . <span class="hljs-regexp">//</span>把修改加入stage中<br>git commit -m <span class="hljs-string">''</span> <span class="hljs-regexp">//</span>提交修改到test分支<br>review代码<br>git checkout master <span class="hljs-regexp">//</span>切换到master分支<br>git pull <span class="hljs-regexp">//</span>更新代码<br>git checkout test <span class="hljs-regexp">//</span>切换到test分支<br>git meger master <span class="hljs-regexp">//</span>把master分支的代码merge到test分支<br>git push origin 分支名 <span class="hljs-regexp">//</span>把test分支的代码push到远程库<br></code></pre></td></tr></table></figure><p><img src="https://tuchuang-1308973922.cos.ap-guangzhou.myqcloud.com/BLOG/DATA/202302161147461.png"></p>]]></content>
<categories>
<category>IT</category>
<category>Other</category>
</categories>
<tags>
<tag>IT</tag>
</tags>
</entry>
<entry>
<title>Anaconda和Jupyter</title>
<link href="/2023/02/15/IT/Python/Anaconda_and_Jupyter/"/>
<url>/2023/02/15/IT/Python/Anaconda_and_Jupyter/</url>
<content type="html"><![CDATA[<h1 id="Anaconda"><a href="#Anaconda" class="headerlink" title="Anaconda"></a>Anaconda</h1><p>Anaconda是一种流行的数据科学和机器学习开发平台,提供了一个<strong>虚拟集成</strong>的环境来管理软件包和依赖项、编写、测试、部署和运行数据分析、科学计算和机器学习的代码(许多流行的科学计算、数据分析、机器学习和可视化的库,如NumPy、SciPy、Pandas、Scikit-learn、TensorFlow等。Anaconda也包括一个名为conda的包管理系统)。它包含了一个基于Python的发行版,其中,它可以轻松地安装、更新和管理软件包和环境,使得数据科学家、研究人员和工程师可以更快、更方便地构建和部署数据分析和机器学习模型。<br><u>简单来说就是可以提供多套<strong>虚拟</strong>的环境运行各种各样的包,就像容器,互不干扰,可以设置多个不同版本的python、TensorFlow等,去满足对应程序的需要。</u></p><h2 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h2><p><strong>conda</strong>是一种通用包管理系统。<br><strong>Anaconda</strong>则是一个打包的集合,里面预装好了conda、某个版本的python、众多packages、科学计算工具等等,就是把很多常用的不常用的库都给你装好了。<br><strong>Miniconda</strong>,顾名思义,它只包含最基本的内容——python与conda,以及相关的必须依赖项,对于空间要求严格的用户,Miniconda是一种选择。就只包含最基本的东西,其他的库得自己装。</p><p>推荐安装Anaconda。</p><p>Anaconda官网地址:<a href="https://www.anaconda.com/">https://www.anaconda.com/</a></p><p><img src="https://tuchuang-1308973922.cos.ap-guangzhou.myqcloud.com/BLOG/DATA/202302152147820.png"></p><p>下载后运行安装程序</p><p><img src="https://tuchuang-1308973922.cos.ap-guangzhou.myqcloud.com/BLOG/DATA/202302152151534.png"></p><h2 id="基本操作"><a href="#基本操作" class="headerlink" title="基本操作"></a>基本操作</h2><p>可以用CMD也可以用Anaconda shell(安装后开始菜单就有)</p><p><strong>创建环境</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">--name 或 -n 后接环境名称,python=后可以指定虚拟环境中python的版本</span><br>conda create --name 环境名称 python=3.7<br></code></pre></td></tr></table></figure><p><strong>查看虚拟环境</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">conda env list<br></code></pre></td></tr></table></figure><p><strong>进入环境</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs shell">conda activate 环境名称<br><span class="hljs-meta prompt_"># </span><span class="language-bash">若conda activate 环境名称 无法运行,则运行下面命令</span><br>source activate 环境名称<br></code></pre></td></tr></table></figure><p><strong>查看系统python包或虚拟环境包</strong>,<strong>在对应的环境输入</strong>:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">在系统输入就是系统的,在虚拟环境输入就是虚拟环境的</span><br>conda list<br></code></pre></td></tr></table></figure><p><strong>关闭虚拟环境</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">conda deactivate<br></code></pre></td></tr></table></figure><p><strong>虚拟环境安装包</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell">conda install 包名称<br><span class="hljs-meta prompt_"># </span><span class="language-bash">其实直接用pip也可以</span><br></code></pre></td></tr></table></figure><p><strong>虚拟环境删除包</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">conda remove numpy<br></code></pre></td></tr></table></figure><p><strong>删除一个虚拟环境</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">conda remove --name 环境名称 --all<br></code></pre></td></tr></table></figure><h2 id="换源"><a href="#换源" class="headerlink" title="换源"></a>换源</h2><p>可以更换成国内的镜像源,提高下载速度</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">清华源</span><br>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/<br>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge<br>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/<br>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/<br>conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/<br>conda config --set show_channel_urls yes<br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">中科大源</span><br>conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/<br>conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/<br>conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/<br>conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/<br>conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/<br>conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/<br>conda config --set show_channel_urls yes<br></code></pre></td></tr></table></figure><p><strong>恢复默认源</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">conda config --remove-key channels<br></code></pre></td></tr></table></figure><p><strong>查看源</strong></p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs shell">conda config --show<br></code></pre></td></tr></table></figure><h3 id="手动换源-和-修改存放虚拟环境的位置"><a href="#手动换源-和-修改存放虚拟环境的位置" class="headerlink" title="手动换源 和 修改存放虚拟环境的位置"></a>手动换源 和 修改存放虚拟环境的位置</h3><p>先输入:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">获取或创建.condarc文件的位置</span> <br>conda config --set show_channel_urls yes<br></code></pre></td></tr></table></figure><p>打开后:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><code class="hljs shell">将default_channels的链接替换成你要换的源<br>channels:<br> - defaults<br>show_channel_urls: true<br>default_channels:<br>- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/<br>- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge<br>- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/<br>- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/<br>- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/<br>- defaults # 这段可以选择删除<br><span class="hljs-meta prompt_"># </span><span class="language-bash">上面的https有概率会报错,如果报错可以替换成http再尝试</span><br><span class="hljs-meta prompt_"></span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">envs_dirs:后接你要存放虚拟环境的位置</span><br><span class="hljs-meta prompt_"># </span><span class="language-bash">pkgs_dirs:后接你要存放虚拟环境的位置</span><br>envs_dirs:<br> - E:\condatata\envs<br>pkgs_dirs:<br> - E:\condatata\pkgs<br><span class="hljs-meta prompt_"># </span><span class="language-bash">其他不用改</span><br></code></pre></td></tr></table></figure><h1 id="Jupyter"><a href="#Jupyter" class="headerlink" title="Jupyter"></a>Jupyter</h1><p>Jupyter是一种开源的<strong>Web</strong>应用程序,允许用户创建和共享文档,文档包含了实时代码、方程、可视化图表以及说明文本。Jupyter不仅仅是一个Python开发环境,它支持超过100种编程语言,如R、Julia等,甚至可以把多种编程语言混合在一个文档中编写和运行。</p><p>Jupyter的核心是Jupyter <strong>Notebook</strong>,它允许用户在浏览器中创建、编辑和运行<strong>交互式</strong>代码块,每个代码块可以单独运行。用户可以使用Markdown语言撰写文档,其中可以包含代码、数学公式、图表和注释,使得文档更加丰富、易于理解和易于共享。Jupyter Notebook还支持将Notebook转换成多种格式,如HTML、LaTeX、PDF、Markdown、reStructuredText等。</p><p>除了Notebook,Jupyter还提供了JupyterLab,它是Jupyter的下一代用户界面,提供了更加灵活和强大的功能,如多文档界面、代码编辑器、终端、文件浏览器等。JupyterLab也是一个基于Web的应用程序,用户可以在浏览器中使用它。</p><p><u>我们需要记住的是:web界面、支持多语言、交互式、和代码块(可以分段运行)</u></p><h2 id="安装-1"><a href="#安装-1" class="headerlink" title="安装"></a>安装</h2><p>安装Anaconda后就不用,会同步安装,在系统的开始菜单里就有。</p><p>Jupyter官网地址:<a href="https://jupyter.org/">https://jupyter.org/</a></p><h2 id="指令"><a href="#指令" class="headerlink" title="指令"></a>指令</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">需要记住,不过可以点击语言图标启动。</span><br>jupyter notebook<br></code></pre></td></tr></table></figure><h2 id="更换默认工作位置"><a href="#更换默认工作位置" class="headerlink" title="更换默认工作位置"></a>更换默认工作位置</h2><p>通常启动后的工作位置是当前用户的文件里,可以更改工作位置到特定的文件夹来方便整理和管理。</p><p>打开Anaconda Prompt,运行:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell">jupyter notebook --generate-config<br><span class="hljs-meta prompt_"># </span><span class="language-bash">会弹出jupyter_notebook_config.py链接,找到对应位置</span><br></code></pre></td></tr></table></figure><p>打开jupyter_notebook_config.py</p><p>找到:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_">#</span><span class="language-bash">c.NotebookApp.notebook_dir =</span><br>去掉#,修改为:<br>c.NotebookApp.notebook_dir = '你的工作目录'<br></code></pre></td></tr></table></figure><p>后在开始菜单或者找到Jupiter Notebook右键属性,在目标栏删除最后的”%USERPROFILE%”</p><p><img src="https://tuchuang-1308973922.cos.ap-guangzhou.myqcloud.com/BLOG/DATA/202302152223667.png"></p><p>后再打开就发现里面便是你是设置的文件夹目录</p><h1 id="Jupyter和Anaconda的配合"><a href="#Jupyter和Anaconda的配合" class="headerlink" title="Jupyter和Anaconda的配合"></a>Jupyter和Anaconda的配合</h1><ol><li>首先系统也就是Base环境运行下列指令:</li></ol><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">安装nb——conda</span><br>conda install nb_conda<br></code></pre></td></tr></table></figure><ol start="2"><li>启动Jupyter,出现Conda后代表安装完成:</li></ol><p><img src="https://tuchuang-1308973922.cos.ap-guangzhou.myqcloud.com/BLOG/DATA/202302152227559.png"></p><ol start="3"><li>进入每一个虚拟环境(后面每一次创建后都需要运行安装)安装Jupyter Notebook:</li></ol><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs shell"><span class="hljs-meta prompt_"># </span><span class="language-bash">安装Jupter</span><br>conda install jupyter<br></code></pre></td></tr></table></figure><ol start="4"><li>完成。可以再conda查看和管理虚拟环境</li></ol><p><img src="https://tuchuang-1308973922.cos.ap-guangzhou.myqcloud.com/BLOG/DATA/202302152231351.png"></p><ol start="5"><li>也可以打开文件后非常方便的切换虚拟环境</li></ol><p><img src="https://tuchuang-1308973922.cos.ap-guangzhou.myqcloud.com/BLOG/DATA/202302152232660.png"></p>]]></content>
<categories>
<category>IT</category>
<category>Python</category>
</categories>
<tags>
<tag>IT</tag>
<tag>Python</tag>
</tags>
</entry>
<entry>
<title>Python基本介绍和规范</title>
<link href="/2023/02/15/IT/Python/Python%E5%9F%BA%E6%9C%AC%E4%BB%8B%E7%BB%8D%E5%92%8C%E8%A7%84%E8%8C%83/"/>
<url>/2023/02/15/IT/Python/Python%E5%9F%BA%E6%9C%AC%E4%BB%8B%E7%BB%8D%E5%92%8C%E8%A7%84%E8%8C%83/</url>
<content type="html"><![CDATA[<ul><li><p>就不放代码了,本身也是初学者,这里介绍下是什么、一点代码规范、路线、学习资源吧</p></li><li><p>廖雪峰 Python3 教程(非常推荐):<a href="https://www.bookstack.cn/books/liaoxuefeng-python30">https://www.bookstack.cn/books/liaoxuefeng-python30</a></p></li><li><p><em>Python - 100天从新手到大师</em>:<a href="https://www.bookstack.cn/books/Python-100-Days">https://www.bookstack.cn/books/Python-100-Days</a></p></li><li><p>张建新的python教程(建议先看上面的):<a href="https://space.bilibili.com/334932752">https://space.bilibili.com/334932752</a></p></li></ul><h1 id="是什么和能做什么"><a href="#是什么和能做什么" class="headerlink" title="是什么和能做什么"></a>是什么和能做什么</h1><p><strong>是什么:</strong></p><p>Python是一种高级编程语言,具有简洁、易读、易维护等特点,被广泛应用于科学计算、人工智能、数据分析、Web开发、自动化测试等领域。Python语言简洁易读的语法、丰富的第三方库、跨平台的特性以及大量优秀的框架等,使得Python语言备受开发者青睐,成为目前最流行的编程语言之一。另外,Python还具有开源、免费、社区活跃等特点,使得更多的开发者加入到Python社区中,使Python在不断发展壮大的同时,也形成了强大的生态系统。</p><p><strong>能做什么:</strong></p><ul><li>爬虫</li><li>科学计算</li><li>数据处理到数据分析</li><li>人工智能、搭建神经网络</li><li>Web开发</li><li>自动化测试、自动化运维</li></ul><p>非常多,越来越多人去使用和构建社区,有非常强大的生态系统。</p><h1 id="代码规范"><a href="#代码规范" class="headerlink" title="代码规范"></a>代码规范</h1><p>挺重要,因为python会根据缩减判断,也会对大小敏感。</p><ol><li><p>文件名和文件路径不要出现中文 禁止使用空格</p></li><li><p>文件名不要不要如系统的包重复,会报错,如numpy.py(md)</p></li><li><p>标识符:</p><ol><li>标识符由字母+数字+下划线组成</li><li>不能以数字开头</li><li>区分大小写</li><li>单下划线开头,代表不能直接访问的类属性</li><li>双下划线开头,代表特殊方法</li><li>一行多条语句用分号;分开</li></ol></li><li><p>保留字:</p><ol><li>所有的Python关键字只包含小写字母</li><li>and/break/continue/import/def</li></ol></li><li><p>行和缩进:</p><ol><li>缩减表明模块,严格执行缩减</li><li>一般新行作为语句/模块的结束符</li><li>把一个Tab改成四个缩进</li></ol></li><li><p>多行语句:</p><ol><li>使用斜杠\将一行语句分为多行显示</li><li>语句包含[],{}.()就不需要多行连接符</li></ol></li><li><p>引号:</p><ol><li>引号开始和结尾必须使用想用类型(””.’’.”””)</li><li>三引号组成多行,用于文档注释</li></ol></li><li><p>注释:</p><ol><li>单行注释用#开头</li></ol></li><li><p>空行</p><ol><li>函数之间或类之间用空行分割,表示一段新代码的开始</li><li>类和函数入口之间也可用一行空行分割,以突出函数入口的开始</li></ol></li><li><p>类名</p><ol><li><p>大驼峰命名法</p></li><li><p>CapWords</p></li><li><p>每个单词首字母大写</p></li><li><p>单词和单词之间没有下划线</p></li></ol></li><li><p>导入模块时,每个导入应该独占一行</p></li><li><p>导入顺序</p><ol><li>内置模块</li><li>自定义模块</li><li>第三方模块</li></ol></li></ol><h1 id="道德规范"><a href="#道德规范" class="headerlink" title="道德规范"></a>道德规范</h1><p>学习和使用爬虫,<strong>绝对不能涉及别人的隐私,这是严重违法!</strong></p><h2 id="关键字"><a href="#关键字" class="headerlink" title="关键字"></a>关键字</h2><p><img src="https://tuchuang-1308973922.cos.ap-guangzhou.myqcloud.com/BLOG/DATA/202302172045291.png"></p>]]></content>
<categories>
<category>IT</category>
<category>Python</category>
</categories>
<tags>
<tag>IT</tag>
<tag>Python</tag>
</tags>
</entry>
<entry>
<title>Hello,World</title>
<link href="/2023/02/15/Hello-World/"/>
<url>/2023/02/15/Hello-World/</url>
<content type="html"><![CDATA[<p>2022-02-09建站,中途完全荒废,后重装系统,造成数据丢失,2023-02-15重新开始,希望能够持续写吧。</p><p>主要写一些IT、哲学、折腾的事。</p><p>共勉。</p>]]></content>
</entry>
</search>