python学习笔记

1 . Mac上安装多个版本的Python  

Mac上自带了Python2.x的版本,有时需要使用Python3.0以上版本做开发,如果担心删除自带python版本出现问题或者有系统依赖2.x版本,可以安装多个版本的Python。
Mac系统自带的python路径:/System/Library/Frameworks/Python.framework/Version/x.x
自己安装的python路径:/Library/Frameworks/Python.framework/Version/x.x

如果之前自己安装过python可以按照以下步骤删除:
1️⃣、删除Python框架
sudo rm -rf /Library/Frameworks/Python.framework/Versions/x.x
2️⃣、删除Python程序
sudo rm -rf “/Applications/Python x.x”
 


查看Python版本:

查看Python 2.x(系统自带)   使用命令:which python

查看Python3.x ,使用命令: which python3  【后面加个数字3】

查看Python版本:

python -V  (对python2.x)

python3  -V (对python3.x)


2.Mac终端命令收集:

2.1显示当前路径:pwd

2.2展示当前目录下的文件:ls

加参数    -a   查看隐藏文件

加参数   -l  以长目录显示

-rwxr-xr-x   2 root   wheel      2080  7 16  2017 zless

-rwxr-xr-x   2 root   wheel      2080  7 16  2017 zmore

-rwxr-xr-x   1 root   wheel      3376  7 16  2017 znew

-rwxr-xr-x   1 root   wheel     74672  3 28  2018 zprint

加参数   -R  递归显示  (慎用 ,会递归所有的文件夹)

 

 

 

 

 

 

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值