Linux下的python3与pycharm的安装

python3的编译和安装:

1.拿到源码包(3.6) —> 官网(www.python.org)

[root@westos ~]# lftp 172.25.254.250
lftp 172.25.254.250:~> cd pub/python/software/
lftp 172.25.254.250:/pub/python/software> get Python-3.6.4.tgz 
[root@westos ~]# cd Desktop/
[root@westos Desktop]# ls

2.解压[root@westos Desktop]# tar zxf Python-3.6.4.tgz -C /opt/
3.进入解压目录编译和安装[root@westos opt]# yum install gcc zlib zlib-devel openssl-devel -y

./configure --prefix=/usr/local/python3 --with-ssl
--prefix:安装路径  --with-ssl:添加ssl加密
make && make install:安装

5.测试:[root@westos opt]# cd /usr/local/python3/bin ./python3
6.添加python3的命令到环境变量中

临时添加:

[root@westos bin]# export PATH="/usr/local/python3/bin:$PATH"
[root@westos bin]# python3
Python 3.6.4 (default, Aug 26 2019, 21:44:00) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>    

永久添加:

[root@westos bin]# echo export PATH="/usr/local/python3/bin:$PATH" >> ~/.bashrc
[root@westos bin]# vim ~/.bashrc 
[root@westos bin]# source ~/.bashrc 
[root@westos bin]# python3
Python 3.6.4 (default, Aug 26 2019, 21:44:00) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> quit
Use quit() or Ctrl-D (i.e. EOF) to exit
>>> 

pycharm的安装和使用:

[kiosk@foundation20 ~]# lftp 172.25.254.250
lftp 172.25.254.250:~> cd pub/python/software/
lftp 172.25.254.250:/pub/python/software> get pycharm-community-2019.2.1.tar.gz
[kiosk@foundation20 ~]# tar zxf pycharm-community-2019.2.1.tar.gz
[kiosk@foundation20 ~]$ cd pycharm-community-2019.2.1/bin/
[kiosk@foundation20 bin]$ ls
[kiosk@foundation20 bin]$ sh pycharm.sh

【1】【2】

pycharm快捷键:

- pycharm设置界面(ctrl+alt+s)
- 修改菜单栏字体
- 修改代码栏字体
- 修改python解释器位置
- 如何快速创建文件(alt+insert)
- 格式化python代码, 使得风格好看(ctrl+alt+l)
- 如何修改指定功能的快捷键
- 如何撤销代码的修改(ctrl+z)
- 如何取消撤销的代码的修改(ctrl+shift+z)
- 快速重命名(shift+F6)
- 快速注释代码(ctrl+/)
- 快速取消注释代码(ctrl+/)

第一个python程序:

# _*_coding:utf-8_*_
# python2.x:默认使用ASCII编码
# python3.x:默认使用UTF-8编码
# 1.没有分号(编码规范 PEP8)
# 2.严格按照缩进的语言
print('hello python')
print('你好 python')

【3】

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值