昆明网站开发哪家好,西安网站设计 牛人网络,wordpress如何添加视频,做美食网站的需求觉得学习这本书应该有笔记#xff0c;所以就从这里开始吧。
学习资料#xff1a;
1.《笨办法学Python》#xff08;承德-至阳整理 2013/7/19#xff09;
2.《Learn Python The Hard Way,3rd Edition》 #xff08;Zed A. Shaw 2010#xff09;
一、准备学习环境
#xf…觉得学习这本书应该有笔记所以就从这里开始吧。
学习资料
1.《笨办法学Python》承德-至阳整理 2013/7/19
2.《Learn Python The Hard Way,3rd Edition》 Zed A. Shaw 2010
一、准备学习环境
二下载集成开发环境我使用的是EditPlus4.1因其为收费版怎么找能用的你懂的。
配置集成开发环境
1.打开EditPlus点击 工具-配置用户工具
点击 组名新建一个python组点击 添加工具-应用程序按上图所示在菜单文字、命令、参数、初始目录、动作中添加或选择相应的内容。
2.为了可以捕捉错误输出和输出结果在上图 动作 下拉菜单中选择捕捉输出点击 输出模板按下图所示填写相关内容。
3.安装EditPlus的python插件下载地址http://www.editplus.com/files/pythonfiles.zip解压后复制到EditPlus的安装目录即可如果软件自带可不覆盖使用最新的即可。插件的主要功能是让EditPlus支持语法高亮和函数自动补全功能。
让它们发挥作用 选择 工具-配置用户工具点选左侧选项卡中的文件-设置语法右侧 文件类型 选择 python如下图所示
语法文件:python_extd.stx(也就是editplus目录下面的解压的文件)
自动完成:python.acp
4.点击 上图的 函数模板修改一下这里的正则表达式为:[ \t]*def[ \t].: 确定之后再点击 Tab/缩进,然后填写相应的东西。这里主要是为了让python代码可以自动随进,我们设置了默认是四个空格,这样写出来的代码就很漂亮了!
5.最后一步可以设置一下python的默认模板它的作用是让你新建文件更快捷。
在EditPlus的安装目录新建一个template.py文件内容如下
#!/usr/bin/python
# -*- coding: utf-8 -*-
点击 工具-配置用户工具在左侧的选项卡中点击 文件-模板点击右侧的 添加按钮在弹出的对话框中选择上边新建的template.py文件菜单文本 中填写 python点击 确定 即可。
6.最后建立一个养眼的颜色方案。
新建 EditPlus颜色配置.ini 文件内容如下
[Colors\Text]
Foreground14738148
Background3420457
Default0
[Colors\Embedded script]
Foreground15000288
Default0
[Colors\Active line]
Foreground15000288
Background2699572
Default0
[Colors\Text selection]
Background16512
Default0
[Colors\Line number]
Foreground11723505
Background3420457
Default0
[Colors\Ruler]
Foreground11723505
Background3420457
Default0
[Colors\Cursor indicator]
Foreground15000288
Background2699572
Default0
[Colors\Output window]
Foreground16777215
Background2699572
Default0
[Colors\Tabs and spaces]
Foreground30444
Default0
[Colors\Line break]
Foreground1638527
Default0
[Colors\Column marker]
Foreground15593186
Default0
[Colors\Matching Brace]
Foreground11221743
Background2699572
Default0
[Colors\Folding mark -]
Foreground15000288
Background2699572
Default0
[Colors\Folding mark ]
Foreground15000288
Background2699572
Default0
[Colors\URL]
Foreground11635815
Default0
[Colors\Markers]
Background2699572
Default0
[Colors\Matching words]
Background3420457
Default0
[Colors\Keyword 1]
Foreground6539155
Default0
[Colors\Keyword 2]
Foreground11635815
Default0
[Colors\Keyword 3]
Foreground30444
Default0
[Colors\Keyword 4]
Foreground7163599
Default0
[Colors\Keyword 6]
Foreground11635815
Default0
[Colors\Keyword 7]
Foreground6709465
Default0
[Colors\Line comment]
Foreground9669757
Default0
[Colors\Line comment 2]
Foreground10063553
Default0
[Colors\Block comment]
Foreground10063553
Default0
[Colors\Block comment 2]
Foreground10063553
Default0
[Colors\Quotation]
Foreground30444
Default0
[Colors\Quotation 2]
Foreground30444
Default0
[Colors\Keyword 8]
Foreground30444
Default0
[Colors\Keyword 9]
Foreground30444
Default0
[Colors\Keyword 10]
Foreground30444
Default0
到EditPlus安装目录观察其颜色配置文件的文件名我的是editplus_u,将其改名将上边的ini文件改成该名字复制到这里就可以了。
下面带你去看一下代码效果,选择菜单栏的新建就可以看到有一个python选项了.在这里你简单写点代码测试一下你的配置环境有没有成功。看到报错信息,在下面的错误上面双击就可以跳到错误行了很方便,不然上千行你去找累啊!写完之后保存按ctrl1就可以运行代码了!
要注意的是需要输入参数和在运行中需要人机交互的程序还是需要在控制台环境下运行我还没找到更好的方法。
三我有时候喜欢在多个地点学习配置了多台计算机怎么能同步学习进度呢我采用了使用git的方法下面讲一下我自己琢磨的git的使用。参考了廖雪峰的git教程
1.在gtihub上注册账号。
2.如果是linux系统一般内置git直接使用即可如果没有google或百度之进行安装就行了如果是windows操作系统需要安装git支持程序win7以上可以到Git for Windows下载git的客户端如果是winXP可以到Babun - a windows shell you will love!下载babun使用方法可以自己查看帮助文档。这里只讲git的配置和使用方法。
3.建立本地git账号
git config --global user.name 你的名字
git config --global user.email 你的邮箱
4.在本地生成ssh公钥和私钥
ssh-keygen -t rsa -C 你的邮箱名也可以试试别的
设置ssh文件夹权限
chmod 755 ~/.ssh/
chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa.pub
chmod 644 ~/.ssh/known_hosts
要注意的是.ssh文件夹会因为系统不同位置不同具体可google或百度。known_hosts可能一开始会没有在你使用git上传代码之后会自动生成之后就可以设置了。
将生成的公钥id_rsa.pub中的内容上传到github即 登录你的github账号 - settings,在出现的页面左侧点击SSH and GPG keys
点击 New GPG key将公钥粘贴到出现的页面里提交即可。
5.几种git的使用方法
1本地无任何内容克隆一个完整的工程
git clone gitgithub.com:你的账号/LearnPythonTheHardWay.git
2本地已有工程更新到最新
git fetch --all
git reset --hard LearnPythonTheHardWay/master
3本地新建的工程上传
第一次执行以下命令
git init
git add . #(所有内容添加到仓库)
git commit -m 说明 #告诉git修改版本提交
git remote add LPTHW gitgithub.com:你的账号/LearnPythonTheHardWay.git
git push -u LPTHW master
之后每次提交执行以下命令
git add . #(所有内容添加到仓库)
git commit -m 说明 #告诉git修改版本提交
git push -u LPTHW master
至此开发环境已全部配置完毕可以开始学习之旅了。