一、python的安装
安装Python软件包
1.官网下载压缩包
2.压缩包进行解压
[root@server Python3包]# tar zxf Python-3.6.4.tgz -C /mnt 解压到/mnt 目录下
[root@server Python3包]# cd /mnt
[root@server mnt]# ls
Python-3.6.4
[root@server mnt]#
3、进入目录解压编译和安装
cd Python-3.6.4/
4、下载python所需要的依赖性
[root@server Python-3.6.4]# yum install gcc zlib zlib-devel openssl-devel -y
5、安装
[root@server Python-3.6.4]# ./configure -prefix=/usr/local/python3 --with-ssl
--prefix :安装路径 --with-ssl:添加ssl加密
[root@server Python-3.6.4]# make && make install
make: *** No targets specified and no makefile found. Stop. 一般可能会出现安装不了的情况,环境出现了问题,一般poweroff一下 然后在重新安装就可以
6.测试
[root@server Python-3.6.4]# /usr/local/python3/bin/python3
Python 3.6.4 (default, May 25 2019, 02:31:32)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> a=1
>>> b=2
7、添加python命令到环境变量中去
- 永久添加
[root@server python3]# echo export PATH="/usr/local/python3/bin:$PATH" >> ~/.bashrc 永久添加到这个目录里边的
[root@server python3]# vim ~/.bashrc 查看目录是否添加成功
[root@server python3]# source ~/.bashrc 扫描
[root@server python3]# python3 检测 添加成功
Python 3.6.4 (default, May 25 2019, 02:31:32)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
二、pycharm编译器的安装
[root@server Desktop]# ls
Deskto Documents passwd pycharm-community-2016.3.2.tar.gz
desktop Downloads Pictures Templates
Desktop Music Public Videos
[root@server Desktop]# tar zxf pycharm-community-2016.3.2.tar.gz ##解压压缩包
[root@server Desktop]# ls
pycharm-community-2016.3.2 已经解压的
[root@server Desktop]# cd pycharm-community-2016.3.2/
[root@server pycharm-community-2016.3.2]# ls
bin help Install-Linux-tar.txt lib plugins
build.txt helpers jre license
[root@server pycharm-community-2016.3.2]# cd bin/
[root@server bin]# ls
format.sh idea.properties pycharm64.vmoptions restart.py
fsnotifier inspect.sh pycharm.png
fsnotifier64 log.xml pycharm.sh
fsnotifier-arm printenv.py pycharm.vmoptions
[root@server bin]# sh pycharm.sh & 启动程序
pycharm快捷键
pycharm设置界面(ctrl+alt+s)
修改菜单栏字体
修改代码栏字体
修改python解释器位置
如何快速创建文件(alt+insert)
格式化python代码, 使得风格好看(ctrl+alt+l)
如何修改指定功能的快捷键
如何撤销代码的修改(ctrl+z)
如何取消撤销的代码的修改(ctrl+shift+z)
快速重命名(shift+F6)
快速注释代码(ctrl+/)
快速取消注释代码(ctrl+/)