Python常用功能笔记

本文介绍了在Windows10系统中检查Python安装位置的方法,包括使用命令行工具和`sys.path`。同时,详细讲解了如何通过pip安装pywifi库及其依赖comtypes。此外,还展示了如何打印带有小数点后四位的变量值。
摘要由CSDN通过智能技术生成

Python Learning Notes

1. Check Python Locations

1.1. Win10

下完安装好python后,想查看python的安装位置的几种方法
https://blog.csdn.net/weixin_62375676/article/details/127466029

按下Win+r(也就是命令提示符),输入cmd ,进入

1.1.1. Python Version
python -V
1.1.2. 查看当前python路径
where python
1.1.3. 利用sys.path查询Python安装地址

cmd下,依次输入

  1. python
  2. import sys
  3. print(sys.path)

2. 安装Library

2.1. install pywifi

在Win10中安装pywifi包
https://jingyan.baidu.com/article/a17d528555e7a0c199c8f261.html

以管理员模式打开Windows PowerShell

python -m pip install pywifi

如果安装pywifi提示成功,但 import pywifi 不成功,则需要安装comtypes

python -m pip install comtypes

3. 打印print

3.1. 打印变量variable

print the variable a with 4 digits after the point

print(f"variable a = {a:.4f}")
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值