python
猿来如此呀
啦啦啦啦 哈哈哈哈
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
pip错误No module named 'pip._internal sys.exit(__main__._main())
修改后:#!/usr/bin/python# -*- coding: utf-8 -*-import reimport sysfrom pip import mainif __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(...原创 2020-02-24 15:18:19 · 419 阅读 · 0 评论 -
linux下安装testerSunshine12306抢票程序
环境我的是ubuntu16.04 python3.6 pip19python安装教程pip安装教程获取项目项目地址:https://github.com/testerSunshine/12306复制这个git地址 然后clone下了(没有git命令的sudo apt-get install -y git)git clone https://g...原创 2019-12-27 11:23:55 · 4448 阅读 · 0 评论 -
python3 的pip安装module错误
File "/usr/local/lib/python3.6/subprocess.py", line 418, in run output=stdout, stderr=stderr)subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit原创 2019-12-27 10:05:23 · 4419 阅读 · 2 评论 -
python一行打印1-100的偶数或者奇数的方法
print(list(x for x in range(0, 101) if x % 2 == 0)) #偶数print(list(x for x in range(0, 101) if x % 2 != 0)) #奇数print(list(filter(lambda x: x % 2 == 0, range(101)))) # 偶数print(list(filter(lambda ...原创 2019-07-04 14:20:07 · 10377 阅读 · 1 评论 -
python把元组("a","b")和元组(1,2),变为字典{"a":1,"b":2}
1.tup1=(('a'),('b'))tup2=(('1'),('2'))ret=zip(tup1,tup2)ret2=list(map(lambda tup:{tup[0]:tup[1]},ret))print(ret2)2.print(dict(zip(("a","b"), (1,2))))原创 2019-07-17 11:46:18 · 1928 阅读 · 0 评论 -
[1,2,3,4,5]使用python方法转变成[1,4,9,16,25]
1.print list(map(lambda x:pow(x,2), [1,2,3,4,5]))结果[1, 4, 9, 16, 25]提取大于10的数,最终输出[16,25]print [i for i in list(map(lambda x:pow(x,2), [1,2,3,4,5])) if i > 10]print list(filter(la...原创 2019-07-22 11:20:15 · 1804 阅读 · 0 评论
分享