python
SHUIPING_YANG
事在人为,凡事预则立,不预则废!
展开
-
查看pip安装默认地址python包安装地址
转载自:https://blog.csdn.net/mukvintt/article/details/80908951python -m site查看配置文件路径:python -m site -help默认就是这个文件了:C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site.py原创 2020-07-17 22:02:28 · 4232 阅读 · 1 评论 -
python-4.文本,文本结合
exercise 6 文本格式化在python里面,一切都是对象,对象拥有很多属性和方法.例如字符串就有format方法,传递参数到占位符.连接两个字符串用’+’print(x,y)这样的话x和y之间会有一个空格.types_of_people = 10x=f"There are {types_of_people} types of people."binary = "binar...原创 2019-04-19 22:43:18 · 327 阅读 · 0 评论 -
python-3.数字运算,变量,格式化输出
exercise 3 数字运算加减乘除,注意运算顺序print("I will now count my chickens:")print("Hens",25+30/6)print("Roosters",100-25*3*4)print("Now I will cout the eggs:")print(3+2+1-5+4%2-1/4+6)print("Is it true t...原创 2019-04-18 22:53:10 · 495 阅读 · 0 评论 -
python-2.输出字符串,注释
exercise 1print somthing you likeprint("Wello World!")print("Hello Again!")print('I like typing this.')print("This is fun!")print('Yay! Pringing.')print("I'd much rather you 'not'.")print('I...原创 2019-04-17 22:51:21 · 595 阅读 · 0 评论 -
python-1.安装
1.下载:https://www.python.org/downloads/release/python-373/2.自定义安装双击安装,选择自定义安装,勾选环境变量,设置安装路径,点击下一步,安装成功!3.安装之后测试测试一下,插卡python版本及pip是否正常.到这里,python就安装好了....原创 2019-04-16 22:55:20 · 233 阅读 · 0 评论 -
python - 7.读取文件内容
读取文件内容:from sys import argvscript ,filename = argvprint(f"你要打开的是{filename}:")# text = open(filename)text = open(filename,'r', encoding='UTF-8')content = text.read();print(f"文件内容是:{content}")...原创 2019-04-21 17:51:51 · 499 阅读 · 0 评论 -
python-6.接受用户输入
先来第一个版本:exercise 11 Asking Questionprint("How old are you?",end=" ")age = input()print("How tall are you?",end=" ")height = input()print("How much do you weight?",end=" ")weight = input()pr...原创 2019-04-21 10:07:35 · 987 阅读 · 0 评论 -
python-5.原样输出,转义字符
python换行符,\n,tab制表符\t多行文本原样输出.不解析变量,但是换行符号,转义字符仍旧生效,与php里面的nowdoc类似.三个单引号与三个双引号作用一样.# Here's some new strange stuff, remember type it exactly.days = "Mon Tue Wed Thu Fri Sat Sun"months = "\nJan\n...原创 2019-04-20 19:57:15 · 9461 阅读 · 0 评论 -
python将图片转换为pdf
需要先安装reportlab,这个安装容易报错,解决办法如下:https://blog.csdn.net/zhezhebie/article/details/88846824python将图片转换为pdf,代码如下:from reportlab.pdfgen import canvasfrom reportlab.lib.units import inch, cmfrom reportl...转载 2019-03-27 15:59:51 · 12575 阅读 · 2 评论 -
python安装reportlab
python3.6安装reportlab的时候报错,错误信息如下:Collecting reportlabRetrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(1, ‘[SSL: CERTIFICA...转载 2019-03-27 15:44:00 · 8092 阅读 · 0 评论 -
python加密源代码
python加密代码:https://pyarmor.readthedocs.io/zh/latest/installation.htmlhttps://github.com/dashingsoft/pyarmor-docs-zh/blob/master/docs/installation.rst原创 2019-03-27 14:19:16 · 1045 阅读 · 0 评论 -
python打包程序为exe
正常安装:pip install pyinstaller正常更新:pip install --upgrade pyinstaller安装开发中的:pip install https://github.com/pyinstaller/pyinstaller/tarball/develop写了个python程序,想把它变成exe程序,使其可以在任何windows上运...原创 2018-08-21 15:12:50 · 3536 阅读 · 7 评论 -
windows下python批量转换ppt为图片和PDF
python3.6批量将ppt转换为pdf:import sys, os# 调用com组件包import comtypes.client# 第一步:得到ptrdef init_powerpoint(): powerpoint = comtypes.client.CreateObject("Powerpoint.Application&am原创 2018-08-21 10:06:48 · 3435 阅读 · 8 评论 -
python变ftp服务器
下载并安装Python,例如这里想把命令E:\easytest作为提供下载的目录,那么在cmd里cd到该目录下,并执行命令:python.exe -m SimpleHTTPServer 如果提示错误: No module named SimpleHTTPServer则试一下命令:python.exe -m http.server命令过程:PS D:\oid...转载 2018-07-05 10:43:10 · 392 阅读 · 0 评论