摘要:
list1 = [1, 2, 4] list2 = [1, 2, 4] def func1(key, *args): print('func1', key, args) # kye func1 ([1, 2, 4], [1, 2, 4]) func1('func1', list1, list2) # 阅读全文
随笔分类 - PYTHON
音频响度分析和获取
2020-04-12 23:13 by petty, 2333 阅读, 收藏,
摘要:
# -*- coding: utf-8 -*-#/usr/local/bin/python3# @Time : 2020/3/7 4:05 PM# @Author : eric# @File : get_audio_loudness.py# @Software: PyCharmimport osim 阅读全文
下载腾讯视频mp4格式
2020-04-12 23:01 by petty, 749 阅读, 收藏,
摘要:
import time import subprocess import argparse def command(cmd, timeout=60): ''' :param cmd: 执行命令cmd,返回命令输出的内容。 :param timeout: 最长等待时间,单位:秒 :return: '' 阅读全文
列表使用
2020-03-15 22:58 by petty, 160 阅读, 收藏,
摘要:
列表的函数使用: append('a') 往列表末尾添加 extends(['a','b']) + 往列表添加列表 insert(index, 'a') 指定位置添加,其他完后移 sorted(list, reverse=False) 排序 默认升序,reverse=True降序 del lisnt 阅读全文
字符串常用方法
2020-03-15 22:25 by petty, 193 阅读, 收藏,
摘要:
大小写 upper() lower() 查找 find() 替换 replace(old,new) 分割 split('分割符') >list 连接 join() '-'.join('abc') > a-b-c 编码 encode() 编码 decode() 解码 个数 count() 去除空格 s 阅读全文
python命名规则
2020-03-01 23:04 by petty, 291 阅读, 收藏,
摘要:
以字母、下划线开头 原则:见名知意 区分大小写 建议: 驼峰式:getName payMoney 除第一个单词以后的每个单词的首字母大写 类:GetName 下划线式: get_name pay_money 阅读全文
浙公网安备 33010602011771号