- 博客(8)
- 收藏
- 关注
原创 python添加第三方库
一、pycharm交互操作添加第三方库1.进去settings设置2.检查环境中是否有lib找到project interpreter 右边点击settings按钮 选择show all确认环境中包含 site-packages这个文件夹3.确认之前未安装过 就可以搜索并安装所需的第三方库以上操作正常就可以安装成功了 但是我按此方法尝试安装pydicom和opencv均失败并且及时更新过pip版本 还是一样的报错 不能安装报错示意如下 提示在terminal里用pip安装 因此使用方法2
2021-03-11 14:42:37 9986
原创 Learn Python3 the Hard Way Ex14 提示和传递
代码# Ex14 提示和传递from sys import argvscript, user_name = argvprompt = '>' # prompt 提示符print(f"Hi {user_name}, I'm the {script} script.")print("I'd like to ask you a few questions")print(f"...
2020-01-02 15:52:26 98
原创 Learn Python3 the Hard Way Ex13 参数、解包和变量
代码# Ex13 参数、解包和变量# argv 参数变量 argument variable 这个变量保存着运行python脚本时传递给python脚本的参数from sys import argv # 导入的特性称为模块 module (或库 library)# read the WYSS section for how to run this# 将argv 解包(unpac...
2020-01-02 14:49:13 142
原创 Learn Python3 the Hard Way Ex12 提示别人
代码# Ex 12 提示别人age = input("How old are you? ")height = input("How tall are you? ")weight = input("How much do you weight? ")print(f"So, you're {age} years old, {height} centimeters tall and {w...
2020-01-02 11:17:59 108
原创 Learn Python3 the Hard Way Ex11 提问
代码# Ex11 提问print("How old are you?", end=' ')age = input()print("How tall are you?", end=' ')height = input()print("How much do you weigh?", end=' ')weight = input()print(f"So, you're {age} ...
2019-12-30 11:39:46 94
原创 Learn Python3 the Hard Way Ex10 那是什么(转义序列)
代码# Ex10 那是什么# 转义序列 escape sequence# 法一:转义字符 \# 字符串内还有引号,为了让Python清楚字符串里面的引号不是真正的语法层面的引号,# 需要将内部的双引号或者单引号转义print("I am 6'2\" tall.") # 将字符串中的双引号转义print('I am 6\'2" tall.') #将字符串中的单引号转义# 法二...
2019-12-30 11:18:28 149
原创 Learn Python3 the Hard Way Ex9 打印,打印,打印
代码# Ex9 打印,打印,打印days = "Mon Tue Wes Thu Fri Sat Sun"# months = "Jan/nFeb/nMar/nApr/nMay/nJun/nJul/nAug"# 错误运行结果:Here are the months: Jan/nFeb/nMar/nApr/nMay/nJun/nJul/nAugmonths = "Jan\nFeb\nMar...
2019-12-30 09:51:33 120
原创 Learn Python3 the Hard Way Ex6 字符串和文本
代码# Ex6 字符串和文本# 字符串可以使用"f-string" 也可以使用.format()语法的格式化方式# f"some stuff here {avariable}"# f"som other stuff {anothervar}"types_of_people = 10x = f"There are {types_of_people} types of people."...
2019-12-27 14:34:17 101
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人