Windows上Python安装过程,PyCharm快捷键小结

1.python安装

下载官网链接:https://www.python.org/

具体下载安装教程链接:https://www.runoob.com/python/python-install.html

2.pip升级

python -m pip install pandas

You are using pip version 9.0.1, however version 20.1.1 is available.
You should consider upgrading via the ‘python -m pip install --upgrade pip’ command.

键入python -m pip install --upgrade pip ,报错

Collecting pip
Downloading https://files.pythonhosted.org/packages/5c/e0/be401c003291b56efc55aeba6a80ab790d3d4cece2778288d65323009420/pip-19.1.1-py2.py3-none-any.whl (1.4MB)
3% |█ | 40kB 1.4kB/s eta 0:16:01Exception:
Traceback (most recent call last):
File “C:\安装\Python36-32\lib\site-packages\pip_vendor\requests\packages\urllib3\response.py”, line 232, in _error_catcher
yield
File “C:\安装\Python36-32\lib\site-packages\pip_vendor\requests\packages\urllib3\response.py”, line 314, in read
data = self._fp.read(amt)
File “C:\安装\Python36-32\lib\site-packages\pip_vendor\cachecontrol\filewrapper.py”, line 60, in read
data = self.__fp.read(amt)
File “C:\安装\Python36-32\Lib\http\client.py”, line 449, in read
n = self.readinto(b)
File “C:\安装\Python36-32\Lib\http\client.py”, line 493, in readinto
n = self.fp.readinto(b)
File “C:\安装\Python36-32\Lib\socket.py”, line 586, in readinto
return self._sock.recv_into(b)
File “C:\安装\Python36-32\Lib\ssl.py”, line 1009, in recv_into
return self.read(nbytes, buffer)
File “C:\安装\Python36-32\Lib\ssl.py”, line 871, in read
return self._sslobj.read(len, buffer)
File “C:\安装\Python36-32\Lib\ssl.py”, line 631, in read
v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\安装\Python36-32\lib\site-packages\pip\basecommand.py”, line 215, in main
status = self.run(options, args)
File “C:\安装\Python36-32\lib\site-packages\pip\commands\install.py”, line 324, in run
requirement_set.prepare_files(finder)
File “C:\安装\Python36-32\lib\site-packages\pip\req\req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “C:\安装\Python36-32\lib\site-packages\pip\req\req_set.py”, line 620, in _prepare_file
session=self.session, hashes=hashes)
File “C:\安装\Python36-32\lib\site-packages\pip\download.py”, line 821, in unpack_url
hashes=hashes
File "C:\安装\Python36-32\lib\site-packages\pip\download.

原因:服务器超时

解决方法:1.用手机热点或者网线直连

              2.python -m pip install --upgrade pip -i https://pypi.douban.com/simple (链接:https://www.cnblogs.com/karrya/p/10873075.html)

pip --version查看版本信息
在这里插入图片描述

安装库模块

python -m pip install pandas

python -m pip install pyinstaller

python -m pip install xlrd

python -m pip install xlwt

3.PyCharm快捷键

PyCharm安装:https://www.runoob.com/w3cnote/pycharm-windows-install.html

Ctrl + P 如果插入符号位于方法调用的括号之间,按Ctrl + P组合键以显示有效参数的列表。

Ctrl + Q 快速文档

Ctrl + Alt + S 设置

Ctrl + / 行注释

shift+F10 运行

4.简单使用
新建工程
在这里插入图片描述在这里插入图片描述
I:\PyCharm_WorkSpace\Projects\untitled为工程路径
选择Existing interpreter,路径为Python的安装路径,然后点击Create
在这里插入图片描述新建Python文件
在这里插入图片描述
文件名为:xlRd&Wt_test1
在这里插入图片描述
键入print(“Hellow CYY-~”)
在这里插入图片描述打开控制台信息
在这里插入图片描述

运行:快捷键组合shift + F10,结果显示
在这里插入图片描述4.简单语法学习
链接:https://www.w3school.com.cn/python/python_syntax.asp
按照语法训练在文本里面多次练习
实例:
if 5 > 2:
print(“Five is greater than two!”)
在这里插入图片描述
if 5 > 2:
print(“Five is greater than two!”)
if 5 > 2:
print(“Five is greater than two!”)
在这里插入图片描述x = 10
y = “Bill”
print(x)
print(y)
在这里插入图片描述
x = 5 # x is of type int
x = “Steve” # x is now of type str
print(x)
在这里插入图片描述
x, y, z = “Orange”, “Banana”, “Cherry”
print(x)
print(y)
print(z)
在这里插入图片描述x = “awesome”
print("Python is " + x)
在这里插入图片描述
x = "Python is "
y = “awesome”
z = x + y
print(z)
在这里插入图片描述x = 5
y = 10
print(x + y)
在这里插入图片描述

x = 10
y = “Bill”
print(x + y)
错误:数字和字符串不能组合起来
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值