
python
海阔天空的阔
好好工作,好好生活
展开
-
anaconda-python 的简单使用
anaconda,它是将Python版本和许多常用的package打包直接来使用的Python发行版,支持linux、mac、windows系统,并有一个conda强大的执行工具。1.关于其他的IDE使用anaconda由于安装完anaconda就自带了Spyder集成开发环境了,所以不需要任何配置可以直接使用,但是其他你自己安装的IDE要想使用anaconda需要配置。2.查看安装包查看已经安装...转载 2018-03-08 10:03:46 · 7563 阅读 · 0 评论 -
python 服务请求flask;grequest并发请求服务
目录1、get-post客户端、服务器端code demo2、grequet并发请求1、get-post客户端、服务器端code demo# coding=utf-8import flaskimport requestsdata = {'query': u'急性化脓性牙髓炎能治好吗 如何治疗急性化脓性牙髓炎'}# 客户端:get请求r = requests.get("https://xxx.com/clf/predict", param...原创 2022-03-31 19:54:07 · 946 阅读 · 1 评论 -
python class
TensorFlow 模型建立与训练 — 简单粗暴 TensorFlow 2 0.4 beta 文档截取tf文档上有python类的前置知识:class MyModel(tf.keras.Model): def __init__(self): super().__init__() # Python 2 下使用 super(MyModel, self).__init__() # 此处添加初始化代码(包含 call 方法中会用到的层),例如原创 2022-01-03 22:32:07 · 755 阅读 · 0 评论 -
python3.6 格式化字符串
def test_py3_format_string_0(name): print(f"{name}") test_py3_format_string_0("xiaohong")def test_py3_format_string(): # Python3.6新引入的一种字符串格式化方法,使格式化字符串的操作更加简便。 # 以 f 或 F 修饰符引领的字符串(f'xxx' 或 F'xxx'),以大括号 {} 标明被替换的字段; # f-string在本质上并.原创 2021-10-11 21:30:14 · 285 阅读 · 1 评论 -
函数参数-
def test_position_arg(arg1, arg2): # 位置参数 print arg1, arg2def test_key_arg(arg1=1, arg2=2): # 关键字参数 print arg1, arg2def test(arg1, arg2=2): # arg2是默认参数 print arg1, arg2# 两种调用方式都可以test(1, 2)test(arg2=22, arg1=11)输出结果:.原创 2021-10-11 20:59:07 · 122 阅读 · 0 评论